test pyramid
A guide for balancing a test suite: many fast unit tests, fewer integration tests and a small number of end-to-end tests.
In more detail
It is a conversation about feedback speed, diagnosis and risk, not a fixed ratio for every repository. Choose tests from risk, and let production incidents add or improve tests.
Example
In this course: Mike Cohn described it and Martin Fowler popularised it. The height stands for cost: tests near the top are slower, need more of the system running and fail for more reasons unrelated to your change. It is a default shape, not a quota, and the right shape depends on your architecture and risks.Related terms
- unit test — An automated check of one small piece of code, such as a single function, that runs quickly and on its own.
- integration test — A test that checks several real parts working together, such as the service talking to a real database.
- end-to-end test — A test that drives the whole system from the outside, often through a browser or public API, with every part running.
- testing trophy — An alternative to the test pyramid that puts most of the weight on integration tests, with static checks at the base.
- blast radius — How much of a system is affected when something fails or has to be running for a check to happen.
Taught in
- Continuous Integration — DevOps & Site Reliability Engineering
- Testing Strategies And The Test Pyramid — DevOps & Site Reliability Engineering
- Prioritising Test Cases — ISTQB Certified Tester Foundation Level (CTFL v4.0) Exam Prep
- The Test Pyramid And The Testing Quadrants — ISTQB Certified Tester Foundation Level (CTFL v4.0) Exam Prep
- The Test Pyramid And Where It Is Wrong — Automated Testing, TDD & Quality Engineering
References
- Martin Fowler: TestPyramid
- Ham Vocke on martinfowler.com: The Practical Test Pyramid
- ISTQB Glossary: test pyramid
- ISTQB CTFL Syllabus v4.0.1, section 5.1.6