arXivDaily arXiv每日学术速递 周一至周五更新
arXiv 2606.21804cs.SEcs.AIcs.CL
收藏

智能体代码比人类代码更不易维护吗?

Is Agent Code Less Maintainable Than Human Code?

New York University(纽约大学);Carnegie Mellon University(卡内基梅隆大学)

Shaswat Patel, Betty Li Hou, Arun Purohit, Kai Xu, Jane Pan, He He, Valerie Chen

AI总结:

研究通过CodeThread框架对比智能体与人类代码在维护场景下的表现,发现基于智能体代码解决任务的成功率下降高达13.1%,传统可维护性指标无法解释差异,而输入验证、错误处理等行为差异是关键因素。

摘要:

可维护性是软件工程的核心维度,影响着代码的编写、审查和长期演化。尽管编码智能体在单一问题任务上表现出色,但当未来智能体在其基础上构建时,其代码的可维护性尚不清楚,可能导致复合的下游效应。我们研究了智能体代码与人类代码在这些维护场景中的对比,提出了CodeThread框架,用于从仓库级编码基准中构建受控实验。将CodeThread应用于四个前沿编码智能体和四个基准,我们发现智能体在基于智能体代码构建时解决任务的效果低于基于人类代码,任务解决率下降高达13.1%。回归分析表明,许多传统的软件工程可维护性指标无法解释这种差异。相反,最清晰的信号是智能体代码中更微妙的行为差异,例如输入验证和错误处理的更改,以及下游代码大小和任务难度的差异。这些发现强调了不仅需要根据即时任务解决来评估这些系统,还需要根据代码可维护性来评估,并指出了智能体代码引入下游错误的潜在来源。

英文摘要:

Maintainability is a core dimension of software engineering, shaping how code is written, reviewed, and developed over time. While coding agents have demonstrated strong performance on single-issue tasks, it remains unclear how maintainable their code is when future agents build on top of it, potentially leading to compounding downstream effects. We investigate how agent code compares to human code in these maintenance settings, presenting CodeThread, a framework to construct controlled experiments from repository-level coding benchmarks. Applying CodeThread to four frontier coding agents and four benchmarks, we find that agents are less effective at resolving tasks when building on agent code compared to human code, with task resolve rate drops of up to 13.1%. Regression analysis reveals that many traditional software engineering maintainability metrics do not explain this difference. Instead, the clearest signals are subtler behavioral differences in agent code, such as changes to input validation and error handling, along with differences in downstream code size and task difficulty. These findings highlight the need to evaluate these systems not only by immediate task resolution but also by code maintainability, and point to potential sources of downstream errors introduced by agent code.

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

↑