Integration Testing is a level of the software testing process where individual units are combined and tested as a group.
The purpose of this level of testing is to expose faults in the interaction between integrated units.
Test drivers and test stubs are used to assist in Integration Testing.
Note: The definition of a unit is debatable and it could mean any of the following:
1. the smallest testable part of a software
2. a ‘module’ which could consist of many of ’1'
3. a ‘component’ which could consist of many of ’2'
The Software Industry uses variety of strategies to execute Integration testing , viz.
- Big Bang Approach :
- Incremental Approach: which is further divided into following
- Top Down Approach
- Bottom Up Approach
- Sandwich Approach - Combination of Top Down and Bottom Up
Below are the different strategies, the way they are executed and their limitations as well advantages.
Big Bang Approach:
Here all component are integrated together at once, and then tested.
- Convenient for small systems.
- Fault Localization is difficult.
- Given the sheer number of interfaces that need to be tested in this approach, some interfaces links to be tested could be missed easily.
- Since the integration testing can commence only after “all” the modules are designed, testing team will have less time for execution in the testing phase.
- Since all modules are tested at once, high risk critical modules are not isolated and tested on priority. Peripheral modules which deal with user interfaces are also not isolated and tested on priority.
In this approach, testing is done by joining two or more modules that are logically related. Then the other related modules are added and tested for the proper functioning. Process continues until all of the modules are joined and tested successfully.
This process is carried out by using dummy programs called Stubs and Drivers. Stubs and Drivers do not implement the entire programming logic of the software module but just simulate data communication with the calling module.
Stub: Is called by the Module under Test.
Driver: Calls the Module to be tested.
Incremental Approach in turn is carried out by two different Methods:
- Bottom Up
- Top Down
Bottom up Integration
In the bottom up strategy, each module at lower levels is tested with higher modules until all modules are tested. It takes help of Drivers for testing.
- Fault localization is easier.
- No time is wasted waiting for all modules to be developed unlike Big-bang approach
- Critical modules (at the top level of software architecture) which control the flow of application are tested last and may be prone to defects.
- Early prototype is not possible
Top down Integration:
In Top to down approach, testing takes place from top to down following the control flow of the software system.
Takes help of stubs for testing.
- Fault Localization is easier.
- Possibility to obtain an early prototype.
- Critical Modules are tested on priority; major design flaws could be found and fixed first.
- Needs many Stubs.
- Modules at lower level are tested inadequately.
Integration Testing Procedure
The integration test procedure irrespective of the test strategies (discussed above):
- Prepare the Integration Test Plan
- Design the Test Scenarios, Cases, and Scripts.
- Executing the test Cases followed by reporting the defects.
- Tracking & re-testing the defects.
- Steps 3 and 4 are repeated until the completion of Integration is successfully.
Integration Test Plans: It includes following attributes:
- Methods/Approaches to test (as discussed above).
- Scopes and Out of Scopes Items of Integration Testing.
- Roles and Responsibilities.
- Pre-requisites for Integration testing.
- Testing environment.
- Risk and Mitigation Plans.
Entry and Exit Criteria.
Entry and Exit Criteria to Integration testing phase in any software development model
Unit Tested Components/Modules
All High prioritized bugs fixed and closed
All Modules to be code completed and integrated successfully.
Integration test Plan, test case, scenarios to be signed off and documented.
Required Test Environment to be set up for Integration testing
Successful Testing of Integrated Application.
Executed Test Cases are documented
All High prioritized bugs fixed and closed
Technical documents to be submitted followed by release Notes.
Best Practices/ Guidelines for Integration Testing
- First determine the Integration Test Strategy that could be adopted and later prepare the test cases and test data accordingly.
- Study the Architecture design of the Application and identify the Critical Modules. These need to be tested on priority.
- Obtain the interface designs from the Architectural team and create test cases to verify all of the interfaces in detail. Interface to database/external hardware/software application must be tested in detail.
- After the test cases, it’s the test data which plays the critical role.
- Always have the mock data prepared, prior to executing. Do not select test data while executing the test cases.