Integration Testing
Integration testing checks whether two or more software parts work together across a real boundary, such as an application talking to its database, message broker, file system, or another service.
itSoftware engineering | OpenSkills.info
Course pathWalk it in order
Look it upDip in anytime
Go furtherLeaves this page
Don't Panic
Don't Panic — Integration Testing
Integration testing is the part of testing where software components stop being polite diagrams and start exchanging real data across a boundary. One part of the application calls another system, such as a database, HTTP service, message broker, file system, or framework host. The test asks whether that collaboration produces the result the application claims it will. A unit test can prove the calculation. It cannot tell you that the database driver, schema, transaction, and application agreed on what an order was supposed to become.
The useful shape has five pieces: a system under test, meaning the component whose behavior matters; an entry point that triggers it; a collaborator on the far side of the boundary; a fixture that makes the starting state known; and an observation that catches the result in the act. Setup, trigger, observe, clean up. This is less glamorous than it sounds, which is fortunate, because reliable tests usually are.
The surprise is that “integration” does not mean “start every service and hope for the best.” A narrow test can connect one repository to one database. A broad test can start several services. The name should state the boundary, because every extra real collaborator also creates another possible explanation when the run fails. A real local service preserves behavior that an in-memory substitute cannot, while a test double can make rare errors repeatable. Neither is magic; each proves only the behavior it contains.
Determinism means the same controlled inputs and state produce the same result. Give tests unique identifiers. Reset mutations. Keep parallel workers out of the same database, queue, port, namespace, or tenant. A process with an open port is not necessarily ready for useful work, which is a small but persistent betrayal by computers. Wait for the operation you need: a query, a health response, or a test message, with a deadline.
Assertions should watch the external result. If an HTTP request creates an order, inspect the response and the stored order. Count internal calls only when that interaction is itself the contract. If a run fails after another test, suspect leaked state. If it fails only in parallel, suspect a resource collision. If it passes on retry, preserve the first failure rather than declaring the universe stable again.
Read the intro for the fuller map of scopes, fidelity, fixtures, and failure diagnosis. The slides compress the choices into paths and decision rules. The cheatsheet is the working reference when selecting collaborators, reset strategies, and observations. The practice reference and exercise turn the pattern into one controlled HTTP-to-database test. The quiz checks whether the boundaries have stayed in the correct boxes.
Where this skill leads
Relevant careers
See how this topic contributes to broader role-level skill maps.
Sources
- https://learn.microsoft.com/en-us/aspnet/core/test/integration-tests
Supports
- Integration tests cover multiple components and supporting infrastructure
- Unit tests isolate components while integration tests take longer and require more processing
- System under test terminology, public request flow, test hosts, test databases, seeding, and suite separation
- Quiz answers about scope, cost, fixtures, state, and the system under test
- https://martinfowler.com/articles/practical-test-pyramid.html
Supports
- Narrow integration tests exercise application boundaries such as databases, files, and remote services
- A database test starts the dependency, triggers behavior, and reads the result
- Local dependencies and test doubles can improve independence and feedback speed
- Test portfolios use fewer tests as scope and cost increase
- https://docs.spring.io/spring-boot/reference/testing/testcontainers.html
Supports
- Testcontainers manages services in containers for integration tests against real backend software
- Application configuration can receive container connection details for test execution
- https://testcontainers.com/
Supports
- Test dependencies can be defined as code, created for tests, and removed afterward
- Containerized databases, brokers, and web services support data-layer and application integration tests
- Disposable dependencies provide known state across supported language ecosystems
- https://java.testcontainers.org/features/startup_and_waits/
Supports
- Container startup and service readiness require explicit wait strategies and bounded timeouts
- Quiz answer about meaningful readiness checks
- https://docs.github.com/en/actions/tutorials/use-containerized-services/use-docker-service-containers
Supports
- CI jobs can provision fresh database, cache, or web-service containers for integration tests and remove them after the job
- Service containers require explicit networking and port configuration depending on job placement
- https://docs.pact.io/
Supports
- Consumer-driven contract tests check that service interactions remain compatible
- Contract testing complements rather than proves all deployment and end-to-end behavior
- Quiz answers about the limits of doubles and contract tests
- https://wiremock.org/docs/
Supports
- WireMock simulates HTTP dependencies with request matching, controlled responses, faults, and verification
- A test double proves configured SUT behavior rather than current behavior of a real provider
- https://wiremock.org/docs/faq/
Supports
- WireMock core is open source and free, with a hosted managed service available
- Landscape licensing and pricing classification for WireMock
- https://www.mock-server.com/mock_server/getting_started.html
Supports
- MockServer tests proceed through expectation setup, scenario execution, and request verification
- Awesome Links rationale and Landscape placement for MockServer
- https://www.mock-server.com/proxy/verification.html
Supports
- MockServer verifies recorded requests, responses, counts, and sequences
- Quiz answer about interaction verification
- https://learning.postman.com/docs/tests-and-scripts/test-apis/integration-testing/
Supports
- Postman collections can exercise API interactions and multi-request data flows
- Landscape placement for Postman
- https://docs.localstack.cloud/
Supports
- LocalStack provides a local cloud emulator for cloud-application integration testing
- Landscape placement for LocalStack
- https://docs.localstack.cloud/aws/getting-started/quickstart/
Supports
- A local cloud fixture can host infrastructure and an automated integration-test suite
- Reference-link rationale for the integration-testing quickstart
- https://smartbear.com/product/ready-api/
Supports
- ReadyAPI runs functional API tests across REST, SOAP, Kafka, JDBC, and JMS and integrates with CI systems
- Landscape placement for ReadyAPI
- https://docs.karatelabs.io/
Supports
- Karate supports API requests, assertions, database and message testing, mocks, and CI execution
- Landscape placement and open-source classification for Karate
- https://github.com/sindresorhus/awesome
Supports
- The canonical index identifies the curated awesome-testing list as the software-testing list
- https://github.com/TheJambo/awesome-testing
Supports
- The service-virtualization section identifies WireMock, MockServer, and Beeceptor as testing ecosystem tools
- https://beeceptor.com/docs/
Supports
- Beeceptor provides mock endpoints for controlled API dependency behavior
- Awesome Links rationale and Landscape placement for Beeceptor
- https://shopify.engineering/unreasonable-effectiveness-test-retries-android-monorepo-case-study
Supports
- Retries improve pipeline pass rates but can hide reliability problems, so tests that pass after retry need follow-up
- Field Note on retaining retry evidence instead of treating a later pass as proof of health
- https://github.blog/engineering/engineering-principles/reducing-flaky-builds-by-18x/
Supports
- Same code with different test outcomes is operational evidence of flakiness
- Retry placement can distinguish likely randomness, time assumptions, and order-dependent shared state
- Field Notes on classifying failures from retained execution history
- https://engineering.grab.com/iOS-CI-infrastructure-with-observability-tools
Supports
- Fixed sleeps slow tests and still allow timing-related intermittent failures
- Resetting test environments and monitoring failure trends improve diagnostic quality
- Field Notes on readiness conditions, state reset, and flake trends
