用AI自动定位并修复代码漏洞,准确率优于多数现有方法。
MarsCode Agent: AI-native Automated Bug Fixing
- 结合大模型与代码分析技术,分步完成故障定位与补丁生成。
- 在SWE-bench上修复成功率显著高于多数现有自动化方案。
- 适合希望提升代码质量与开发效率的工程师与研究者。
大型语言模型(LLMs)在代码补全、测试生成和缺陷修复等软件开发任务中展现出巨大潜力。然而,由于真实软件系统复杂多样,利用LLMs进行自动化缺陷修复仍面临挑战。本文提出MarsCode Agent,一种新型框架,通过结合LLMs与先进的代码分析技术,实现对软件代码中缺陷的自动识别与修复。该方法遵循系统化流程:规划、缺陷复现、故障定位、候选补丁生成及验证,以确保修复质量。我们在SWE-bench这一涵盖真实世界软件项目的综合性基准上评估了MarsCode Agent,结果表明其在缺陷修复方面相较于大多数现有自动化方法具有更高的成功率。
原文摘要 · Abstract (English)
Recent advances in large language models (LLMs) have shown significant potential to automate various software development tasks, including code completion, test generation, and bug fixing. However, the application of LLMs for automated bug fixing remains challenging due to the complexity and diversity of real-world software systems. In this paper, we introduce MarsCode Agent, a novel framework that leverages LLMs to automatically identify and repair bugs in software code. MarsCode Agent combines the power of LLMs with advanced code analysis techniques to accurately localize faults and generate patches. Our approach follows a systematic process of planning, bug reproduction, fault localization, candidate patch generation, and validation to ensure high-quality bug fixes. We evaluated MarsCode Agent on SWE-bench, a comprehensive benchmark of real-world software projects, and our results show that MarsCode Agent achieves a high success rate in bug fixing compared to most of the existing automated approaches.
Thank you to arXiv for use of its open access interoperability. PaperDance 不是 arXiv 官方产品;中文卡片由大模型生成,请以原文为准。