← Field Notes
TIL · Seedling

Test outcomes, not outputs

One litmus question kills most of the tests that feel productive but protect nothing.

Format: TIL·Maturity: seedling·Read: ~2 min

Here's the litmus:

Would this test still pass against a broken implementation?

If the answer is yes, the test is theater. It's asserting that code ran, not that it did the right thing.

The tells

A test is checking an output (worthless) instead of an outcome (real) when its assertions look like:

All of those pass against an implementation that's quietly wrong. They give you a green check and zero protection.

What an outcome test asserts

This bites hardest with agents, where it's tempting to assert "the agent responded" and call it covered. It responded, to a broken prompt, with a wrong answer, and your suite is green. Assert the thing that was supposed to change, or you've tested nothing.

Bonus rule

End a test-writing session with one adversarial pass: for each test, ask "how would I break the code and still pass this?" If you can answer easily, rewrite the assertion.