Test Pyramid: A Structured Approach to Effective Testing

Explore the test pyramid for robust testing strategies that effectively validate software functionality, ensuring high-quality software products and meeting user expectations.

A very useful way of thinking about different kinds of tests is by using the test pyramid. It’s a simple graphical representation of the different kinds of tests we need around our code and the relative numbers of each. This lesson introduces the key ideas behind the test pyramid.

The test pyramid in graphic form looks as follows:

Press + to interact
The test pyramid representing different tests and their relation
The test pyramid representing different tests and their relation

We can see from the above graphic that tests are divided into four layers. We have unit tests at the bottom. Integration tests are layered on top of those. The pyramid is completed by end-to-end and user acceptance tests at the top. The graphic shows unit tests in our system are the highest in number, with fewer integration tests and the least number of acceptance tests.

Four layers of the pyramid test

Some of these kinds of tests are new to this course. Let’s define what they are:

Unit tests: These are familiar. They are the FIRST tests we have been using up until now. One defining feature of these tests is that they don’t require the presence of any ...

Get hands-on with 1400+ tech skills courses.