Rough Work/the guardrails

The Test Pyramid

Teams start with unit tests, find they don't catch the "real" bugs — the ones that happen when systems interact — and compensate by writing massive end-to-end tests that spin up browsers and click through entire workflows. This is the Ice Cream Cone: heavy at the top, nothing at the base. Feedback takes hours. Tests break when a button moves or a third-party service hiccups. Eventually nobody trusts them, and the suite becomes something you babysit rather than something that helps you ship.

The Test Pyramid inverts this. Unit tests form the base — many of them, each testing a single function or logic path, running fast, failing with precision. Integration tests sit in the middle, fewer in number, verifying that modules actually communicate correctly: database queries work, API calls succeed. At the top, a small number of end-to-end tests cover only the critical paths — can a user log in, can they complete a purchase. Smoke tests, not comprehensive coverage.

The shape matters less than the habit that maintains it. When a high-level test catches a bug, the best teams don't just fix the bug — they write a unit test that would have caught it first, pushing the failure down to where it can be tested cheaply and reliably. Over time that discipline builds a foundation where complexity gets tested at the bottom and integration gets verified in the middle.

The goal is a suite fast enough to run on every commit, precise enough to tell you exactly what broke, and trustworthy enough that you stop babysitting it.

to navigate