I Deleted One Test Case to See if the Check Would Notice

A green run tells you almost nothing. A deliberate bad edit that turns the check red tells you what it guards, and lets a whole team change code without guessing.

5 min read

I removed one expected case from the evaluation catalog, ran the quality check, and watched it turn red.

That was on purpose. I did the same thing with other probes: I changed the catalog, then hand-edited an expected floor. The repaired check rejected every one of them instead of producing one more green result.

Green is only an output. By itself, it doesn’t say what was exercised or what kind of mistake would make the check fail. So I want to see the whole movement: a known bad change, an expected failure, and a clean return to green when the change is gone. Not just the comfortable ending.

Three steps: break the check on purpose by removing one expected case, watch it fail for the named reason, then undo the edit and see a clean green run
The red run in the middle is the one that earns the green run on the right.

This is mutation thinking in its smallest form. Change the protected decision, remove an expected case, alter a value the check is meant to guard, then see whether the control catches it. If it stays green, you’ve learned where the test needs work, and you’ve learned it before anyone else depended on it.

The failure message counts as much as the color. A gate that goes red with a vague error sends the next person digging through the whole system. A useful failure names the expectation that changed and shows the difference. So I read the message during the bad-edit run too, and I confirm the same job comes back to green afterward with no manual cleanup. Red proves the guard reacts. The clean rerun proves the test didn’t leave the workspace changed.

The team ended up with several kinds of controls because they answer different questions. Fast deterministic checks cover logic, response shapes, and fixed expectations without calling a live model. Offline evaluations replay recorded interactions. A value comparison checks that a well-formed answer agrees with the underlying calculation. Coverage thresholds look for decisions no test visits. A ratchet watches for disabled tests. Drift checks compare catalogs against the code they describe.

I built the offline evaluation bank and a judge-based harness that grades answers against a written rubric, then made the combined evaluation a required check on every pull request, with a floor for each area that the gate enforces. On the frontend I set up coverage thresholds, accessibility audits, and browser smoke journeys that run beside the unit tests. I also helped write a definition of done for AI changes, so the expectations for a pull request live in one place.

No single check can stand in for the rest. A unit test can prove a formatter keeps the information it should, but it can’t show the assistant picks the right capability from everyday wording. A behavioral evaluation can catch that choice, but it may be too variable to point at a small logic slip. A coverage floor can tell you a branch is never reached, though not whether the assertion on it means anything. When two layers fail at once, their separate messages help find the first broken promise.

Red proves the guard reacts. The clean rerun proves the test didn’t leave the workspace changed.

Known bugs are a different problem. If every one keeps the whole suite red, people stop reading the signal. If you skip the test with no limit, the gap quietly vanishes. We held a middle position with strict expected failures and ratchets.

The loop goes like this. Write a test that reproduces the defect. Pin that exact failure as an expected one, in strict mode, so the rest of the suite stays useful and an unexpected pass turns red. Cap the number of disabled tests, so adding a new one means changing a budget in the diff and filing a ticket. Fix the behavior. Remove the marker. Keep the test as an ordinary regression case.

A known defect is pinned as an expected failure. When the fix lands the pin goes red until the marker is removed, and the test stays as a regular regression. Beside it, a staircase shows the allowed exceptions only ever stepping down.
The pin can’t be forgotten, and the budget only moves one way.

The last step matters most. A temporary waiver should disappear, but the scenario shouldn’t. After the fix, the test protects the behavior on every later run. Debt goes down because the marker is gone, and the promise stays executable. When the frontend fixes landed, the budget came down with them.

Then comes the next uncomfortable question: would that retained test fail if the decision it protects were removed? I checked several suites by deliberately breaking the conditions they guard, one at a time, and confirmed a test noticed each break. The goal wasn’t a score to publish. It was to see the assertions react.

A value comparison needs the same proof. In a controlled fixture, swap the basis of a calculation and confirm the comparison rejects the result. Restore it and confirm it passes. The answer can stay perfectly well formed in both runs, which is exactly why the number check has to prove its own failure path.

Here’s the payoff, in daily terms. I can only describe what the gates do, not how anyone feels about them, but they were built so that anyone on the team can change something and find out quickly what they broke.

Someone who adds a new capability inherits the bad-input checks without writing them, because the sweeps run across everything registered, so a new entry gets the same rules as the old ones. Someone who fixes a pinned defect gets told by the suite itself: the test unexpectedly passes, so remove the marker. Someone who wants to skip a test has to move a budget in the same diff, and a reviewer sees it. Someone who rewords how an answer presents a number learns, inside the pull request, whether it still agrees with the source calculation. And a change to a prompt runs against the evaluation bank that every pull request must pass, instead of waiting for a person to notice a different behavior.

None of that works if the gate is decoration. That’s why I wanted the failure path demonstrated, not assumed. The same goes for scope. A catalog check should reject catalog drift. A contract test should reject a broken response shape. A behavioral evaluation should report a behavior change. When one control tries to judge everything, a red result gets harder to act on and easier to dismiss.

For me the practical target is the next change. Someone edits a decision a control is meant to protect, and the right job turns red while the edit is still in front of them.

But a gate only guards what somebody thought to break. What about the bad input nobody pictured, like a single impossible number landing in a chart?