A test that was never red proves nothing
Agents deliver code and its tests in minutes. Whether the tests check anything only shows when you deliberately break what they are meant to protect.
A coding agent writes a function and twenty tests for it, all green. That looks like care. It only says that code and tests fit each other. Both come from the same source and share the same assumptions.
The question to ask of a test is not whether it passes. The question is whether it can fail.
Break it, watch, put it back
The check is simple and old. Mutation testing automates it; for a single change it is enough to do it by hand:
- Change the spot the test is meant to protect: flip a condition, remove a line.
- Run the narrowest test that should notice.
- If it turns red, it checks something. If it stays green, it checks nothing, and the green from before was worthless.
- Undo the change.
That takes minutes. It finds tests that only check that a function was called, and tests that test their own mock.
Name the tier of the proof
A green unit test shows that a function computes correctly with invented inputs. It does not show that the interface to the payment provider works, and certainly not that a customer can pay. Agents like to sum all of that up in one word: done.
So we require the tier with every claim:
- Unit or static: the logic is right for the cases checked.
- Integration: the parts work together, against real counterparts or faithful replicas.
- Live: a person can do it in the shipped environment.
A green build for a feature nobody can reach is a green build. Nothing more.
Who reviews
An agent judging its own code finds it plausible. So the review is done by a second agent with a context of its own, which checks the code against the requirement and does not rely on the first agent's account. That does not replace a person reading the code. It makes sure the person sees a state from which the obvious errors are already gone.
Report what was observed
The last rule sounds trivial and is the most important. A report contains what ran and what came out, with output. Not what ought to run. If something was not checked, it says what and why.
We keep these rules in the instruction file every agent reads at the start, in the repository next to the code. They apply to people just the same. Agents have only made them more urgent, because they deliver plausible code faster than anyone can read it.