How Often Coding-Agent Commits Add Tests: One Month of a Rust Monorepo
We read a month of commits on a monorepo where coding agents merge their own changes. 71.9% of 1,881 code changes added at least one test, and the share rose with the number of files a change touched. Changes that added tests drew follow-up fixes more often than changes that did not, at every size we could compare.
Coding agents in our development fleet write, check and merge their own pull requests into one integration branch, and each merge lands as one squashed commit. The agents’ instructions say where tests go (inline in the crate being changed, with no separate test binaries and no fully mocked tests). They do not require a test for every change. We wanted to know how often the agents add tests anyway, and whether the changes that add them hold up better afterwards.
We read every non-merge commit on the dev branch authored from 26 October to 26 November 2026. After dropping automated deploy-manifest and [skip ci] commits there were 2,529 changes, and 1,881 of them touched a code file. We counted a test as an added line that opens a test function: a Rust #[test], #[tokio::test], rstest or test_case attribute, an it( or test( call in a TypeScript test file, or a def test_ in a Python test file.
Seven changes in ten added a test
1,352 of the 1,881 code changes (71.9%) added at least one test. Together they added 4,781 test functions and removed 234. A change that added tests usually added few: the median was 2, and the top tenth of test-adding changes accounted for 41.6% of all added tests. The share for each seven-day block, and for the final three days, stayed between 70.2% and 73.2%. Over the same window the number of Rust test attributes in the tree went from 48,305 to 52,262.
Show the data
| % | |
|---|---|
| 1 file | 52.4 |
| 2–3 files | 71 |
| 4–10 files | 90.1 |
| 11–30 files | 96.8 |
| 31+ files | 100 |
Size predicted it more than anything else we checked. Single-file changes added a test 52.4% of the time; changes touching 4 to 10 code files did 90.1% of the time, and all 22 changes touching more than 30 files did. Rust tests live inline, so a one-file Rust change can add its test in the same file. Our inference is that the lower single-file rate reflects choices about what to test more than where tests go.
Commit subjects said less. Most changes (1,412) had no conventional prefix; 72.7% of those added a test. 178 of 255 changes with a “fix” prefix (69.8%) added one. The data does not show whether those tests cover the bug being fixed. Changes with a “feat” prefix were rare (40) and 95% added a test.
Of the 529 code changes without a test, 297 touched a single code file. 367 touched only Rust, 60 only UI TypeScript or Vue, and 62 only scripts or other code such as Python and shell.
Changes with tests drew more follow-up fixes
We reused a follow-up heuristic from an earlier post: a later commit within 24 hours whose subject starts with “fix” or “revert” and that touches one of the same code files. 24.6% of changes that added tests had such a follow-up, against 13.8% of changes that did not. Test-adding changes were larger on average, which explains part of the gap, but a gap remained within each size group we could compare.
Show the data
| Added a test | No test | |
|---|---|---|
| 1–3 files | 17.5 | 13 |
| 4–10 files | 29.7 | 18.4 |
For changes touching more than 10 code files, 46.1% of the 141 that added tests had a follow-up; only 4 such changes had no test, too few to compare.
Our inference, which this data does not test: the changes that skip tests are mostly small single-file edits, largely to Rust code that few other tasks touch, so a later fix on the same file is less likely for reasons unrelated to testing. A test added inline also puts more of the change in files that other tasks edit, which raises the chance of overlap with an unrelated fix. A new test can itself fail on another builder or after a neighboring change and need its own fix. We cannot separate these with commit history alone.
What we would do with this
- Count tests per change from the diff in review. The same line patterns used here are cheap to run on a pull request.
- Look at the one-file changes without tests first. By files touched they were the largest group without tests, and a one-file change is the easiest place to add one.
- Avoid using “added a test” as a quality score. In this data it did not mark changes that needed fewer fixes afterwards.
- Record the commit a fix repairs, and whether its test would have caught the bug, so a later measure can use real links instead of shared files.
Limits of this account: one repository and one month. The test count matches line patterns, so it misses tests written with other macros and counts moved tests as removed and added. The follow-up link is a heuristic based on commit subjects, which agents write with inconsistent prefixes, and on shared files; it does not prove that a later commit repaired an earlier one. Why changes with tests drew more follow-ups is inference.