integration test
A test that checks several real parts working together, such as the service talking to a real database.
In more detail
It catches routing, serialization and wiring mistakes that unit tests replace or mock away, at the cost of running more slowly. Integration tests usually cross a network or database boundary, so they need deterministic data and a real or realistic dependency.
Examples
In the APIs course: The course contract suite is an integration test: it starts the real server, sends real HTTP, reads headers and bodies, and uses the seeded database.Integration tests check a boundary between components, such as a database or another service. An integration failure often points to a contract or environment problem.The capstone suite routes simulated traffic through ingress, auth, the database and the outbox.Java: Testcontainers starts a disposable PostgreSQL container for repository tests.In this course: Integration tests verify the join between your code and a real dependency, which test doubles cannot: whether a SQL query is valid, a serializer matches the server, or a timeout is wired correctly. They are slower than unit tests, so keep them focused on boundaries where the real behaviour matters, and make setup, readiness and cleanup visible.Related terms
- unit test — An automated check of one small piece of code, such as a single function, that runs quickly and on its own.
- contract testing — Testing that an API’s real behaviour matches its written contract, and that its callers only rely on what the contract promises.
- functional test — A test that exercises a public journey the way a client would, by sending real requests and checking the observable results.
- mock — A test double that stands in for a real dependency and checks that the code under test calls it in the expected way.
- end-to-end test — A test that drives the whole system from the outside, often through a browser or public API, with every part running.
- test pyramid — A guide for balancing a test suite: many fast unit tests, fewer integration tests and a small number of end-to-end tests.
- test data — Known sample records loaded before tests so their results are predictable.
- docker compose down — Stops and removes the containers and networks a Compose project created.
- continuous integration — Automatically building and testing every change as soon as it is pushed, so problems are caught early.
- Testcontainers — A family of libraries that start real dependencies such as databases in throwaway containers for the length of a test.
- test double — Any object that replaces a real dependency in a test: a stub returns canned data, a fake is a small working implementation, and a mock checks interactions.
- broken object level authorization — An API flaw where changing an identifier in a request, such as /tasks/2 instead of /tasks/1, lets a caller reach an object that belongs to someone else.
- regression test — A test run to check that behaviour which used to work still works after a change.
Taught in
- Unit And Integration Testing — Modern API Architecture: REST, GraphQL & gRPC
- Mocking Dependencies — Modern API Architecture: REST, GraphQL & gRPC
- CodeBuild: The Build That Passed With Failing Tests — AWS Certified DevOps Engineer – Professional (DOP-C02) Exam Prep
- Continuous Integration — DevOps & Site Reliability Engineering
- Testing Strategies And The Test Pyramid — DevOps & Site Reliability Engineering
- Development Overrides, Hot Reloading And Debuggers — Docker Architecture & Production Containers
- Integration Tests, Test Data And Compose Cleanup — Docker Architecture & Production Containers
- Building Routes with Controllers — Modern .NET Core, C# & Enterprise Microservices
- Integration Testing with WebApplicationFactory — Modern .NET Core, C# & Enterprise Microservices
- API Contract Architecture: OpenAPI 3.1 & Schema Truth — Production Full-Stack Engineering
- Continuous Delivery: Blue-Green & Canary Pipelines — Production Full-Stack Engineering
- Full-Stack System Verification: Capstone Integration — Production Full-Stack Engineering
- Designing Testable Code — Modern Java: Virtual Threads & High-Throughput Services
- Testing APIs With MockMvc — Modern Java: Virtual Threads & High-Throughput Services
- Database Integration With Testcontainers — Modern Java: Virtual Threads & High-Throughput Services
- Tying It All Together — Modern Java: Virtual Threads & High-Throughput Services
- Native Test Runner: node:test & node:assert/strict — Node.js Internals & Backend Services
- Broken Object Level Authorization — Application Security & Threat Modeling for Engineers
- The Test Pyramid And Where It Is Wrong — Automated Testing, TDD & Quality Engineering
- Integration Testing With Containers — Automated Testing, TDD & Quality Engineering
- Testing With Real Databases — Automated Testing, TDD & Quality Engineering
- Code Review As A Quality Gate — Automated Testing, TDD & Quality Engineering
References
- Python docs: unittest
- Google Testing Blog: Test sizes
- Docker Compose documentation
- pytest documentation
- Microsoft Learn: Integration tests in ASP.NET Core
- Testcontainers for Java
- Spring Boot: Testing Spring Boot Applications
- ISTQB glossary: integration testing
- Martin Fowler: IntegrationTest