The Test Pyramid is a model that describes how to distribute automated tests across different levels. It recommends a broad base of fast, isolated unit tests, a smaller layer of integration or service tests, and a thin top layer of slow, end-to-end tests that exercise the full user interface.
Key components of the test pyramid include:
- Unit Tests: The base of the pyramid. They are quick to run and cheap to maintain, and they pinpoint exactly where a defect is.
- Integration Tests: The middle layer. They check that components, services and databases work together correctly.
- End-to-End Tests: The top layer. They confirm critical user journeys work across the whole system, but they are slower and more prone to flakiness.
- Feedback Speed: Pushing most checks down the pyramid gives developers results in minutes rather than hours.
A suite shaped like an inverted pyramid, or ice-cream cone, relies mostly on end-to-end tests, which makes it slow, expensive and fragile. The pyramid is a guideline rather than a fixed ratio, and teams adapt it to their architecture.


