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

SWE-Doctor: 通过多面缺陷复现测试的运行时诊断引导软件工程智能体

SWE-Doctor: Guiding Software Engineering Agents with Runtime Diagnosis from Multi-Faceted Bug Reproduction Tests

Yaoqi Guo, Yang Liu, Jie M. Zhang, Yun Ma, Yiling Lou, Zhenpeng Chen

AI总结:

提出SWE-Doctor,通过生成多面缺陷复现测试并执行调试,构建运行时诊断记录,结合定位信息指导补丁生成,在SWE-bench Verified和Pro上平均解决率分别达75.7%和59.4%。

摘要:

基于大型语言模型的软件工程智能体越来越多地被开发出来,通过从问题报告和代码仓库生成补丁来解决软件问题。缺陷复现测试(BRTs)是此类智能体的重要组成部分,已被证明对补丁验证有用。然而,BRTs是否也能帮助更核心的补丁生成阶段仍不清楚。我们首先进行了一项初步研究,发现直接使用高级BRT生成器来指导补丁生成并无益处:失败到失败的BRTs可能误导智能体,而即使是失败到通过的BRTs也带来有限或负面的收益。我们的分析揭示了两个原因:失败到通过的BRTs可能只覆盖报告问题的一种表现,导致部分补丁;而失败到失败的BRTs作为直接的补丁生成目标不可靠。基于这些洞察,我们提出了SWE-Doctor,一种软件问题解决智能体,它利用从多面BRT执行中获得的运行时诊断来指导补丁生成。SWE-Doctor首先为问题中陈述的不同行为需求生成多面BRTs,然后执行并调试这些BRTs以构建基于运行时的诊断记录,最后利用这些诊断以及BRT生成过程中推断出的定位信息来指导补丁生成并减少部分补丁。我们在广泛采用的SWE-bench Verified和SWE-bench Pro上的Python缺陷修复问题上评估了SWE-Doctor,使用了五个LLM后端。SWE-Doctor在所有10个LLM-基准组合中一致优于现有智能体,在SWE-bench Verified上平均解决率为75.7%,在SWE-bench Pro上为59.4%。特别是在更具挑战性的SWE-bench Pro上,SWE-Doctor将平均解决率比基线智能体提高了8.0-8.9个百分点。

英文摘要:

Large language model (LLM)-based software engineering agents are increasingly developed to resolve software issues by generating patches from issue reports and code repositories. Bug reproduction tests (BRTs) are an important building block for such agents and have been shown useful for patch validation. However, it remains unclear whether BRTs can also help the more central stage of patch generation. We first conduct a preliminary study and find that directly using advanced BRT generators to guide patch generation is not beneficial: fail-to-fail BRTs can mislead agents, while even fail-to-pass BRTs bring limited or negative gains. Our analysis reveals two reasons: fail-to-pass BRTs may cover only one manifestation of the reported issue, leading to partial patches, whereas fail-to-fail BRTs are unreliable as direct patch-generation targets. Motivated by these insights, we propose SWE-Doctor, a software issue resolution agent that guides patch generation with runtime diagnoses derived from multi-faceted BRT executions. SWE-Doctor first generates multi-faceted BRTs for different behavioral requirements stated in the issue, then executes and debugs these BRTs to construct runtime-grounded diagnosis records, and finally uses the diagnoses together with localization information inferred during BRT generation to guide patch generation and reduce partial patches. We evaluate SWE-Doctor on Python bug-fixing issues from the widely adopted SWE-bench Verified and SWE-bench Pro across five LLM backends. SWE-Doctor consistently outperforms existing agents across all 10 LLM-benchmark combinations, achieving average resolution rates of 75.7% on SWE-bench Verified and 59.4% on SWE-bench Pro. In particular, on the more challenging SWE-bench Pro, SWE-Doctor improves the average resolution rate by 8.0-8.9 percentage points over the baseline agents.

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

↑