Kelly Mears

Integration Test

A test exercising several components together, through real interfaces rather than doubles.

Testing & Verification1 min read194 words11 out · 16 in
also calledIntegration testing

An integration test exercises multiple parts of a system together — usually through their real interfaces, with real data structures and sometimes a real database or browser. It trades speed and precision for the thing unit tests structurally cannot provide: evidence that the pieces actually fit.

The case for weighting toward integration is that most defects live between components rather than inside them. A pair of components can each be perfectly tested and disagree about whose responsibility something is, and no unit test can see the gap. It also gives more freedom to refactor: the test is bound to observable behavior rather than internal structure.

The costs are real. Integration tests are slower, they fail for environmental reasons more often, and a failure points at a region rather than a line — so diagnosis takes longer.

The pragmatic position that most teams converge on: integration tests for anything crossing a boundary or depending on real environment behavior, unit tests for pure logic with many cases, and as few end-to-end tests as will do — those being the slowest and most fragile of all, but the only ones that can prove the whole thing works.

See also11

Component Story

An isolated rendered instance of a component, usable as documentation, a workbench, and a test.

Testing & Verification17 connections

Headless Browser

A real browser driven programmatically without a visible window.

Testing & Verification14 connections

Test Fixture

The prepared data or state a test runs against.

Testing & Verification16 connections

Test-Driven Development

Writing a failing test first, making it pass, then improving the code with the test as a net.

Testing & Verification12 connections

Visual Regression Testing

Comparing rendered output against a stored baseline to catch unintended visual change.

Testing & Verification14 connections

Test Double

A stand-in for a real dependency during a test — and the ways a stand-in can lie.

Testing & Verification18 connections

Contract Testing

Verifying that a service and its consumer agree on an interface's shape, without either side needing the other running to test against.

Testing & Verification12 connections

Unit Test

A fast, isolated test of one unit of behavior with its collaborators replaced.

Testing & Verification25 connections

Responsive Breakpoint

A viewport width at which a layout changes, and the assumptions that come with it.

Design & Interface18 connections

Code Coverage

The proportion of code executed by a test suite — a map of what is untested, not a measure of quality.

Testing & Verification16 connections

End-to-End Test

A test that drives the whole running system the way a user would, from the interface down through every real dependency, buying the most confidence at the highest cost.

Testing & Verification16 connections

Linked from16