Integration Test

Key points

  • An integration test verifies that multiple modules or features work together correctly when combined.
  • It catches defects at the "seams" between parts — the kind that unit tests alone can't find.
  • The main things it checks are the connection points between modules, such as API calls and data hand-offs.

What an integration test is

An integration test actually combines parts (modules) that have already passed unit testing, and confirms whether they work together as expected. Even when each part works correctly on its own, it's not unusual for problems to show up the moment they're combined.

🔑 Everyday exampleThink of taking an engine, brakes, and tires that have each already been confirmed to work on their own, mounting them onto an actual car body, and checking whether the car drives without issues. Each part being fine on its own doesn't guarantee there won't be problems that only show up once they're combined.

Why integration tests are necessary

A unit test confirms each module in isolation. That means problems with the "hand-off" between modules can't be caught by unit tests alone.

Module A
(unit tested)
Combine them
Module B
(unit tested)
Check that they
work together

An integration test is the phase that surfaces these "only visible once combined" problems.

How integration proceeds

Combining every module all at once makes it hard to tell where a problem originates if something goes wrong. That's why teams often take care over the order in which modules are integrated.

⬇️ Top-down Integrate from higher-level features downward
⬆️ Bottom-up Integrate from lower-level parts upward

Either way, gradually widening the integrated scope makes it easier to pin down the cause of any defect.

Examples of defects found in integration testing

Interface mismatchesField names or types don't match between the data being handed off
Data format differencesDate or numeric formats differ from what was expected
Misaligned assumptionsMiscommunication caused by different team members understanding the spec differently

These kinds of defects are tricky precisely because each module works correctly on its own — they only surface once things are actually integrated.

Integration test vs. comprehensive test

An integration test focuses narrowly on how a handful of modules work together. By contrast, the next phase — the "comprehensive test" — checks the system as a whole, end to end.

It's a staged progression: integration testing solidifies the seams between parts, and comprehensive testing confirms how the system behaves as a whole.

Summary

An integration test combines modules that have already passed unit testing and confirms they work together correctly. It's where you catch defects — like interface or data-format mismatches — that unit testing alone can't find.

Related topics:

🏠 Back to top