Evaluating Code Slop in Long-Horizon Coding Agents
Shubham Gandhi, Shyam Agarwal, Nachiket Kotalwar, Atharva Naik
Abstract
Coding-agent evaluations typically measure whether an agent solves a task and ignore the code it leaves for humans to review and maintain. We call unnecessary code volume, control-flow complexity, and maintainability debt beyond task requirements code slop, and operationalize it as trajectory-induced changes in three static-analysis metrics. Across a 2,268-run evaluation covering 42 SWE-EVO tasks, three coding models, three seeds, and six cleanup settings, we measure functional outcomes alongside code slop. Aggregate functional utility stays within a narrow band (70-76%), yet code-volume deltas range from -14.3 to -79.3 across policies, with substantial differences in complexity and debt. A single final cleanup pass barely reduces slop. Periodic in-trajectory cleanup reduces slop but is costly and requires a fixed cadence, whereas a monitor-triggered policy gives the largest reduction on all three slop metrics and costs about 25% less than the strongest periodic schedule. The reduction holds across most runs and does not depend on a few outliers. It is largest for weaker models; the strongest model already writes compact code and changes little. We therefore argue that coding agents should be evaluated by the maintainability of their work as well as by whether they complete tasks.
Create a lesson
Metadata
- Categories
- cs.SE, cs.AI
Related papers
ReleaseSynth: Scaling Data from Software Evolution for Long-Horizon Coding Agents
Shared title terminologycs.SEMan Ho Lam, Chaozheng Wang, Zongjie Li et al.
SpecEngineeringBench: Evaluating Coding Agents as Autonomous Specification Engineers
Shared title terminologycs.SEXingjian Wang, Shijian Wang, Minghao Liu et al.
RepoClean: Evaluating Coding Agents on Repository-Level Obsolete Code Cleanup
Shared title terminologycs.SEHongyixuan Yuan, Qixing Zhou, Pengcheng Huang et al.
Proceeding After Seeing: When Coding Agents Act on Users' False Claims About the Code
Shared title terminologycs.SEYi Sun
FineCR: A Fine-Grained Benchmark for Evaluating LLMs on Raising Code Review and its Resolution
Shared title terminologycs.SETaufiqul Islam Khan, Shaowei Wang, Haoxiang Zhang et al.
Context Clash: Prevalence and Limits of Lightweight Detectors for Cross-Tool Coding-Agent Instruction Conflicts
Shared title terminologycs.SEAditi Patodiya