Test Types
Integration Testing
Testing the interaction between integrated components or systems to find interface defects.
Full definition
Integration testing verifies that different modules or services work correctly together. While unit tests verify individual components in isolation, integration tests check the connections between them.
Approaches:
- Big Bang: Integrate everything at once and test — risky, hard to isolate issues
- Top-down: Start from top-level modules, use stubs for lower levels
- Bottom-up: Start from lowest modules, use drivers for upper levels
- Sandwich/Hybrid: Combine top-down and bottom-up
Common integration test scenarios:
- API endpoint + database: Does the endpoint correctly read/write data?
- Frontend + API: Does the UI correctly call the backend?
- Service A + Service B: Do microservices communicate correctly?
- Third-party integration: Does the payment gateway work with our checkout?
Integration tests are slower than unit tests but faster than E2E tests. They sit in the middle of the testing pyramid.