Glossary term
Test pyramid
The test pyramid is a model for balancing an automated test suite: many fast unit tests at the bottom, fewer integration and API tests in the middle, and a small number of slow end-to-end UI tests at the top. Mike Cohn introduced the idea, and Martin Fowler later helped popularise it.
The three layers
- Unit tests check one function or class in isolation. They run in milliseconds, so you can have thousands.
- Integration and API tests check that components work together. See integration testing.
- End-to-end tests drive the real UI through key user journeys. See end-to-end testing.
Why the shape matters
Tests near the top are slower, more expensive to maintain and more likely to be flaky. A suite shaped like an ice-cream cone, with mostly UI tests, gives slow feedback and breaks often. Moving checks down the pyramid where possible keeps CI fast and reliable.
The pyramid for AI apps
LLM apps add evaluation tests that score answers with metrics such as faithfulness. These are slower and cost money per run, so teams usually run a small evaluation set on every change and a larger one nightly.
Read the full guide: Cypress vs Selenium 2026 — Which Should You Learn First?
