01
Integration Tests
Choosing and paying for the boundary that runs for real: deciding which dependency runs with the real thing, managing the environment that brings dependent services up, preparing and masking production-like test data, putting migration and schema under test, and imitating an external service with record and replay approaches.
- 01 The Scope of Integration Testing Treating which dependency runs for real as a decision: running the same test against a fake and a real catalog, catching a schema mismatch only at the real boundary, and measuring the boundary's cost in queries per run.
- 02 Test Environment Management Bringing a dependent service up before the test: counting the setup and teardown steps, setting up a readiness probe as a step, catching the previous lesson's missed defect class at the real boundary, and showing why a process-lifetime-bound defect gets past it.
- 03 Test Data Management Measuring which property production-like test data has to preserve: a report defect caught by the distribution's tail rather than volume, the constraint, distribution, and relationship properties masking breaks, and the defect class the masked value destroys.
- 04 Database Testing Putting migration steps and the schema under test: verifying the shape the up migration produces, migration-number uniqueness, catching data loss in the down migration, a migration failing on existing data with a constraint violation, and the backfill value a schema test cannot see.
- 05 Mocking External Services Imitating another team's service with record and replay: a run fed from the recording working without a process or a network call, request drift being caught when it finds no match in the cassette, and the response the recording freezes staying green when the contract changes.