automationstrategy

The test pyramid is outdated: what big teams use instead

Mike Cohn’s classic test pyramid (2009): lots of unit tests, medium integration, few E2E. The model was born in the era of heavy UI frameworks and slow browser tests. Today Playwright and Cypress run in seconds, and the balance has shifted — here’s what’s used instead of the pyramid:

🏆 Testing Trophy (Kent C. Dodds) — most integration tests, then unit, then E2E, with static analysis (TypeScript, ESLint) on top. The idea: integration tests catch more real bugs per unit of time, because code is tested in conditions closer to production.

🍯 Honeycomb (Spotify) — for microservices. Internal tests (service logic) → integrated tests (contracts with dependencies) → integration tests (full path between services). Less UI-E2E, more contract tests via Pact.

📐 Google Test Sizes — not a pyramid shape, but a classification by resources: Small (one process, network mocks), Medium (one server), Large (multi-server), Enormous (full stack). Each test is tagged by size, CI runs the relevant combinations.

⚠️ What all three share — rejecting the “unit = majority” dogma. Real bugs more often appear at the seams between modules, not inside them.

What to do right now

— Count the percentage of integration tests in your CI. Less than 20%? Your pyramid may be inverted the wrong way.

— Replace heavy E2E tests with integration tests using external-API mocks (MSW, WireMock).

— Add contract tests for each external service — Pact or OpenAPI validation.

More: Kent C. Dodds — The Testing Trophy.