Skip to main content
[llms]

Can Coding Agents Write and Transpile Unit Tests

Benchmarks three popular coding agents on writing unit tests and translating them between languages, finding that agent-written suites beat human-written ones on coverage but degrade on larger projects, and that agentic test translation remains unreliable.

Three charts comparing test suites written by Claude Code, Cursor, Codex and humans. (a) Mutation score, the share of injected bugs each suite catches: Claude 0.82, Cursor 0.78, Codex 0.72, Human 0.63. (b) Share of vacuous tests that still pass with the code stubbed out, by language, from 0.04 to 0.15 across Python, C++ and Rust. (c) Spend per mutant killed relative to Codex: Claude costs 7.3x the input tokens, 6.4x the output tokens and 8.5x the wall-clock time; Cursor costs 2.3x, 3.6x and 4.7x.

Abstract

Coding assistants built on Large Language Models (LLMs) have become a staple of modern software development, increasingly trusted to execute workflows and modernize code end-to-end. Much of this trust rests on passing tests, which are often written by the coding agents themselves. In this work, we examine the ability of these agents to both write reliable tests and translate them between programming languages. We benchmark three popular coding agents, each evaluated with a native frontier model and high reasoning effort. Verifying across a broad suite of metrics, we find that coding agents far exceed human written suites on traditional measures of coverage. This advantage, however, is uneven: agent test quality degrades sharply with project size, and much of the advantage lies in a greater number of written tests. We also show that agentic test translation — while seemingly strong in aggregate — remains inconsistent and unreliable.

Published at arxiv.org