Integration Testing

What is Integration Testing?

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 methods.

Integration testing

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.

Big bang Integration Testing-

In big bang integration all the modules are first required to completed and then integrated. After integration, testing is carried out on the integrated unit as a whole. It is different from system testing because here we focus testing on the interfacing/communication between the modules.
The big bang approach is not very advisable and followed for smaller projects or where development is carried out in this fashion(instead of increamental fashion which we will see in following sections).

Top-down Integration Testing-

Top-down integration testing is an increamental approach of integration testing where testing flow start from top level modules (modules higher in the hierarchy) and then flow towards 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 recieved 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 dont have to wait for all the modules to get developed(using stubs testing can be carried out).

Bottom-up Integration Testing-

Bottom up integration testing is also based increamental approach and starts test flow from lower level modules and then move upwards to 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 dont have to wait for all the modules to get developed before starting testing.

Hybrid Integration 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 direction - 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.