# Test Pyramid

> Many small unit tests at the base. Only a few big end-to-end tests at the top.

**Field:** Software Development  
**Category:** Testing & Quality  
**Also known as:** Testing Pyramid, Test Automation Pyramid

## Think of it like

Think of it like a pile of blocks. Lots of blocks at the bottom, and just a few at the top.

## Definition

The test pyramid is a guide for how many of each kind of test to write. The wide base is many small, fast unit tests. The middle is fewer integration tests. The narrow top is a few slow end-to-end tests. Tests near the top are slower and break more often, so you keep them few.

## Example

Jack's app has 600 unit tests, 80 integration tests and 12 end-to-end tests. The whole suite runs in four minutes.

## Why it matters

It keeps the suite fast and steady while still checking the whole app works.

## Common mistake

Turning it upside down, with many slow browser tests and few unit tests. The suite gets slow and flaky.

## Three principles

- **Wide base.** Many small, fast unit tests.
- **Thin top.** Few slow end-to-end tests.
- **Cost rises up.** Higher tests are slower to run.

## Related terms

- [Unit Test](https://learn.benibix.com/term/development/unit-test)
- [Integration Test](https://learn.benibix.com/term/development/integration-test)
- [End-to-End Test (E2E)](https://learn.benibix.com/term/development/end-to-end-test)
- [Automated Testing](https://learn.benibix.com/term/development/automated-testing)
- [Flaky Test](https://learn.benibix.com/term/development/flaky-test)

![A pyramid in three layers. The wide base, lit up, is unit tests: many, fast and cheap. The middle is integration tests: fewer, slower. The narrow top is end-to-end tests: a few, slow and costly. A small cloud above the tip is labelled manual and exploratory testing, done by people. An arrow up the side says slower and costlier toward the top.](https://learn.benibix.com/diagrams/dev3-test-pyramid.svg)

---

Source: https://learn.benibix.com/term/development/test-pyramid
Author: Behnia Zarei (a developer in Vienna, Austria, who builds and teaches data, AI and business intelligence at BENIBIX)
Publisher: BENIBIX Learn (https://learn.benibix.com/)
Last updated: 2026-11-17
Licence: CC BY 4.0 (https://creativecommons.org/licenses/by/4.0/). Quote freely with attribution.
