An integration test checks whether separate components work correctly when combined. In data science, this matters when work is split across a data pipeline and model code: each part can pass its own checks while their handoff still fails. section 10.1 section 10.1.1
Use integration tests after unit tests have checked individual functions or small code blocks. The goal is not to recheck every isolated prediction or transformation, but to verify that the complete pipeline runs as expected and that outputs from one component can be used by the next. section 10.1.1 section 10.6
A focused integration test can check whether:
- data produced by a data pipeline is correctly ingested by model code. section 10.1.1
- data cleaning, feature engineering, model training, and evaluation operate together as intended. section 10.1
- an end-to-end ML pipeline runs as expected after separately developed pieces are combined. section 10.1.1
Data pipeline to model handoff
One teammate builds data cleaning and feature engineering, while another builds model training and evaluation. Unit tests may confirm that each function behaves as expected. An integration test then combines the work and asks whether the pipeline's data reaches the model code correctly from end to end. section 10.1 section 10.1.1
Integration testing complements rather than replaces other test types. Unit tests focus on a single component; regression tests look for drops in metrics, such as model performance, over time. Integration tests focus on whether components of a codebase function together properly. section 10.1.1 section 10.6
Table 10.1 Here, we show an overview of common types of tests. Unit tests are the most common in automated testing, as they check small components of code to make sure the code functions as expected.
| Type of test | Example use case |
Unit test |
Check whether a model prediction matches expected value |
Integration test |
Test whether the components of an ML pipeline function together as expected. |
Exploratory test |
Test whether the features of a web app behave as expected |
Assertions |
Check whether a function returns the correct value for a given set of inputs. This could be a function that is being applied to the elements of several columns for creating a new feature. |
Regression test |
Test whether the model performance degrades sharply after being rolled out into production |
Compare integration tests with unit, exploratory, assertion, and regression checks; the integration example centers on ML-pipeline components functioning together. section 10.1.1







































