Craft, quality & teams · Mixed

Tests: how many, which, and what isn't worth it

In one line: Invest in a majority of tests that exercise your logic, some integration tests, and very few end-to-end ones.

Three layers

Unit. Fast, focused, running on every save. That's where most of the return is.

Integration. Against a real database and real queues. Catches what unit tests miss — schema, transactions, queries.

End-to-end. Expensive and brittle. Save them for five to fifteen critical paths only.

What's worth testing

Business logic with edge cases, calculations, permissions, and anything that already broke once. Every fixed bug gets a test — that way coverage grows in the right places and not by percentages.

What isn't worth it: code that only moves data, and tests that mock so much they test the mock and not the system.

Test quality

A good test fails for one clear reason and names what broke. A flaky test is worse than no test — it teaches the team to ignore red.

Going deeper

Separate fast tests that run on every push from a heavy suite that runs at night. And when a test fails intermittently, treat it as a high-priority bug — tolerating instability erases the whole value of the suite within months.