The testing pyramid distributes automated tests across unit, integration, and end-to-end layers. It places most tests at the fast, isolated base and fewer tests at slower, more expensive layers, while preserving coverage of integrated behavior and user experience. section 2.1
The layers assign different responsibilities:
- Unit tests form the largest base and provide speed and isolation. section 2.1
- Integration tests validate behavior across connected components and environments. section 2.1 section 12.0
- End-to-end tests verify the user experience but should remain fewer because they are slower and more expensive. section 2.1
- Contract tests can sit between unit and integration tests, checking expectations between systems without requiring integrated environments. section 2.1.5
Login feature
A login feature can assign null, empty, and overlong credentials to unit tests; authorization and incorrect credentials to contract tests; slow service responses to integration tests; and cookie-session behavior to end-to-end tests. This division gives earlier, more specific feedback without eliminating other test layers. section 2.2
Figure 2.4 The original test automation pyramid comprising three horizontal sections: unit tests, integration tests, and E2E tests
Use the pyramid diagram to compare the relative emphasis of unit, integration, and end-to-end automation. section 2.1







