Integration testing is a level of software testing where individual units or components of a software application are combined and tested together. The purpose of this level of testing is to expose faults in the interaction between integrated components.
In other words, integration testing checks the communication paths and interactions between components to ensure they work together correctly.
Here are the main types of integration testing:
- Big Bang Approach: This approach involves combining all or most of the units together and testing them in one go. This method is applicable when the testing team receives the complete software in a bundle.
- Incremental Approach: This approach involves testing two units that have already been coded, and then testing those with other coded units incrementally. This approach is divided into two types:
- Top-Down Approach: Testing takes place from top to bottom, following the control flow or architectural structure. High-level modules are tested first and lower-level modules are tested step by step after that.
- Bottom-Up Approach: It is the opposite of the top-down approach. Testing is conducted from the bottom of the control flow to upward.
- Sandwich/Hybrid Approach: This approach is a combination of top-down and bottom-up approaches, aiming to leverage the advantages of these approaches.
- Stub and Driver: Stubs and drivers are used in top-down and bottom-up approaches respectively. A stub is a piece of code that simulates the activities of a missing component that is called from the component under test. A driver simulates the activities of a missing component that calls the component under test.
To perform integration testing, testers can use a variety of techniques, including black box testing, white box testing, gray box testing, and others. In modern continuous integration environments, automated tests are often used to maintain high levels of code and integration coverage.