Coverage Critters
The parcels are piling up. Help the depot crew test every sorting route, then catch the bug hiding behind a perfect score.
Two belts. One small test suite.
Send different weights until both the light and heavy belt have been used. Can you do it in two parcels?
No routes tested yet. Send your first parcel.
The routing sheet
0 / 2 routesAwaiting your first parcel.
Every send runs the code. The green lines show the instructions it actually used.
Dispatch ledger
Your test suite is the set of parcels you send. Repeat parcels are allowed; new routes are more useful.
- No parcels on this shift yet.
Depot open. Mystery solved.
You covered the routes, challenged the promise, and reran the tests after the fix. Raccoon approves. Fox would like lunch.
What does coverage tell us?
Branch coverage asks whether a test suite has taken both outcomes of each decision. In these small early-return functions, covering every destination covers every decision outcome too.
It tells you where tests went. It cannot tell you whether the answer was right.
A tiny idea from 2004
Jon bookmarked EMMA, a free Java coverage tool. This depot is a playful, simplified cousin: choose test inputs, see what runs, then check the result against a promise.
No Java required. No actual parcels harmed.