Testing Pyramid
The testing pyramid organizes tests by scope and speed:
- Unit tests (bottom, many): Test individual functions in isolation.
- Integration tests (middle): Test modules/services together.
- Contract/CDC tests (middle): Test API contracts between services.
- System/E2E tests (upper): Test complete user flows.
- Acceptance/UAT (top, few): Validate against business requirements.
Each level builds on the previous: unit tests catch bugs early and fast; system tests validate end-to-end.
📄️ Unit Testing
Test individual functions and classes in isolation.
📄️ Component and Integration Testing
Test service boundaries and data flows with component tests, API contract tests, database integration tests, and test containers for reproducible environments.
📄️ Contract and Consumer-Driven Contract Tests
Validate API contracts between services to catch breaking changes early and enable safe microservices development.
📄️ End-to-End and System Testing
Test complete user workflows across all system layers to validate real-world behavior and user experience.
📄️ Acceptance and User Acceptance Testing (UAT)
Validate that the system meets business requirements and user expectations using behavior-driven testing frameworks.