Recently, Large Language Model (LLM) based agents have advanced the significant development of Automatic Software Engineering (ASE). Although verified effectiveness, the designs of the existing methods mainly focus on the local information of codes, e.g., issues, classes, and functions, leading to limitations in capturing the global context and interdependencies within the software system. From the practical experiences of the human SE developers, we argue that an excellent understanding of the whole repository will be the critical path to ASE. However, understanding the whole repository raises various challenges, e.g., the extremely long code input, the noisy code information, the complex dependency relationships, etc. To this end, we develop a novel ASE method named RepoUnderstander by guiding agents to comprehensively understand the whole repositories. Specifically, we first condense the critical information of the whole repository into the repository knowledge graph in a top-to-down mode to decrease the complexity of repository. Subsequently, we empower the agents the ability of understanding whole repository by proposing a Monte Carlo tree search based repository exploration strategy. In addition, to better utilize the repository-level knowledge, we guide the agents to summarize, analyze, and plan. Then, they can manipulate the tools to dynamically acquire information and generate the patches to solve the real-world GitHub issues. Extensive experiments demonstrate the superiority and effectiveness of the proposed RepoUnderstander. It achieved 18.5\% relative improvement on the SWE-bench Lite benchmark compared to SWE-agent.
翻译:近年来,基于大语言模型(LLM)的智能体推动了自动软件工程(ASE)的显著发展。尽管现有方法已被验证有效,但其设计主要集中于代码的局部信息(例如问题、类和函数),导致在捕捉软件系统内的全局上下文和相互依赖关系方面存在局限。从人类软件工程开发者的实践经验出发,我们认为对软件仓库的整体理解将是实现ASE的关键路径。然而,理解整个软件仓库带来了诸多挑战,例如极长的代码输入、噪声代码信息、复杂的依赖关系等。为此,我们开发了一种名为RepoUnderstander的新型ASE方法,通过引导智能体全面理解整个软件仓库。具体而言,我们首先以自上而下的模式将整个仓库的关键信息压缩为仓库知识图谱,以降低仓库的复杂性。随后,我们通过提出一种基于蒙特卡洛树搜索的仓库探索策略,赋予智能体理解整个仓库的能力。此外,为了更好地利用仓库级知识,我们引导智能体进行总结、分析和规划。随后,它们可以操作工具动态获取信息,并生成补丁来解决现实世界中的GitHub问题。大量实验证明了所提出的RepoUnderstander的优越性和有效性。与SWE-agent相比,它在SWE-bench Lite基准测试中实现了18.5%的相对性能提升。