As autonomous coding agents see rapid adoption, their evaluation has primarily focused on task completion rates holding the target codebase fixed. This leaves a critical question unanswered: does the structural and stylistic quality, or ``cleanliness'' of the underlying code affect an agent's ability to navigate and modify it? To isolate the effect of code cleanliness from agent capability, we introduce an evaluation protocol built around minimal pairs: repositories that match on architecture, dependencies, and external behaviour, but differ on static-analysis rule violations and cognitive complexity. The pairs are constructed in both directions, by agent pipelines that either degrade a clean repository or clean a messy one. We author 33 tasks across six such pairs, evaluated through hidden tests at the application's public surface. Across 660 trials with Claude Code, code cleanliness does not change the agent's pass rate. However, it substantially alters the agent's operational footprint: agents working on cleaner code use 7 to 8% fewer tokens and reduce file revisitations by 34%. Our findings suggest that traditional maintainability principles remain highly relevant in the era of AI-driven development, shaping the computational cost and navigational efficiency of coding agents. Code cleanliness joins model choice, harness, and prompting as a factor that materially affects agent behaviours.


翻译:随着自主编程智能体的快速普及,现有评估主要聚焦于在固定目标代码库条件下的任务完成率。这遗留了一个关键问题:底层代码的结构与风格质量(即"代码整洁性")是否影响智能体的导航与修改能力?为分离代码整洁性与智能体能力的影响,我们提出了一项基于最小对偶集的评估协议:这些代码库在架构、依赖关系及外部行为上保持一致,但在静态分析违规次数与认知复杂度上存在差异。通过智能体管道对整洁代码库进行劣化处理或对杂乱代码库进行清理,我们从双向构建了这些对偶集。基于六组代码库对偶集,我们设计了33项任务,并通过应用程序公开接口的隐藏测试进行评估。在660次基于Claude Code的试验中,代码整洁性并未改变智能体的通过率。然而,它显著改变了智能体的操作开销:处理整洁代码时,智能体减少了7%至8%的令牌消耗量,并将文件重复访问次数降低34%。我们的发现表明,传统代码可维护性原则在AI驱动开发时代依然具有高度相关性,深刻影响着编程智能体的计算成本与导航效率。代码整洁性将与模型选择、工具封装及提示工程并列,成为实质影响智能体行为的关键因素。

0
下载
关闭预览

相关内容

代码(Code)是专知网的一个重要知识资料文档板块,旨在整理收录论文源代码、复现代码,经典工程代码等,便于用户查阅下载使用。
智能体评判者(Agent-as-a-Judge)研究综述
专知会员服务
37+阅读 · 1月9日
智能体工程(Agent Engineering)
专知会员服务
36+阅读 · 2025年12月31日
AI生成代码缺陷综述
专知会员服务
17+阅读 · 2025年12月8日
基于大语言模型的智能体优化研究综述
专知会员服务
64+阅读 · 2025年3月25日
【ETHZ博士论文】机器学习代码: 安全性与可靠性
专知会员服务
19+阅读 · 2024年10月25日
编码计算研究综述
专知会员服务
22+阅读 · 2021年10月26日
《代码整洁之道》:5大基本要点
专知会员服务
50+阅读 · 2020年3月3日
面向人工智能的计算机体系结构
计算机研究与发展
14+阅读 · 2019年6月6日
Forge:如何管理你的机器学习实验
专知
11+阅读 · 2018年12月1日
人工智能对网络空间安全的影响
走向智能论坛
21+阅读 · 2018年6月7日
【干货】深入理解自编码器(附代码实现)
TextInfoExp:自然语言处理相关实验(基于sougou数据集)
全球人工智能
12+阅读 · 2017年11月12日
国家自然科学基金
2+阅读 · 2015年12月31日
国家自然科学基金
2+阅读 · 2015年12月31日
国家自然科学基金
3+阅读 · 2015年12月31日
国家自然科学基金
0+阅读 · 2015年12月31日
国家自然科学基金
0+阅读 · 2015年12月31日
国家自然科学基金
0+阅读 · 2015年12月31日
国家自然科学基金
0+阅读 · 2015年12月31日
国家自然科学基金
2+阅读 · 2015年12月31日
国家自然科学基金
0+阅读 · 2014年12月31日
国家自然科学基金
1+阅读 · 2014年12月31日
Arxiv
0+阅读 · 5月18日
VIP会员
最新内容
学习数据的几何:形状空间分析数学综述
专知会员服务
4+阅读 · 6月17日
定向能反无人机系统最新发展动态
专知会员服务
7+阅读 · 6月17日
从燃煤战舰到算法战争:水面指挥的永恒要求
专知会员服务
4+阅读 · 6月17日
相关VIP内容
智能体评判者(Agent-as-a-Judge)研究综述
专知会员服务
37+阅读 · 1月9日
智能体工程(Agent Engineering)
专知会员服务
36+阅读 · 2025年12月31日
AI生成代码缺陷综述
专知会员服务
17+阅读 · 2025年12月8日
基于大语言模型的智能体优化研究综述
专知会员服务
64+阅读 · 2025年3月25日
【ETHZ博士论文】机器学习代码: 安全性与可靠性
专知会员服务
19+阅读 · 2024年10月25日
编码计算研究综述
专知会员服务
22+阅读 · 2021年10月26日
《代码整洁之道》:5大基本要点
专知会员服务
50+阅读 · 2020年3月3日
相关基金
国家自然科学基金
2+阅读 · 2015年12月31日
国家自然科学基金
2+阅读 · 2015年12月31日
国家自然科学基金
3+阅读 · 2015年12月31日
国家自然科学基金
0+阅读 · 2015年12月31日
国家自然科学基金
0+阅读 · 2015年12月31日
国家自然科学基金
0+阅读 · 2015年12月31日
国家自然科学基金
0+阅读 · 2015年12月31日
国家自然科学基金
2+阅读 · 2015年12月31日
国家自然科学基金
0+阅读 · 2014年12月31日
国家自然科学基金
1+阅读 · 2014年12月31日
Top
微信扫码咨询专知VIP会员