arXivDaily arXiv每日学术速递 周一至周五更新
arXiv 2404.05427cs.SEcs.AI
收藏

AutoCodeRover:自主程序改进

AutoCodeRover: Autonomous Program Improvement

National University of Singapore(新加坡国立大学)

Yuntong Zhang, Haifeng Ruan, Zhiyu Fan, Abhik Roychoudhury

AI总结:

本文提出AutoCodeRover,结合LLM与基于抽象语法树的代码搜索技术自主解决GitHub issues,在SWE-bench-lite上解决率达19%且成本仅0.43美元,展现了自主软件工程潜力。

摘要:

在过去的几十年里,研究人员在自动化软件开发过程方面取得了显著进展。大型语言模型(LLMs)的最新进展对开发过程产生了重大影响,开发者可以使用基于 LLM 的编程助手来实现自动化编码。然而,软件工程除了编码之外还涉及程序改进过程,特别是为了实现软件维护(例如错误修复)和软件演化(例如功能添加)。在本文中,我们提出了一种自动解决 GitHub issues 的方法,以自主实现程序改进。在我们称为 AutoCodeRover 的方法中,LLMs 与复杂的代码搜索能力相结合,最终产生程序修改或补丁。与近期 AI 研究人员和从业者的 LLM 智能体方法相比,我们的视角更倾向于软件工程。我们基于程序表示(抽象语法树)进行工作,而不是将软件项目仅仅视为文件的集合。我们的代码搜索利用类/方法形式的程序结构来增强 LLM 对 issue 根本原因的理解,并通过迭代搜索有效地检索上下文。只要测试套件可用,使用基于测试的基于频谱的故障定位可以进一步锐化上下文。在 SWE-bench-lite(300 个真实的 GitHub issues)上的实验表明,解决 GitHub issues 的有效性有所提高(在 SWE-bench-lite 上为 19%),高于最近报道的 SWE-agent 的有效性。此外,与其他基线相比,AutoCodeRover 以显著更低的成本(平均 0.43 美元)实现了这一有效性。我们假设我们的工作流程能够实现自主软件工程,在未来,LLMs 自动生成的代码可以自主改进。

英文摘要:

Researchers have made significant progress in automating the software development process in the past decades. Recent progress in Large Language Models (LLMs) has significantly impacted the development process, where developers can use LLM-based programming assistants to achieve automated coding. Nevertheless, software engineering involves the process of program improvement apart from coding, specifically to enable software maintenance (e.g. bug fixing) and software evolution (e.g. feature additions). In this paper, we propose an automated approach for solving GitHub issues to autonomously achieve program improvement. In our approach called AutoCodeRover, LLMs are combined with sophisticated code search capabilities, ultimately leading to a program modification or patch. In contrast to recent LLM agent approaches from AI researchers and practitioners, our outlook is more software engineering oriented. We work on a program representation (abstract syntax tree) as opposed to viewing a software project as a mere collection of files. Our code search exploits the program structure in the form of classes/methods to enhance LLM's understanding of the issue's root cause, and effectively retrieve a context via iterative search. The use of spectrum-based fault localization using tests, further sharpens the context, as long as a test-suite is available. Experiments on SWE-bench-lite (300 real-life GitHub issues) show increased efficacy in solving GitHub issues (19% on SWE-bench-lite), which is higher than the efficacy of the recently reported SWE-agent. In addition, AutoCodeRover achieved this efficacy with significantly lower cost (on average, $0.43 USD), compared to other baselines. We posit that our workflow enables autonomous software engineering, where, in future, auto-generated code from LLMs can be autonomously improved.

机构、总结、中文摘要均由AI分析而来,可能存在错误,请以论文正文为准。

↑