Integration testing -- also known as integration and testing (I&T) -- is a type of software testing in which the different units, modules or components of a software application are tested as a combined entity. However, these modules may be coded by different programmers.
The aim of integration testing is to test the interfaces between the modules and expose any defects that may arise when these components are integrated and need to interact with each other.
Also known as string testing or thread testing, integration testing involves integrating the various modules of an application and then testing their behaviour as a combined, or integrated, unit. Verifying if the individual units are communicating with each other properly and working as intended post-integration is essential.
To perform integration testing, testers use test drivers and stubs, which are dummy programs that act as substitutes for any missing modules and simulate data communications between modules for testing purposes. They also use integration-testing tools, including the following:
Integration testing is usually done simultaneously with development. But this can create a challenge if the modules to be tested are not yet available.
Integration testing is conducted after unit testing, where the functional correctness of the smallest piece of code, or unit, is tested. Each unit can be logically isolated in the software. The smaller the unit, the more granular insights unit testing can reveal.
The main difference between unit testing and integration testing is that in unit testing, individual modules are tested. In integration testing, these modules are combined and tested as a single unit to check the functionality of the overall application.
Integration testing is vital in today's IT and software development landscapes, especially when requirements are dynamic and deadlines are tight. Even when each module of the application is unit-tested, some errors may still exist. To identify these errors and ensure that the modules work well together after integration, integration testing is crucial.
Key reasons to conduct integration testing include the following:
Four key strategies to execute integration testing are big-bang, top-down, bottom-up and sandwich/hybrid testing. Each approach has benefits and drawbacks.
Big-bang testing: The big-bang approach involves integrating all modules at once and testing them all as one unit.
Big-bang testing's advantages include the following:
However, big-bang testing has disadvantages, for example:
Top-down testing: The top-down approach is an incremental approach that involves testing from the topmost or highest-level module and gradually proceeding to the lower modules. Each module is tested one by one, and then integrated to check the final software's functionality.
Advantages of top-down testing are as follows:
However, disadvantages to top-down testing are as follows:
Bottom-up testing: Bottom-up (also known as bottom-to-top) integration testing is the opposite of the top-down approach. It involves testing lower-level modules first, and then gradually progressing incrementally to higher-level modules. This approach is suitable when all units are available for testing.
Advantages of bottom-up testing are as follows:
Meanwhile, disadvantages of this type of testing include the following:
Sandwich/hybrid testing: Sandwich or hybrid integration testing combines the top-down and bottom-up approaches. It uses both stubs and drivers.
The advantage of sandwich or hybrid testing is that it is:
However, this strategy has the following disadvantages:
The steps involved in integration testing are as follows:
Consider a video-streaming mobile application. Its core features include the following:
Once users download the applications, they see a sign-up form where they can enter their account information. After successful Authorization, they are redirected to a page listing different subscription plans. They can choose their own plan and then complete the payment.
Any errors in this logical flow could cause problems for the user and lead to losses for the app company. Integration testing can help find and fix such errors.
So, after each module is ready, testers conduct unit testing. And once all modules are available, testers test them together to check their interfaces and data flows. If no errors are detected, the end user should be able to successfully complete their transaction.
Learn about threat modeling and DevOps and the benefits of continuous testing to quality assurance teams. Explore Java test frameworks and tools for JDK developers, why you should craft an integration testing plan with quality in mind before quantity and the difference between user acceptance testing and system integration testing.
13 Jan 2022