91% of agent tests pass, only 26% expose bugs: SpecEngineeringBench grades coding agents

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 Zhang

cs.SE

2026-11-25

SpecEngineeringBench gives agents only a PRD and an uninspected repo: 91.47% of their tests pass, just 26.36% expose real defects, and multi-file bug localization drops to 2–8%.

What problem this solves

Existing coding-agent benchmarks hand over the hard part. Issue-driven suites like SWE-bench supply a bug report; target-driven suites like TestEval and TestGenEval name the function or file to test. Real prerelease verification works differently: a specification engineer gets a product requirements document and an uninspected repository, with no bug report at all, and must decide which behaviors to test, where to investigate, and how to back each finding with reproducible evidence. SpecEngineeringBench removes both the issue description and the location hints, and tests exactly that skipped capability.

Method

Each instance is a four-tuple: a defective repository snapshot, a PRD, a configured Docker environment, and a set of reference defects (at least four). The 100 instances come from 78 open-source Python repositories across 16 application categories, embedding 531 real defects mined from actual upstream fixes; each instance holds 4 to 15 coexisting defects, median 5. Snapshots carry a median of roughly 80k source lines, and the reference defects per instance span a median of 5 files and 11.5 edit hunks, so reports must flag multiple locations.

Evaluation splits into two independent tasks, separating test synthesis from runtime diagnosis:

Seven frontier agents were evaluated: Claude-Opus-5, Claude-Sonnet-5, GPT-6-Astra, GPT-5.6-Sol, Kimi-K3, GLM-5.3, and DeepSeek-V4.1-Flash. The open-source models all ran on Claude Code, the OpenAI pair on Codex, at high reasoning effort, inside isolated containers with outbound networking disabled, verified out of band by the Harbor (v0.23.0) framework.

Results

MetricSeven-agent result
Head Pass Rate (mean)91.47%
Fail-to-Pass Rate (mean)26.36%
Change-focused Coverage (mean)80.48%
Localization recall: file / function / hunk78.11% / 51.29% / 51.88%
Distinct bugs fully localized (range)33.14%–49.04%
Multi-file bugs fully localized (range)2.00%–7.84%
ModelF2PMean tests submittedFile recallBugs fully localized
GPT-6-Astra27.56%16385.85%49.04%
Claude-Opus-527.07%19780.80%45.37%
GPT-5.6-Sol34.09%3379.80%43.30%
Kimi-K325.00%12180.64%42.72%
GLM-5.321.33%14279.78%42.34%

Three findings stand out.

Test validity decouples from defect exposure. Across 49,317 registered tests from 500 evaluations of five systems, 67.44% pass on both the defective and the repaired snapshot. Coverage does not rescue it: even within the 80–100% Change-focused Coverage band, mean F2P per model sits between 24.24% and 37.82%. GPT-5.6-Sol submits the smallest suites (33 tests on average) yet posts the highest F2P; Claude-Opus-5 submits 197 and lands at 27.07%. Suite size and green runs say little about bug catching.

Localization falls off a cliff at function granularity: 78.11% file recall drops to 51.29% at the function level. The best model, GPT-6-Astra, reaches 85.85% file recall yet fully localizes only 49.04% of distinct bugs; after finding one bug, it leaves the remaining coexisting bugs unlocalized in 83% of instances. Instances where every bug is localized range from 4% to 11% across models. Multi-file defects collapse entirely, with full localization between 2.00% and 7.84%. Claude-Sonnet-5 is weakest overall at 33.14%.

Failure mechanisms are concentrated. In Task 1, assertion mismatches account for 31.6% of reviewed failures and misconfigured mocks 37.5%; agents encode current implementation outputs as expected values, treating the implementation as the source of truth instead of the PRD. In Task 2, premature search termination accounts for 36.0%: agents anchor on the first visible exception frame and stop, skipping upstream callers and cross-file data flow.

One paired comparison: the same GPT-5.6-Sol authoring its own tests, versus only running the repository's existing suite, gains 4.99, 2.77, and 2.69 percentage points of file, function, and hunk recall, at a precision cost of 2.74, 1.61, and 3.25 points. The median instance-level change is zero; gains concentrate in roughly a third of instances.

Why it matters

This measures the step from writing code to accepting a release. The closing argument holds up: as requirements get expanded into specifications automatically, verifying implementations against those specifications becomes the bottleneck of autonomous development. For benchmark builders, it fills four gaps at once: no issue report, no location hints, multiple coexisting bugs, and mandatory executable evidence. For agent developers, the 67.44% number is the sharpest warning: test generation that asserts implementation output is self-confirmation, however green the run. Pass rate and coverage alone will systematically overstate test quality; F2P and localization recall need direct measurement.

Limitations

The authors' own boundaries: Python only, with more languages deferred to future work, and 14 replacement instances still awaiting defect-type annotation out of 100. Reading closely raises more. The self-authored-tests-help claim rests on a single model and harness, with a median change of zero and declining precision. All repositories and fix PRs are public, and the paper never discusses training-data contamination; the models may well have seen these fixes. The PRD construction process and its quality control are not described, yet PRD specificity directly sets task difficulty. And Claude-Sonnet-5 posts the lowest full-localization rate (33.14%), well behind Claude-Opus-5 at 45.37%, with no analysis offered.

Terms

Source

Related papers

All paper explainers