Nobody Reads the Blueprint
Agents wrote the 291,000 lines of my app's code and I don't read them. What I check instead: state-model tests, fuzzing, metamorphic tests and a coverage tree.
An illustration, not real numbers. The real dashboard follows further down.
Matrix, my app for asking questions about your own documents, now has about 291,000 lines of code, most of it Rust. That counts all of the project’s Rust, TypeScript and Python, so it is more than the number in my last post. Agents wrote all of it, and I haven’t read it. At 400 lines an hour, within the 300 to 500 lines an hour that SmartBear’s study of code review at Cisco gives for effective review, one pass would take about 730 hours. That is four months of full-time reading, and by the end the agents would have written the next 100,000 lines.
In my last post (in German) I wrote that I don’t dare to drop code review entirely. Somebody does read the code: agents, the one that wrote it and others that check its work. I don’t. What I look at instead is where the code is tested, and where it isn’t. This post is about how that works.
One design rule makes it possible: every test has to be something an agent can write, run, read and fix on its own. No test may need me to click through the app or judge a result by eye. A test that needs a human doesn’t grow with the code.

The blueprint and the crash test
Nobody checks whether a car survives a crash by reading its blueprint. You crash it, many times, from every angle, and you measure what happens.
I think code written by agents ends up in the same place. The code is the blueprint. There is too much of it to read, and reading it would not tell me much anyway. The questions that matter are different. How do I crash it? And how do I know I have crashed it everywhere?
What Anthropic measured
In January, Anthropic’s Frontier Red Team published “Finding bugs across the Python ecosystem with Claude and property-based testing” by Muhammad Maaz, Liam DeVoe, Zac Hatfield-Dodds and Nicholas Carlini, with a paper behind it. They built an agent as a Claude Code command that writes property-based tests for popular Python libraries such as NumPy, SciPy and Pandas. A property-based test checks a rule that must always hold and lets the computer generate thousands of inputs. The agent produced 984 bug reports. In a sample of 50, 56 % were real bugs. Before anything was filed, the authors “sent these potential bugs to be reviewed by three expert humans”, for about an hour per bug, and then checked each one again themselves.
That is the setup with code written by humans and tests written by a machine. The expensive part is the human who checks every finding.
Mine is the other way round. The code is generated, and so are the tests. A finding goes back to the agent, which writes a regression test that reproduces it and then the fix. I don’t check each finding. I check which user features are covered by which kind of test, and where nothing looks.
Where property tests stop
The last round of testing found 53 bugs in Matrix, 41 of them through property tests. I described them in the last post. But they need a general rule, and many things in an app have none. A user creates a collection, starts a question, switches to another chat and deletes the collection while the answer is still running. There is no neat rule for that. There are only sequences of actions, and some of them break things. So I added three more kinds of tests.
State-model tests. The test keeps a simple model of the app: which collections exist, which chats, which tables, which devices are paired. A runner drives real instances of the app, up to four at a time on my Mac, through sequences of user actions, some random and some aimed at gaps, and compares the app with the model after every step. One two-hour run of targeted sequences came to 4,659 sequences with 58,458 steps through 2,495 different app states. Some of what it found:
- After switching chats, a question landed in the wrong chat
- A question to a deleted collection went to the model without any documents, and the user didn’t notice
- Pairing a device again removed the pairing on both devices
Fuzzing the file readers. Matrix reads PDFs, Office files, mails, archives, images, audio and more. The readers are written in Rust. A fuzzer, libFuzzer in this case, feeds each of them broken and half-broken files, millions of them, and watches for crashes, hangs and runaway memory. There are 23 fuzz targets. So far they have run about 1.5 billion times in about 40 hours, mostly on my Windows PC. 34 findings from about 20 distinct causes are fixed, for example:
- A 2 MB spreadsheet asked for more than 2 GB of memory
- One broken entry made a whole ZIP archive fail
- A spreadsheet with a misnamed end tag made the reader run forever
Metamorphic tests for search. For a search, there often is no right answer to compare with. But some things must not change the result: adding the same documents in a different order, or searching one collection on its own. A metamorphic test runs both versions and compares them. It found that the keyword search computed its scores across all collections instead of per collection. That shifted 15 to 16 of 30 result lists. If you know search engines or language models, a shifted ranking may look like noise. Here it isn’t: this search is exact, and the same documents with the same question give the same list every time. So every shifted list is a real difference. It also found that a file added twice showed up twice in the results.
Cheap first, expensive at the plateau
Tests cost something. Some cost a few CPU seconds, some cost real model calls, and the most expensive ones cost agent time. So every kind of test runs in stages, and the next stage only starts when the cheaper one stops finding anything new.
The fuzzer starts blind, with random bytes. Once a format stops gaining coverage, it counts as exhausted. Then it gets format keywords and real documents as starting points, and the curve jumps again. An agent only steps in when that stage flattens too, and then it builds a new target for code nothing reaches.

