tldr: The testing pyramid says to write many fast unit tests, fewer integration tests, and a small number of end-to-end tests. The shape exists because cost and flakiness historically grew with test size. Self-healing automation is changing the math at the top layer.
What is the testing pyramid?
The testing pyramid is a model for how a test suite should be shaped. Mike Cohn introduced it in his 2009 book Succeeding with Agile, where the layers were named Unit, Service, and UI. Martin Fowler's 2012 Test Pyramid bliki entry spread it, and Ham Vocke's Practical Test Pyramid on the same site is the treatment most engineers cite today. Modern usage maps Cohn's Service layer to integration tests and his UI layer to end-to-end tests.
The three levels, bottom to top:
| Layer | What it catches | Speed | How many to keep |
|---|---|---|---|
| Unit | Logic in one function or class | Milliseconds | Most: hundreds to thousands |
| Integration | Contracts between real components | Seconds | Some: dozens to hundreds |
| End-to-end | The product as a user sees it | Minutes | Few: the critical journeys |

The rule of thumb: as you move up, each test gets more realistic and more expensive, so you keep fewer of them.
Why the pyramid has this shape
The shape is an economic argument, not a law of nature. Three costs stack up as tests get bigger: runtime, flakiness, and maintenance. A unit test scores near zero on all three. An end-to-end test takes real minutes in CI, fails for environmental reasons a unit test never sees, and breaks whenever the UI changes.
When a team's E2E costs are high on all three axes, the rational move is to keep that layer thin. That was the world the pyramid was drawn in.
The ice cream cone anti-pattern
Invert the pyramid and you get the ice cream cone: a huge manual and E2E layer on top, almost no unit tests underneath. Teams land here when QA and development work in silos. If your release checklist is mostly humans clicking, you are holding the cone.
| Pyramid | Ice cream cone | |
|---|---|---|
| Base | Thousands of unit tests | A thin sliver of unit tests |
| Top | A few automated journeys | Long manual and E2E passes |
| Feedback arrives | Minutes after a commit | Days after a release candidate |
| Failures are | Cheap and localized | Expensive, late, and vague |
Does the pyramid still hold in 2026?
The bottom still holds: nothing beats unit tests for speed and precision, and no tooling changes that.
The top is where the economics moved. Of the three costs that kept the E2E layer thin, self-healing automation removes exactly one: the maintenance cost of selectors breaking with every UI change. Runtime and test-data flakiness remain. So the top layer grows, it does not flip; a team with self-healing can afford more journey coverage than the classic ratios suggest, and still cannot afford a cone.
The honest version of the pyramid today: keep the base wide, keep the middle real, and size the top by what your maintenance tooling can sustain rather than by a fixed ratio.
Practical starting ratios
For a typical B2B SaaS codebase, a defensible starting point is roughly 70 percent unit, 20 percent integration, 10 percent end-to-end by test count. The split mirrors the cost gradient: most tests belong where a run costs milliseconds and a failure names one function. Treat it as a starting point. Audit where your last twenty production bugs escaped, then thicken the layer that would have caught them. That beats any diagram.
Where Bug0 fits
Bug0 Managed operates the top of the pyramid as a service. A forward-deployed engineer plans coverage and authors the journey tests on Passmark, Bug0's AI engine; the engine executes and self-heals them on every deploy, so the width of your top layer stops being capped by maintenance. Details are on the end-to-end testing service page.
FAQs
Who created the testing pyramid?
Mike Cohn, in his 2009 book Succeeding with Agile. Martin Fowler's 2012 bliki entry and Ham Vocke's Practical Test Pyramid carried it into mainstream engineering practice.
What is the testing trophy?
A variant by Kent C. Dodds that enlarges the integration layer for frontend-heavy apps, on the argument that integration tests give the best confidence per unit of effort in component-based UIs.
What is the testing hourglass?
An anti-pattern with a full base and a full top but a hollow middle: plenty of unit tests, plenty of E2E tests, few integration tests. It shows up as E2E failures that take hours to trace because no seam-level test localizes them.
What is the honeycomb testing model?
Spotify's alternative for microservices. It concentrates tests at the integration level of a single service, with few unit tests and few fully integrated end-to-end tests, on the argument that a small service's inner structure is implementation detail.
Where does manual testing fit in the pyramid?
Above the top, and deliberately small: exploratory testing for the things automation cannot judge, like whether a flow feels wrong. Scripted manual regression passes are the cone, not the pyramid.
