- It tests the interactions between software components and is done after component testing.
- The software components themselves may be specified at different times by different specification groups, yet the integration of all of the pieces must work together.
- It is important to cover negative cases as well because components might make assumption with respect to the data.
Integration testing
What is Big Bang integration testing?
In Big Bang integration testing all components or modules are integrated simultaneously, after which everything is tested as a whole.
- In this approach individual modules are not integrated until and unless all the modules are ready.
- In Big Bang integration testing all the modules are integrated without performing any integration testing and then it’s executed to know whether all the integrated modules are working fine or not.
- This approach is generally executed by those developers who follows the ‘Run it and see’ approach.
- Because of integrating everything at one time if any failures occurs then it become very difficult for the programmers to know the root cause of that failure.
- In case any bug arises then the developers has to detach the integrated modules in order to find the actual cause of the bug.
Below is the image of the big bang integration testing:
Suppose a system consists of four modules as displayed in the diagram above. In big bang integration all the four modules ‘Module A, Module B, Module C and Module D’ are integrated simultaneously and then the testing is performed. Hence in this approach no individual integration testing is performed because of which the chances of critical failures increases.
Advantage of Big Bang Integration:
- Big Bang testing has the advantage that everything is finished before integration testing starts.
Disadvantages of Big Bang Integration:
- The major disadvantage is that in general it is very time consuming
- It is very difficult to trace the cause of failures because of this late integration.
- The chances of having critical failures are more because of integrating all the components together at same time.
- If any bug is found then it is very difficult to detach all the modules in order to find out the root cause of it.
- There is high probability of occurrence of the critical bugs in the production environment
What is Integration testing? Examples, How To Do, Types/Approaches, Differences
Integration testing tests integration or interfaces between components, interactions to different parts of the system such as an operating system, file system and hardware or interfaces between systems. Integration testing is a key aspect of software testing.
It is essential for a software tester to have a good understanding of integration testing approaches since they will come across it in every project in their software testing career path.
Integration Testing in Software Engineering
- After integrating two different components together we do the integration testing. As displayed in the image below when two different modules ‘Module A’ and ‘Module B’ are integrated then the integration testing is done.
- Integration testing is done by a specific integration tester or test team.
- Integration testing follows two approach known as ‘Top Down’ approach and ‘Bottom Up’ approach as shown in the image below:
Integration Testing Example
Let us understand Integration Testing with example. Let us assume that you work for an IT organization which has been asked to develop an online shopping website for Camp World, a company that sells camping gear.
After requirements gathering, analysis and design was complete, one developer was assigned to develop each of the modules below.
- User registration and Authentication/Login
- Product Catalogue
- Shopping Cart
- Billing
- Payment gateway integration
- Shipping and Package Tracking
After each module was assigned to a developer, the developers began coding the functionality on their individual machines. They deployed their respective modules on their own machines to see what worked and what didn’t, as they went about developing the module.
After they completed the development, the developers tested their individual functionalities as part of their unit testing and found some defects. They fixed these defects. At this point they felt their modules were complete.
The QA Manager suggested that integration testing should be performed to confirm that all the modules work together.
When they deployed all of their code in a common machine, they found that the application did not work as expected since the individual modules did not work well together. There were bugs like – after logging in, the user’s shopping cart did not show items they had added earlier, the bill amount did not include shipping cost etc.
In this way, Integration Testing helps us identify, fix issues and ensure that the application as a whole, works as expected.
Integration Testing Types or Approaches
There are many different types or approaches to integration testing. The most popular and frequently used approaches are Big Bang Integration Testing, Top Down Integration Testing, Bottom Up Integration testing and Incremental integration testing. The choice of the approach depends on various factors like cost, complexity, criticality of the application etc.
There are many lesser known types of integration testing like distributed services integration, sandwich integration testing, backbone integration, high frequency integration, layer integration etc.
Let us take a look at some of the commonly used ones below.
1. Big Bang Integration Testing
In Big Bang integration testing all components or modules are integrated simultaneously, after which everything is tested as a whole. As per the below image all the modules from ‘Module 1’ to ‘Module 6’ are integrated simultaneously then the testing is carried out.
Advantage: Big Bang testing has the advantage that everything is finished before integration testing starts.
Disadvantage: The major disadvantage is that in general it is time consuming and difficult to trace the cause of failures because of this late integration.
2. Top-down Integration Testing
Testing takes place from top to bottom, following the control flow or architectural structure (e.g. starting from the GUI or main menu). Components or systems are substituted by stubs. Below is the diagram of ‘Top down Approach’:
Advantages of Top-Down approach:
- The tested product is very consistent because the integration testing is basically performed in an environment that almost similar to that of reality
- Stubs can be written with lesser time because when compared to the drivers then Stubs are simpler to author.
Disadvantages of Top-Down approach:
- Basic functionality is tested at the end of cycle
3. Bottom up Integration Testing
Testing takes place from the bottom of the control flow upwards. Components or systems are substituted by drivers. Below is the image of ‘Bottom up approach’:
Advantage of Bottom-Up approach:
- In this approach development and testing can be done together so that the product or application will be efficient and as per the customer specifications.
Disadvantages of Bottom-Up approach:
- We can catch the Key interface defects at the end of cycle
- It is required to create the test drivers for modules at all levels except the top control
4. Incremental Integration Testing
- Another approach is that all programmers are integrated one by one, and a test is carried out after each step.
- The incremental integration testing approach has the advantage that the defects are found early in a smaller assembly when it is relatively easy to detect the cause.
- A disadvantage is that it can be time-consuming since stubs and drivers have to be developed and used in the test.
- Within incremental integration testing a range of possibilities exist, partly depending on the system architecture.
5. Sandwich Integration Testing
Sandwich integration testing is a combination of both top down and bottom up approaches. It is also called as hybrid integration testing or mixed integration testing.
In sandwich integration testing, the system is considered to be made up of three layers.
- A layer in the middle which will be the target of testing
- A layer above the target layer and a layer below the target layer
- Testing begins from the outer layer and converges at the middle layer
- Advantage: The benefit of this approach is that top and bottom layers can be tested in parallel
- Disadvantage: Extensive testing of the sub-systems is not performed before the integration
6. Functional Incremental Testing
Integration and testing takes place on the basis of the functions and functionalities, as documented in the functional specification.
Steps – How to do Integration Testing
- Choose the module or component to be tested based on the strategy or approach
- Unit testing of the component is to be completed for all the features
- Deploy the chosen modules or components together and make initial fixes that are required to get the integration testing running
- Perform functional testing and test all the use cases for the components chosen
- Perform structural testing and test the components chosen
- Record the results of the above testing activities
- Repeat the above steps until the complete system is fully tested
Difference Between – Integration Testing and/vs Unit Testing
Unit Testing | Integration Testing |
Unit testing is done to confirm if the unit of code works as expected | Integration testing is done to confirm if the different modules work as expected, when integrated together |
In unit testing, the unit is not dependent on anything outside the unit being tested | In Integration testing, the components may have inter-dependency on each other or external systems |
Unit testing is done by developer | Integration testing is done by the testing team |
In the Software Testing Life Cycle (STLC), Unit testing is the first test to be executed | Integration testing is usually done before system testing and it comes after unit testing. |
There are several types of integration testing like Big Bang integration testing, Component integration testing, System integration testing etc and these are covered in detail in subsequent topics.