The state-model tests work the same way. Fixed sequences come first. Then eight minutes of random sequences plus a round that goes after every pair of app state and action that is still open. Then all cheap sequences of two and three steps. The expensive part, chains of 10 to 20 steps, only runs along the paths where bugs turned up before. Real model calls run separately.
One rule turned out to matter a lot. If one type of failure makes up more than 20 % of the sequences in the last ten minutes, the run stops. That cause gets fixed first, and then the run continues without repeating what it already did. Otherwise a single bug floods the results, and the rare ones get lost in the noise.
Compute is cheap, tokens are expensive
Machine time costs almost nothing. Agent time costs tokens. So the machines run all the time, and agents only come in where judgement is needed.
- After every agent turn, the stop hook, a script Claude Code runs before an agent may finish, only runs the tests the change can reach. That takes 42 to 143 seconds instead of a full run.
- Fixes are committed locally and pushed once per round, so there is one CI run per round, not one per fix.
- Mechanical work goes to a cheaper model with low effort. Building, weighing options and the final check go to the large one.
- Everything that repeats is a script with fixed rules and its own tests: the feed for the dashboard and the control of the fuzzing and of the state-model runs. Agents build these scripts, but they don’t sit in the loop. They read short results instead of logs, and background scripts only wake them when something happens: a build turns red, a format is done, a run ends. If the PC doesn’t report anything, there is no need to look.
- What isn’t in the dashboard doesn’t exist. At first the state-model tests only showed up there after a manual refresh. That was a bug too, and it is fixed.
The scripts got things wrong as well, and the same way of working found it:
- “Exhausted” first meant three hours with less than 1 % new coverage. Across 23 fuzz targets that would have been at least 69 hours per stage. Now a target is done when the second half of its fuzzing time brought less than 1 %, after 30 minutes at the earliest. That fits the roughly logarithmic curves.
- After every restart, the order of the formats began with PDF again, so the formats at the end never got their turn.
- The rule “stop after 30 minutes without a new finding” was at first also applied to coverage and ended a run at 93 %. I noticed it, and it was fixed.
The coverage tree
All of this only helps if I can see it. So I built a dashboard. It lists the 75 user features of Matrix and shows for each one which kinds of tests cover it and how well. I can drill down from a feature to a user action, to an app state and finally to a sequence that replays the problem.

This is the real thing, as of 2 December. It is in German because it is my own tool. Red doesn’t mean broken. It means not looked at enough yet. The state column counts, per feature, in how many of the possible app states it was tried. That space is huge, so most of it is still red. An exclamation mark means the matching type of test is missing.

And this is one branch opened, from the feature down to one sequence of eight user actions the test actually ran, with the command to replay it.
Here is why that view matters. I had agreed with the agent that cheap actions would be tested exhaustively. The agent reported the state-model tests as exhaustive and done. The coverage tree showed 48 %, 776 of 1,618 reachable pairs. The run had picked its sequences at random. It avoided repeats, but nothing made sure that every pair came up. I only noticed because the colour in the tree was wrong.
That changed how the state-model tests work. Instead of hoping that chance covers everything, they now go deeper in a fixed structure: first a round that goes after every open pair of app state and action, then every cheap sequence of two and three steps, and only then the deep stage around the places where real bugs were, which I come back to below. After the first of those rounds, and with a much larger model of the app, the same view showed 17,023 of 24,147 pairs, 70 %.

