Questions and answers
The following are some questions and their answers regarding this chapter’s material:
- Why is the test pyramid represented as a pyramid shape?
The shape depicts a broad foundation of many unit tests. It shows layers of testing above that exercise a closer approximation to the final, integrated system. It also shows that we expect fewer tests at those higher levels of integration.
- What are the trade-offs between unit, integration, and acceptance tests?
- Unit tests: Fast, repeatable. Don’t test connections to external systems.
- Integration tests: Slower, sometimes unrepeatable. They test the connection to the external system.
- Acceptance tests: Slowest of all. They can be flaky but offer the most comprehensive tests of the whole system.
- Does the test pyramid guarantee correctness?
No. Testing can only ever reveal the presence of a defect, never the absence of one. The value of extensive testing is in how many defects we avoid...