arXivDaily arXiv每日学术速递 周一至周五更新
arXiv 2511.11012cs.SE
收藏

超越准确率:智能体多块修复的行为动力学

Beyond Accuracy: Behavioral Dynamics of Agentic Multi-Hunk Repair

The University of British Columbia(不列颠哥伦比亚大学);Queen’s University(女王大学)

Noor Nashid, Daniel Ding, Keheliya Gallaba, Ahmed E. Hassan, Ali Mesbah

AI总结:

研究LLM驱动的编码智能体在多块缺陷修复中的行为,通过404个多块bug的1616条修复轨迹分析定位、修复准确率、回归行为及操作动力学,发现修复准确率随bug分散度和复杂度下降,且失败修复消耗更多资源。

摘要:

传统自动程序修复主要关注单块缺陷,忽略了现实系统中普遍存在的多块bug。修复这些bug需要在多个不连续的代码区域进行协调编辑,带来了更大的挑战。我们首次系统研究了LLM驱动的编码智能体(Claude Code、Codex、Gemini-cli和Qwen Code)在此任务上的表现。我们在PolyHunk数据集的404个多块bug上评估了这四个最先进的智能体,获得了1616条修复轨迹用于大规模行为分析。我们采用细粒度指标评估各智能体的定位、修复准确率、回归行为以及操作动力学。我们发现定位能力差异显著,Codex成功率最高(75.3%),Qwen Code最低(40.4%)。修复准确率也差异很大,范围从26.98%(Qwen Code)到92.82%(Claude Code),并且随着bug分散度和复杂度(块散度和空间邻近性)的增加而持续下降。高性能智能体(Claude Code和Codex)表现出优越的语义一致性,实现了正向的平均回归减少,而低性能智能体常常引入新的测试失败。值得注意的是,智能体不会快速失败;失败的修复消耗了更多的资源(33%-440%的输入token)和更长的执行时间(35%-330%)。此外,我们开发了Maple为智能体提供仓库级上下文。实验结果表明,Maple通过增强定位将Gemini-cli的修复准确率提高了约21%。通过分析细粒度指标和轨迹级分析,本研究超越了准确率,解释了编码智能体在多块修复过程中如何定位、推理和行动。我们的发现强调了bug散度和空间邻近性对编码智能体多块修复成功的影响。

英文摘要:

Automated program repair has traditionally focused on single-hunk defects, overlooking multi-hunk bugs that are prevalent in real-world systems. Repairing these bugs requires coordinated edits across multiple, disjoint code regions, posing substantially greater challenges. We present the first systematic study of LLM-driven coding agents (Claude Code, Codex, Gemini-cli, and Qwen Code) on this task. We evaluate these four state-of-the-art agents on 404 multi-hunk bugs from the PolyHunk dataset, yielding 1,616 repair trajectories for large-scale behavioral analysis. We employ fine-grained metrics to assess localization, repair accuracy, regression behavior, and operational dynamics across agents. We find that localization capability varies substantially, with Codex achieving the highest success rate (75.3%) and Qwen Code the lowest (40.4%). Repair accuracy also differs widely, ranging from 26.98% (Qwen Code) to 92.82% (Claude Code), and consistently declines with increasing bug dispersion and complexity (hunk divergence and spatial proximity). High-performing agents (Claude Code and Codex) demonstrate superior semantic consistency, achieving positive average regression reduction, whereas lower-performing agents often introduce new test failures. Notably, agents do not fail fast; failed repairs consume substantially more resources (33%-440% more input tokens) and require longer execution time (35%-330%). Additionally, we developed Maple to provide agents with repository-level context. Empirical results show that Maple improves repair accuracy of Gemini-cli by ~21% through enhanced localization. By analyzing fine-grained metrics and trajectory-level analysis, this study moves beyond accuracy to explain how coding agents localize, reason, and act during multi-hunk repair. Our findings underscore the impact of bug divergence and spatial proximity on multi-hunk repair success for coding agents.

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

↑