Who tests the tests?
The agents also wrote the 95,000 lines of tests, and I don’t read those either. So who checks them? The textbook answer is mutation testing: a tool plants small bugs in the code, for example turns a plus into a minus, and checks whether any test notices. In Matrix that has been weaker than I expected. Over 13,000 mutations led to 4 real bugs, as I described in the last post. They still run before a release and show whether new tests notice anything at all. How to make them stronger is a story of its own.
What actually caught broken tests was measuring what they reach. One case is the 48 % above. The other one came from a release run: three property tests threw away most of their generated inputs and hardly tested anything. Both looked fine from the inside.
Anthropic’s agent reflects on its own results to cut false alarms. That helps against a test that claims a bug that isn’t there. It doesn’t help against an agent that says “done” when it isn’t. For that, the check has to sit outside the agent. In my setup, that check is the coverage tree. Scripts count what the runs actually reached, straight from the files the runs leave behind, with no language model in between. Whatever the agent reports doesn’t enter it. The stop hooks and the gates work the same way: they are scripts, and an agent can’t talk its way past them.
There is a catch. Agents wrote those scripts too. They have their own tests, and a change to them shows up like any other change. But where the root of trust should finally sit, out of reach of the agents, is a question I haven’t fully answered yet.
What I actually decide
If I don’t read the code, what do I do? Mostly I check the strategy. Two examples from a single night.
The deep stage of the state-model tests starts from 59 real causes of bugs and tries every sequence of up to three more user actions from there. Before each sequence, the app first has to get back to its starting point, eight steps on average. That costs about three quarters of the run time. The agent suggested three ways to save it:
- Copy the app’s state as a folder: database, files, browser storage. Cheap, but wrong for the interesting cases. What only lives in the running program, a table run in progress or a question waiting for its answer, gets lost, and that is exactly where many bugs were. Starting the app on the copy is itself an action in the model, so the copy is not the same state and would produce false or hidden findings.
- Freeze the app including its memory, with Firecracker micro-VMs or CRIU. That keeps running work too and restores in under a second, three to four times faster. It would cost several hours of agent work, a move of the tests to Linux on the PC and, above all, proof that the restored app behaves exactly like the one that got there the long way.
- Run more instances in parallel: about 12 on the PC instead of 4 on the Mac. Roughly three times faster, with no new technology.
The agent proposed freezing, the most elegant option. I decided on none of them for now, because with a sensible order the stage takes about an hour. If it is to run regularly, parallel instances come first, and freezing only if a factor of three is not enough.
The second example was that order. The first version started from 88 points, including false alarms from the test setup itself, ran 46,552 sequences in random order and stopped after 30 minutes without a finding. I pushed back on that. Now it starts from the 59 real causes and goes for variety: first every starting point with every first action, about 2,400 sequences in 35 minutes, then every pair of actions once, about 1,600 sequences in 25 minutes, and only then the rest.
Neither decision needed a single line of code. Both needed someone to weigh cost, the risk of false findings and the real gain, not elegance.
The loop
Put together, it looks like this. Agents write code and tests under rules: every user feature gets a regression test, and every bug first gets the test that reproduces it. Since this week, a check also enforces the right kind of test for the kind of code. A file reader without a fuzz target fails it, so does ranking code without metamorphic tests, and so does a user command without an action in the state model. After every turn, stop hooks block the agent from finishing while anything is red. They only run the tests the change can reach. A commit happens only when everything is green. The CI wakes up my Windows PC, which runs the tests and the fuzzing at night and shuts itself down afterwards. Everything ends up in the coverage tree, and that is where I come in: I pick the next gap.

What is still open
- I don’t have a before-and-after number yet, for example bugs found by users per week before and after the state-model tests.
- The coverage tree only knows what the model knows. A feature the model doesn’t contain shows up as “not in the model”, and a person still has to notice that.
- The check for the right kind of test makes sure that kind exists for each part of the code. It doesn’t make sure every single change got a new test.
- Mutation tests are the weakest part of the setup so far.
And you?
If you build with agents: what do you look at, now that you can’t read everything anymore? Do you review every change, do you trust a second model, or do you have something like a coverage tree?
testingfuzzingstate-model-testingmetamorphic-testingcoverageclaude-codeagentsrust