The test pyramid
An important metaphor to keep in mind when thinking about software testing is the test pyramid. The idea behind it is that we can regroup the different types of tests based on their cost and their execution speed. Based on that segmentation or order, we should write enough cheap tests to cover most of the functionality and cover the rest with other types of tests.
At the base of the pyramid are the unit tests, which are very cheap to create and maintain and are also the fastest to execute. At the top of the pyramid are the end-to-end tests and manual tests, which are more complex to create, much more costly to maintain, and are also slower to execute:
You should always have at least a set of unit tests. Then, depending ...
Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Read now
Unlock full access