NeurIPS 2026Coming to NeurIPS?Explore papers, orals & directions

SpecEngineeringBench: Evaluating Coding Agents as Autonomous Specification Engineers

Xingjian Wang, Shijian Wang, Minghao Liu, Ji Zou, Zetao Yang, Xinping Lei, Yiming Liang, Shen Yan, Enduo Zhao, Xiaoyang Shen, Weihao Xuan, Jiaheng Liu, Ge ZhangarXiv 2026

TL;DR

We usually evaluate AI coding agents by handing them a neat bug report or pointing directly to the broken file—which is a bit like playing detective when someone has already circled the culprit in red ink. SpecEngineeringBench removes the training wheels, dropping agents into unfamiliar codebases with nothing but a Product Requirements Document (PRD) to see if they can proactively hunt down multiple hidden bugs. As it turns out, while frontier AI models are great at writing tests that run cleanly and cover lots of code, they often accidentally treat the buggy code itself as the "truth" rather than enforcing the spec.

What Problem Does This Paper Address?

Imagine checking a complex software release before it goes live. Nobody hands you stack traces or tells you which function is broken; you have to read the product specs, figure out how requirements map to a sprawling codebase, write tests for edge cases, and track down multiple coexisting bugs.

Existing AI coding benchmarks don't test this exploratory reality. Most fall into two camps: issue-guided benchmarks (like SWE-bench) that give the agent a user's bug description, or target-guided benchmarks that tell the agent exactly which file or function to test. Furthermore, almost all of them assume there is only one isolated bug to find. The authors ask a much harder, more realistic question: if you give an AI agent only functional specifications and an uninspected repository, can it figure out what to test, find the bugs, and prove it?

Comparison of traditional issue-guided and target-guided benchmarks versus SpecEngineeringBench's open-ended exploration.

Methods

To separate an agent's ability to write good tests from its ability to play detective at runtime, the authors split the evaluation into two independent tasks inside isolated Docker environments (with internet access disabled):

  • Task 1: Test Generation. The agent reads the PRD and repository, then outputs a standalone test suite. Out-of-band, an automated evaluator runs these tests against both the defective codebase and a hidden, repaired ground-truth snapshot. It scores Head Pass Rate (HP) (do tests pass on the fixed code?), Fail-to-Pass Rate (F2P) (do tests fail on the buggy code and pass on the fixed code—proving they actually caught a bug?), and code coverage.
  • Task 2: Defect Discovery and Reporting. The agent actively explores the repo by writing and running temporary test probes, ultimately submitting a diagnostic report with execution logs and exact bug locations. The evaluator grades localization precision and recall at three granularities: file, function, and edit-hunk (matching exact changed lines within a 3-line tolerance).

Datasets

The paper introduces SpecEngineeringBench, a new evaluation benchmark (no training datasets are used). Unlike single-bug or hint-driven suites, it features:

  • 100 instances drawn from 78 open-source Python repositories across 16 domains (databases, security, data analysis, etc.), with a median codebase size of ~80,400 lines of code.
  • 531 real-world defects embedded simultaneously—ranging from 4 to 15 coexisting bugs per instance (median of 5).
  • Paired PRDs detailing expected capabilities, boundary conditions, and error behaviors, with zero location hints or issue reports.
Dataset breakdown across 16 application domains, defects per instance, and reference location scopes.

Key Insights and Ideas

  • High code coverage is an illusion of safety: Agents routinely write tests that execute the exact lines of buggy code and pass cleanly, yet completely miss the bug. Why? Trajectory analysis reveals that agents look at what the existing code outputs and write assertions to match it—treating the buggy implementation rather than the PRD as the source of truth.
  • Agents stop digging at the crime scene's front door: Agents are surprisingly good at finding the right file, but terrible at pinpointing the root-cause function, especially for bugs spanning multiple files. When a test throws an error, agents anchor on the first visible frame in the traceback and stop investigating, leaving upstream callers untouched.
  • Early satisfaction: In multi-bug environments, agents often call it a day too soon. Even the top-performing model left coexisting bugs unlocalized in 83% of instances after successfully finding at least one bug.
  • Writing new tests still beats coasting: Despite these flaws, letting agents actively author new tests from the PRD discovers noticeably more bugs than just letting them run the repository's existing test suite, though precision dips slightly because agents over-report candidate locations.

Key Results

Evaluating seven frontier models (including Claude-Opus-5, Claude-Sonnet-5, GPT-6-Astra, GPT-5.6-Sol, DeepSeek-V4.1-Flash, Kimi-K3, and GLM-5.3) yielded stark numbers:

  • Validity vs. Detection Gap: Across all agents, tests achieved a 91.47% Head Pass Rate and 80.48% coverage of changed lines, yet the Fail-to-Pass bug detection rate was only 26.36%. Over 67% of tests passed on both buggy and fixed code without exposing anything.
  • Granularity Drop-off: Mean localization recall dropped from 78.11% at the file level down to 51.29% at the function level (and 51.88% at the hunk level).
  • Single vs. Multi-file Bugs: Overall, models fully localized between 33.14% and 49.04% of distinct bugs. While single-file bug localization reached 40.63%–59.05%, multi-file bug localization cratered to just 2.00%–7.84%.
  • Active Testing Gains: On GPT-5.6-Sol, authoring tests from the PRD improved file, function, and hunk recall by +4.99, +2.77, and +2.69 percentage points over relying on existing repo tests.

Limitations and Future Work

Currently, SpecEngineeringBench is exclusively focused on Python repositories, and 14 replacement instances in the dataset were still awaiting fine-grained defect-type annotations at the time of analysis. Furthermore, in Task 2, the benchmark checks for executable evidence in reports without independently replaying those submitted test logs out-of-band. Looking ahead, the authors plan to expand the benchmark to additional programming languages and explore evaluating agent-generated specifications—testing what happens when AI writes both the spec and the verification suite.

Summary updated

BibTeX
@misc{wang2026specengineeringbench,
  author = {Xingjian Wang and Shijian Wang and Minghao Liu and Ji Zou and Zetao Yang and Xinping Lei and Yiming Liang and Shen Yan and Enduo Zhao and Xiaoyang Shen and Weihao Xuan and Jiaheng Liu and Ge Zhang},
  title = {{SpecEngineeringBench: Evaluating Coding Agents as Autonomous Specification Engineers}},
  year = {2026},
  eprint = {2611.32973},
  archivePrefix = {arXiv},
  url = {https://arxiv.org/abs/2611.32973},
}
Figure