The testing pyramid balances test coverage and feedback speed: keep many fast unit tests at the base, fewer integration tests above them, and still fewer end-to-end tests at the top. section 9.4
Use each layer for a different scope:
- Unit tests exercise a small function or code unit in isolation, often with mocked dependencies. section 9.12
- Integration tests exercise a whole microservice through its normal interface, such as HTTP requests or messages. section 9.12
- End-to-end tests exercise groups of microservices or the full application, including the frontend. section 9.4
A practical microservices stack
Run unit and integration tests with Jest, use its --watch or --watchAll flags for rapid feedback, start a cut-down application with Docker Compose, and drive the frontend with Playwright for end-to-end tests. Connect the suite to CI/CD so failures warn before production. section 9.12 section 9.4
Use the diagram to compare the relative amounts of unit, integration, and end-to-end tests in a suite. section 9.4







