编码智能体所做的修改会让后续软件维护变得更困难吗?
Do Modifications Made by Coding Agents Make Subsequent Software Maintenance Harder?
AI总结:
该研究推出SWE-Maintain基准,发现智能体编写的代码使后续维护更困难,主要源于继承的测试失败,而非代码本身,建议评估纳入智能体历史并要求智能体保留早期行为。
摘要:
编码智能体会随着时间推移越来越多地维护代码仓库,每次变更都会成为后续任务的起点。然而现有的基准要么从开发者编写的代码启动任务,要么无法将后续任务的难度与智能体早期变更的影响分离开。我们探究智能体编写的代码是否会让后续维护更困难,以及这种代价是否源于继承的测试失败还是代码本身。我们推出SWE-Maintain,包含来自50个真实Python仓库的100个三事件维护片段,每个序列的隐藏测试均已验证。每个后续任务用相同智能体和测试评估两次:分别基于开发者的前置补丁(开发者历史)和智能体自身的变更(智能体历史)。在5个编码系统、2个骨干模型及1996对后续事件中,智能体历史使后续任务解决率平均降低5.6个百分点;当成功还要求所有早期测试通过时,差距达14.0个百分点。三分之二以智能体历史为起点的仓库已存在早期测试失败,且从这些状态启动的事件中仅1.9%最终通过所有累积测试。当继承的代码通过早期测试且下一个任务未被解决时,劣势消失(+2.7个百分点;95%置信区间[-0.5, +6.1])。这些发现表明,智能体编写变更的主要下游代价在于继承的测试失败,而非保留早期已测试行为的代码存在可测量的维护劣势。因此评估应包含智能体生成的历史,且编码智能体应在变更中保留早期行为。
英文摘要:
Coding agents increasingly maintain repositories over time, where each change becomes the starting point for subsequent tasks. Yet existing benchmarks either start tasks from developer-written code or cannot separate later-task difficulty from the effects of an agent's earlier changes. We ask whether agent-written code makes subsequent maintenance harder and whether the cost stems from inherited test failures or the code itself. We introduce SWE-Maintain, comprising 100 three-event maintenance episodes from 50 real-world Python repositories, with hidden tests certified across each sequence. Each later task is evaluated twice with the same agent and tests: from the developers' preceding patches (Developer-History) and from the agent's own changes (Agent-History). Across five coding systems, two backbone models, and 1,996 paired later events, Agent-History reduces later-task resolution by 5.6 percentage points on average. When success additionally requires all earlier tests to pass, the gap reaches 14.0 points. Two-thirds of Agent-History starting repositories already fail earlier tests, and only 1.9% of events starting from those states end with all accumulated tests passing. When the inherited code passes earlier tests and the next task is not already solved, the disadvantage disappears (+2.7 points; 95% CI [-0.5, +6.1]). These findings suggest that the main downstream cost of agent-written changes lies in inherited test failures rather than a measurable maintenance disadvantage in code that preserves earlier tested behavior. Evaluations should therefore include agent-produced history, and coding agents should preserve earlier behavior across changes.
机构、总结、中文摘要均由AI分析而来,可能存在错误,请以论文正文为准。