Q&A
Testing microservices — how do you balance service isolation vs full integration tests?
Ajitesh MohantaAmbassador
Apr 26, 2026 1,790 0
We have 8 microservices. Testing strategy question: where do you draw the line between testing each service in isolation vs testing across service boundaries?
Current state:
- Each service has unit + integration tests (tests the service against its real DB, with other services mocked)
- We have ~20 E2E tests that spin up all 8 services in Docker Compose and test full user journeys
Problems:
- Service mocks drift from real service behaviour
- The 20 E2E tests take 18 minutes and are fragile
Is contract testing (e.g. Pact) the answer here? Or is there a simpler strategy that doesn't require maintaining contracts for every service pair?