A happy path is a successful execution of a business scenario. An edge case produces an error instead. section 8.1
Integration tests should usually cover one happy path per business scenario, while unit tests handle as many business-scenario edge cases as possible. Add integration coverage for edge cases that unit tests cannot cover. section 8.1
Use the pattern to balance coverage against maintenance cost:
- Keep most scenario edge cases in fast, inexpensive unit tests. section 8.1
- Use one or two overarching integration tests to verify the system as a whole. section 8.1
- Adjust the ratio for project complexity; simple applications may need fewer unit tests, but integration tests still retain value. section 8.1
Figure 8.2. The Test Pyramid represents a trade-off that works best for most applications. Fast, cheap unit tests cover the majority of edge cases, while a smaller number of slow, more expensive integration tests ensure the correctness of the system as a whole.
The test pyramid visualizes the trade-off: unit tests cover most edge cases cheaply, while fewer integration tests verify system-wide correctness. section 8.1



