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

修改但验证:对指导性代码修改基准的实证审计

Edit, But Verify: An Empirical Audit of Instructed Code-Editing Benchmarks

Queen's University(女王大学)

Amir M. Ebrahimi, Gopi Krishnan Rajbahadur

AI总结:

本文实证审计了两个指导性代码修改基准,发现其在编程语言、编辑意图和应用领域上存在偏差,且测试覆盖率和测试范围不足,提出六个实证指导原则以改进基准设计。

摘要:

指导性代码编辑,即LLM根据自然语言指令修改现有代码,占真实世界代码助手交互的约19%。然而,很少有基准直接评估这一能力。通过对150多个代码相关基准的调查,发现只有CanItEdit和EDIT-Bench两个基准针对指导性代码编辑,使用人类撰写的指令并进行测试评估。通过比较其编程语言、编辑意图和应用领域与真实世界(Copilot Arena、AIDev、GitHub Octoverse)的分布,并测量所有213个问题的测试数量、语句覆盖率和测试范围,发现两个基准超过90%的评估集中在Python上,而TypeScript(GitHub最常用的语言)缺失。后端和前端开发(占真实世界编辑活动的46%)几乎缺失,文档、测试和维护编辑(占人类PR的31.4%)无代表性。两个基准的测试数量有限(CanItEdit中位数13,EDIT-Bench中位数4),但CanItEdit通过近完整的文件覆盖和fail-before/pass-after验证进行补偿。59%的EDIT-Bench低覆盖套件无法检测编辑区域外的修改。EDIT-Bench有15个问题未被任何40个LLM解决,其中11个问题归因于基准艺术品而非模型限制。此外,29%的EDIT-Bench问题和6%的CanItEdit问题与基准内的至少一个问题共享代码库。总之,这些基准测量的构造范围比部署决策所需更狭窄。因此,本文提出六个实证指导原则,并发布所有审计艺术品,以便社区构建评分能可靠反映真实世界编辑能力的指导性代码编辑基准。

英文摘要:

Instructed code editing, where an LLM modifies existing code based on a natural language instruction, accounts for roughly 19% of real-world coding assistant interactions. Yet very few benchmarks directly evaluate this capability. From a survey of over 150 code-related benchmarks, we find that only two, CanItEdit and EDIT-Bench, target instructed code editing with human-authored instructions and test-based evaluation. We audit both by comparing their programming languages, edit intents, and application domains against distributions observed in the wild (Copilot Arena, AIDev, GitHub Octoverse), and by measuring test counts, statement coverage, and test scope across all 213 problems. Both benchmarks concentrate over 90\% of evaluation on Python while TypeScript, GitHub's most-used language, is absent. Backend and frontend development, which together constitute 46% of real-world editing activity, are largely missing, and documentation, testing, and maintenance edits (31.4% of human PRs) have zero representation. Both benchmarks have modest test counts (CanItEdit median 13, EDIT-Bench median 4), though CanItEdit compensates with near-complete whole-file coverage and fail-before/pass-after validation. 59\% of EDIT-Bench's low-coverage suites would not detect modifications outside the edit region. EDIT-Bench has 15 problems that are not solved by any of 40 LLMs and 11 of these problems trace failures to poor benchmark artifacts rather than model limitations. Further, 29% of EDIT-Bench problems and 6% of CanItEdit problems share a codebase with at least one other problem within the benchmark. In summary, these benchmarks measure a narrower construct than deployment decisions require. We therefore propose six empirically grounded desiderata and release all audit artifacts so the community can build instructed code-editing benchmarks whose scores reliably reflect real-world editing capability.

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

↑