Coding Agents Write More Tests. But Can We Trust Them?
We evaluated three coding agents on 240 open source projects. Their test suites beat human ones on aggregate coverage, but they scale poorly to larger projects, win mostly by brute force, and are unfaithful translators of tests.

Coding agents are an essential cog in the modern software development pipeline, increasingly trusted with tasks as ambitious as generating codebases and transpiling (translating) them from one language to another. However, as reliance on generated code increases rapidly, so does the value of assurance that this code actually works.
Traditionally, the workhorse of assurance has been unit and integration testing. Developers write comprehensive test suites, iterating against them until the suite passes and they are reasonably confident that their code obeys a set of desired properties. In many modern workflows, however, developers also rely on agents to formulate such tests. In this work, we test the ability of modern agentic setups to write these tests, constructing a benchmark of open source projects across three different programming languages (Python, C++, and Rust) and three size tiers.
Leveraging both traditional software-testing metrics and custom measurements, our results reveal a tension between the aggregate picture and granular analysis: while agents exceed human test suites in traditional coverage metrics, they often scale poorly to larger projects and achieve higher coverage primarily by writing larger numbers of tests. We also find that agents frequently fail to preserve testing capabilities when transpiling tests from C++ to Rust.

The Benchmark
To measure the ability of modern agentic setups to generate tests in diverse contexts, we extract 240 permissively licensed GitHub projects with passing test suites. The dataset consists of 80 projects in each of three languages: Python, C++, and Rust. Projects within each language are also stratified by size: 30 small projects (under 1,000 lines of source code), 30 medium (1k to 5k) and 20 large (5k to 10k).
We run two experiments on the resulting dataset:
- Test generation. We delete the human tests and ask each agent to write a test suite from scratch. The agent can build the project, run its tests and read the output. We evaluate three agents with their native models at high reasoning effort: Claude Code (Claude Opus 5), Codex (GPT-5.6 Sol) and Cursor (Cursor Grok 4.6).
- Test transpilation. We transpile 50 projects from C++ to Rust, and prompt the agents to translate the corresponding test suites. Each agent gets the C++ project, its C++ tests and the Rust source as context. As a control, we also ask Codex to write a test suite using the Rust source alone.
All agentic measurements are means across three generations per project.
Scoring
We leverage a suite of metrics to evaluate how thoroughly the human and agent test suites cover the source code. All test suites are scored against traditional software testing metrics, in combination with several new metrics we define ourselves.
| Metric | What it measures | Methodology |
|---|---|---|
| Line coverage | How much of the code does the suite run? | Share of production lines executed by tests |
| Mutation score | How effectively does the suite detect bugs? | We inject up to 120 small bugs per project (flip a comparison, swap + and −, change a constant). The mutation score is the share of compiling mutants that make some test fail, hang or crash |
| Vacuous-test rate | Do the tests check anything at all? | Replace every public function body with a do-nothing stub. Share of tests that still pass |
| Behavioral coverage | Are the nontrivial public behaviors tested? | An LLM judge lists each project’s nontrivial public functions; share of that list the suite exercises |
| Edge-case coverage | Are edge case inputs tested? | The same LLM judge model drafts edge case input conditions for these public functions; share the test suite reaches. Edge cases include malformed inputs and values exceeding boundaries. |
The first two metrics listed are classic software-testing metrics. They tell us whether tests execute the code and catch simple faults, but not whether they cover core public functions or check how the code handles invalid and edge-case inputs. The judge-based metrics fill this gap, scoring human and agentic test suites against a consistent set of behaviors and edge cases. We also track several other performance and cost metrics, including branch coverage, assertion count, token usage, tool calls and wall-clock time.
Agents beat human suites, but scale worse on larger projects
Averaged over all 240 projects, every agent beats the human suites. Mutation scores are 0.82 for Claude Code, 0.78 for Cursor and 0.72 for Codex, against 0.63 for the human tests. Mutation scores with corresponding confidence intervals are plotted in plot a below.
Averaged across the three agents, the lead over the human suite is 0.15 in mutation score, 0.14 in line coverage, 0.27 in behavioral coverage and 0.35 in edge-case coverage. All gaps are significant when using a paired t-test with p=0.05.

The agentic lead is not uniform. It roughly halves from small to large projects, and on large projects Codex (0.55) drops slightly below the human suites (0.57). The programming language tested is also an important factor: mutation scores for all agents are at least 14% lower in C++ than they are in Python.
Agents win by volume, not by sharper tests
While agent generated test suites achieve higher aggregate results, this advantage does not necessarily extend to individual tests. On a per-test basis, human tests cover more lines than two of the three agents. A human test covers 8.5 unique production lines on average, against 3.7 for Cursor and just 2.2 for Claude Code.

Claude Code reaches the top mutation score largely by writing a plethora of tests. This approach comes at a steep price. Per mutant killed, Claude Code spends 7.3× the input tokens, 6.4× the output tokens and 8.5× the wall-clock time of Codex. Some of the volume is also hollow: the vacuous-test rate (tests that still pass when the function they target is stubbed out) is highest for Claude Code overall, and increases sharply for C++ and Rust projects.
Agents are unfaithful translators of tests
In aggregate, test transpilation from C++ to Rust seems acceptable. The original C++ suites reach a mean mutation score of 0.56; the translated Rust suites reach 0.51 (Claude Code), 0.49 (Codex) and 0.51 (Cursor). Line coverage drops more, from 0.75 to between 0.61 and 0.65, but could potentially be accounted for by code length and measurement differences across languages.

The case-by-case comparison, however, is far worse. The translated suite kills fewer mutants than its C++ source in 55% of projects, and covers fewer edge cases 58% of the time, with a mean relative reduction of 16% for non-zero suites. In one extreme instance every agent loses close to 70% of the source suite’s mutation score.
The control, where the Rust suite was written based on source code alone, almost always scores at least as high as the translated tests. The agents seem to interpolate between translating and writing fresh tests: where free-form generation is strong, the translation can beat its source; where it is weak, the translation is often weak too, sometimes falling below both the free-form suite and the human original.

The three agents’ translated suites cluster tightly on most projects. This points to a property of the task rather than a weakness of one particular model or harness.
Why it happens
To better understand observed testing failures, we examine the agents’ reasoning traces. We analyze 675 Codex test-generation trajectories (three runs on each of 225 projects), tracing weak suites back to their root causes. Three recurring failure modes emerge:
- Scope: the agent never reads relevant source files, or decides to skip a behavior it has already found (15% of trajectories).
- Oracles: the agent keeps an assertion it knows is wrong, or weakens one until it passes (11%).
- Feedback: the agent never measures coverage at all, and only checks that its tests pass (56%).
The full paper walks through these traces, and tests a prompt that warns the agent about these failure modes, yielding measurable gains.
Conclusion and what’s next
Our findings suggest that generated and transpiled suites lacking formal verification should continue to be treated as drafts. Reviewing them and measuring them with metrics beyond pass rate remains essential; all suites measured in our benchmark passed, yet drastically varied in quality.
The paper, “Can Coding Agents Write and Transpile Unit Tests?”, appears at the NeurIPS 2026 workshop “Who Verifies the Agents?”
Read the full paper: Can Coding Agents Write and Transpile Unit Tests?