Editor’s introduction
The study evaluates three coding agents across 240 real-world open-source projects in Python, C++, and Rust, measuring their ability to write and transpile unit tests. However, this advantage diminishes as project size increases, and performance is notably weaker in C++. Test translation between languages shows aggregate strength but remains inconsistent and unreliable. A key limitation is that the study uses only open-source repositories, lacking enterprise-scale codebases where test suites are typically more mature and complex.
Introduction
Coding agents have become integral to modern software development, increasingly trusted with tasks as ambitious as generating and transpiling (translating) entire codebases. Verifying this work, however, requires well-constructed tests, which are often missing in realistic code generation settings. Translation is similarly afflicted: even when source language suites are reliable, producing an equally reliable suite in the target language is difficult, as each language introduces distinct translation edge cases and failure modes.
Prior work shows that LLMs can generally write unit tests for small, isolated tasks. By contrast, the quality of generated tests at the scale of full codebases, across different programming languages, and using state-of-the-art coding assistants has received considerably less attention. Moreover, even as agents are increasingly tasked with porting legacy systems to newer languages, their ability to faithfully translate tests remains underexplored.
Transpilation Data
From the C++ corpus, we transpile 50 projects to Rust and release both the source and transpiled artifacts. These projects map cleanly, having platform-agnostic builds and no dependencies that might lack a Rust equivalent. Our final dataset consists of 23 small projects, 20 medium projects, and seven large projects.
Metrics and measurement
We score every test suite against a fixed per-project checklist: the production lines that exist, the mutants (small bugs) we inject, and the project’s public methods. The first two anchor our traditional software testing metrics (line coverage, mutation score, and vacuous test rate) which capture whether tests execute the code and whether they can detect basic faults, but not whether they validate edge cases and core behaviors. For that, we introduce an LLM-as-judge protocol that scores suites against a catalog of important behaviors and edge cases, enabling finer-grained semantic comparison.
LLM-as-judge
Once per project, a judge model (Kimi K3) reads the public functions and writes a list of important behaviors and edge case inputs for these behaviors. Every suite is scored against that same list. A behavior counts as covered if a simple text pattern for it appears in the tests. Edge cases need a second model pass: tests often build such inputs in variables, and thus may be missed by a fixed pattern.
Experiments
We run three containerized and sandboxed experiments, building each project inside a clean container in accordance with its build instructions. Unless otherwise stated, we run all models with high reasoning and unlimited token budgets for testing. Our prompts—along with other shared settings—are not specialized to any agent and can be found in Appendix B. Individual experiments are detailed in the following sections.
Unit testing
To measure the ability of modern coding frameworks to write unit tests, we remove all human tests and instruct the three coding agents to repopulate them. A coding assistant may run the tests and observe output – it is bound only by a lack of network access so that it cannot look up the projects online. For each coding framework, we leverage the most recent frontier LLM: GPT-5.6-sol for Codex, Claude-Opus-5 for Claude Code, and Cursor-Grok-4.6 for Cursor.
Test transpilation
As in the previous section, we leverage the most recent frontier LLM for each coding agent. We also perform unconditional generation of a Rust suite (providing only transpiled Rust, without the source code and source test suite) as a means of comparison.
Interpretive analysis
The Interpretive experiment repeats the unit testing setup in 4.1 on a 225 project subset. We leverage a Codex harness and GPT 5.6, investigating reasoning traces to identify core issues in Codex’s test generation workflow. We establish three fundamental failure modes and track them across projects by analyzing local reasoning traces, tool calls, and additional harness data.
Unit testing
Test quality also decays significantly with project size, and disproportionately so in agents. On large projects, Codex essentially matches the quality of human written suites, in stark contrast to small projects where agents dominate. Full results appear in Appendix A.
Test transpilation
Notably, the three agents’ translated suites cluster tightly on a significant majority of projects—these failure modes appear to be properties of the task, not of any particular assistant. Taken together, the results raise concerns about the reliability of modern coding agents on transpilation tasks.
Interpretive analysis
We examined 675 test-generation trajectories produced by Codex GPT-5.6 Sol across 225 projects, with three runs per project. The traces reveal failures in repository scope and target selection and in oracle formation, alongside gaps in coverage-feedback utilization. All percentages below use the 675 trajectories as their denominator.
The weakest runs share the following failure modes: skipping relevant code, forming trivial or implementation-anchored oracles, and failing to implement feedback effectively. These modes appeared even when the traces showed apparent prior knowledge: the agent identified the upstream library or recalled its structure, but still produced a weak suite (Listings C.12–C.17).
Repository scope and target selection
In 103 trajectories (15.3%), we found evidence that the agent either did not read relevant source code or knowingly omitted a supported testing objective. The traces show relevant implementation files left unread despite their inclusion in the build and their connection to the tested public behavior (Listings C.1–C.3). They also contain explicit decisions to exclude identified behavior without retaining an equivalent test.
Oracle formation
Seventy-five trajectories (11.1%) exhibited evidence of a retained oracle-formation failure. These included preserving behavior the agent recognized as erroneous, accepting incidental output from malformed input, and weakening assertions until they no longer established the intended property (Listings C.4–C.9). The final suite could therefore pass while retaining assertions that preserved an implementation error or no longer checked the intended validation behavior.
Related Works
Datasets and benchmarks. Existing test generation benchmarks are predominantly in Python or Java. TestEval (210 Python LeetCode problems) and TestBench (108 functions from nine real-world Java projects) provide curated unit-level tasks, but are limited in scale and complexity. TestGenEval and SWT-Bench are substantially larger and more realistic, but are derived from SWE-Bench repository histories. Their target behavior is therefore defined relative to an issue-resolving patch and may span multiple components, making these tasks closer to repository-level regression or issue reproduction than isolated unit testing.
Recent studies also suggest that data contamination and memorized surface patterns can inflate apparent test-generation performance. Cited researchers introduce ULT (UnLeakedTestBench), a benchmark of real world Python functions whose corresponding tests do not appear in The Stack v2, alongside PLT (PreLeakedTestBench), which contains functions with potentially leaked tests. Across 12 models, average Pass@1 falls from 48.42% on PLT to 12.69% on ULT. reach a related conclusion: even semantics-preserving program transformations substantially reduce generated-test pass rates.
Our dataset instead targets isolated, human written unit tests from 240 real world projects spanning Python, C++, and Rust, with a range of project sizes and complexities. We additionally apply transformations such as identifier renaming to reduce the likelihood that models can rely on memorized public source code or tests.
LLMs for test generation. LLMs have been used throughout the unit test generation pipeline. Prior work generates tests from function context with execution feedback, augments existing suites at industrial scale, reproduces bug reports as tests, and improves assertions using retrieved demonstrations. Hybrid methods combine LLMs with search-based testing or mutation testing. Others guide generation with program analysis, including method slices, symbolic path constraints, coverage reports, and uncovered control-flow paths. ASTER extends this style of pipeline across languages.
Empirical studies in JavaScript, Java, Python, and oracle generation collectively show that LLMs can produce plausible tests for simple methods but degrade substantially on more complex, real world code. Controlled studies identify several recurring failure modes. Generated tests can anchor on an incorrect implementation, inherit mistakes from self-written code, or be emptied to make them pass. Test quality also degrades with program complexity and can remain superficial despite high coverage.
Most of these studies evaluate single model calls or fixed pipelines, often in a single language. Coding agents have received far less attention. SWT-Bench shows that repair agents outperform dedicated test generators at reproducing GitHub issues, but only in Python. The only direct comparison of production assistants we are aware of evaluates 99 LeetCode problems. Whether agents’ harnesses, tools, and instructions change these outcomes on real, multilingual repositories remains open.
Conclusion
In this paper, we evaluated three coding agents on unit test generation for 240 real-world projects across Python, C++, and Rust. On average, agents beat human suites on traditional metrics, but the gains are uneven: performance degrades with project size and lags on C++. Much of the agents’ advantage emanates from writing more tests as opposed to making them stronger individually.
Our reasoning-trace analysis suggests three causes for these observations: agents read repositories incompletely, anchor oracles to the implementation, and rarely use coverage feedback. We thus conclude that agent-written, and especially translated, test suites remain unreliable in many scenarios and should be treated as drafts requiring careful review and measurement.
Limitations and future work
There are several present limitations to our work. First, our corpus consists of open-source repositories and does not include enterprise-scale codebases. Enterprise test suites are often more mature than the baselines we measure here, which could narrow agents’ apparent advantage while further stress-testing the reliability of agent-written suites. Building representative enterprise benchmarks, with appropriate privacy and licensing constraints, is an important direction for future work.
Furthermore, we test agentic harnesses with their native models, and do not isolate the individual impact of either the harness or models themselves. This is an important follow-up direction, and could aid practitioners working to implement harness and model level improvements.
Our interpretive analysis is also limited. Reasoning traces come from a single model (GPT) in a single harness (Codex); no comparable traces exist for the other frontier agents in our main experiments. Whether the same failure modes hold across agents, models, harnesses, and project types remains open.
Unread implementation: minisketch (repetition C)
The recorded source reads cover the public interface, dispatch, shared sketch algorithms, field configuration, and utility code. The complete command inventory contains no read of the eight generic field-backend implementation bodies. Their relevance is established by the recorded build configuration and the final tests, which exercise all eight storage widths, rather than inferred from a low metric. This supports a finding of omitted source inspection; it does not establish that these files were wholly untested.
The source also links minisketch_field_sources into the minisketch library. Conditional CLMUL backends were disabled in this build; the finding concerns the active generic backends and does not depend on CLMUL. We checked the complete inventory of recorded reads to establish the omission; Listing C.1 shows one selected command.
Retained area-formula error: geometer (repetition B)
The final run reports 104 passing tests (item_51), but the area assertion does not establish the intended formula. The task required a passing suite and prohibited edits to production source code. Those constraints provide context for the choice without changing what the retained assertion requires.
Weakened missing-input validation: pyflwdir (repetition C)
The initial test expects a ValueError for missing inputs, and the captured implementation contains the corresponding guard. Execution instead fails later during arithmetic on arrays containing None. The agent changes the final test to require that incidental TypeError.
In this trajectory, accepting the output from malformed input also weakens the intended validation oracle. The finding rests on the change in the assertion and does not require an unrecorded admission of a bug. The source guard supports the intended exception; the docstring describes the required inputs but does not independently specify an exception class. The final suite reports 59 passing tests (item_47).
Execution without coverage measurement: geometer (repetition C)
This run is a different repetition from the oracle example above. The record contains four completed suite executions using the same command. The number of failures falls until the suite passes. Review of the complete trajectory identifies no coverage-measurement attempt or inherited instrumentation.
The initial file inventory lists coverage executables, but listing an executable is not a measurement attempt. To assess whether coverage was measured, we reviewed all recorded commands, configuration, and instrumentation; the selected pytest commands alone would not establish its absence. This example documents the feedback process without establishing weak final coverage or a causal effect on test quality.
Stated familiarity
In Listings C.12–C.17, the agent describes familiarity with the libraries while planning tests. These statements document claimed familiarity; they do not independently establish prior knowledge. We do not assess a relationship between these statements and test quality here.
In Cleo C, betfairlightweight B, pycasbin B, and PyJWT B and C, the statements precede the first recorded read of implementation or test contents. The preceding commands inspect file inventories, repository metadata, or project configuration. The betfairlightweight, pycasbin, and PyJWT B excerpts specifically claim knowledge of upstream tests, whereas Cleo C and PyJWT C describe familiarity with the project.


