An edge case occurs when executing a business scenario results in an error. Unit tests should cover as many such cases as possible because they are fast and maintainable. section 8.1
Allocate edge-case coverage according to cost and system boundaries:
- Use unit tests for most business-scenario errors, where fast feedback and low maintenance matter. section 8.1
- Use integration tests for errors that unit tests cannot cover, alongside one successful execution per business scenario. section 8.8
- Keep the ratio responsive to project complexity; simple applications may need equal unit and integration coverage. section 8.8
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: fast, cheap unit tests handle most edge cases, while fewer integration tests verify the system as a whole. section 8.1






