Integration testing is the second level testing performed after unit testing. In integration testing, we test the interfacing between the modules which are inter-connected with each other as well as the end to end testing of the integrated component. Integration testing can be performed by using both white box and black box testing techniques.
There are four approaches of performing integration testing namely top down, bottom up, big bang and hybrid integration. Let's see each approach one by one.
In big bang integration, all the modules are first required to be completed and then integrated. After integration, testing is carried out on the integrated unit as a whole. It is different from system testing as here we focus testing on the interfacing/communication between the modules.
The big bang approach is not very advisable and is followed for smaller projects only.
Top-down integration testing is an incremental approach of integration testing where testing flow start from top level modules (modules higher in the hierarchy) towards the lower level modules. As there is very much possibility that the lower level modules might not have been developed while beginning with top level modules. So, in those cases Stubs are used. Stubs are dummy modules that simulate the functioning of a module by accepting the parameters received by the module and giving an acceptable result. Generally stubs have hard-coded input and output that helps in testing the other modules integrated with it.
The main advantage of top-down testing is - we don't have to wait for all the modules to get developed(using stubs that simulate the behavior of lower level modules).
Bottom up integration testing is also based incremental approach and starts from lower level modules, moving upwards to the higher level modules. Again the higher level modules might not have been developed by the time lower modules are tested. So, in those cases Drivers are used. These drivers simulate the functionality of higher level modules in order to test lower level modules.
The main advantage of bottom up integration testing is, similar to top-down testing, we don't have to wait for all the modules to get developed before starting testing.
Hybrid integration testing approach is also called Sandwich approach. This approach is combination of both top-down and bottom up integration testing. In this approach, the integration starts from middle layer and testing is carried out in both the directions - towards higher level modules(upwards) and towards lower level module(downwards). This way includes benefits of both top-down and bottom up approach and helps in faster testing of the module's interfaces.