The phase when individual software modules are logically combined and tested as a group is called integration testing. The compliance of a component or a system with the specified functional requirement is evaluated in integration testing.  It is undertaken after unit testing but before system testing. For its inputs, integration testing takes unit-tested modules, forms larger groups and applies the tests present in the integration test plan to those groups, and delivers its output in the form of an integrated system ready for system testing. 

Typically, a software project is made up of multiple software modules. These are coded by different programmers or teams of programmers. When these individual modules are integrated, integration testing helps determine whether the interaction between the modules is smooth or has defects? Since data communication between these modules is the focus, it is also called I&T (Integration and Testing).

  • Each module is worked on by an individual developer whose understanding of the requirement is unique and may differ from other developers. Integration testing is crucial to check if the modules work in unity.
  • Typically, during module development, there is a huge probability that the client modifies the requirements, and these changes may not be unit tested; thus integration testing is necessary.
  • There could be erroneous interfaces between the data modules and the database, or there could be erroneous external hardware interfaces too. These warrant integration testing.

In integration testing, priority is given to the integrating links rather than the unit functions (that are usually already tested); the focus is on the interfaces and the flow of data between the modules.

The various strategies to execute integration testing are:

  • Big Bang Approach: All components are grouped together and tested as one unit. If all of the components are not completed, this test cannot be executed. It is the most convenient method for small systems. However, fault localization is rendered difficult.
  • Incremental Approach: Here, two or more logically related modules are integrated and tested as a unit for the proper working of the application. Following this, other related modules are integrated logically, and the process continues until all logically related modules are integrated and then tested.

The incremental approach is executed by two different methods

  • Top Down Approach: The higher-level modules are tested first, followed by the testing of the lower-level modules. They are integrated to check for software functionality. Fault localization is easier in this method. However, critical modules at the top level get tested last. The defects in these modules are detected at the very end, making it difficult to address them.
  • Bottom Up Approach:  The lower-level modules are tested first in this approach. These tested modules are then used while testing the higher-level modules. Fault localization is easy in this approach as well. An early prototype is made possible. Since top-level critical modules are tested first, major flaws in the design can be spotted early and fixed. The modules at the lower level may not be tested adequately.

Sandwich Testing is a combination of Top-down and Bottom-up approaches; therefore, it is called Hybrid Integration Testing strategy. Here, the top-level modules are tested with lower-level modules simultaneously. The lower modules are integrated with top modules and tested as a system. 

Integration Testing – Procedure

  1. The integration test plan is designed.
  2. The test case scenarios and scripts are designed.
  3. The test cases are executed, and defects are reported.
  4. The defects are then tracked and re-tested until the integration completion is successful.

Guru99.com recommends a few best practices while conducting integration testing:

  • Determine the Integration test strategy. This makes it easy to prepare the test cases and test data accordingly.
  • Study the architecture design of the application and identify the critical Modules, which need to be tested on priority.
  • Create test cases to authenticate the interfaces obtained from the interface designs, especially to database/external hardware/software applications.
  • The test data plays a crucial role post the test cases. Always have the mock data prepared before executing. It’s advisable not to select test data during the test case execution. 

Guru99.com also points out that there are certain entry and exit criteria for the integration testing process. 

Entry criteria include – all unit tested modules with high priority bugs fixed, all modules to be code-completed and integrated successfully, integration test plans to be finalized and documented, and the required test environment to be set for integration testing.

Exit criteria include – successfully testing the integrated application, documenting the executed test cases, fixing all high prioritized bugs, and submitting all technical documents followed by release notes.

Integration testing gets the system ready for system testing. It renders the whole unit as a package that is tested, and all defects and bugs are identified and fixed. Since it combines logically related units to form one aggregate and tests the aggregate as a whole against specified functional requirements, it is rightly called integration and testing (I&T).