Introduction to Integration Testing
- Amruta Bhaskar
- Jul 12, 2021
- 0 comentario (s)
- 3290 Puntos de vista
Integration testing is defined as a type of testing where software modules are integrated logically and tested as a group. A typical software project consists of multiple software modules, coded by different programmers. The purpose of this level of testing is to expose defects in the interaction between these software modules when they are integrated
Integration Testing focuses on checking data communication amongst these modules. Hence it is also termed as 'I & T' (Integration and Testing), 'String Testing' and sometimes 'Thread Testing'.
Integration testing is done to test the modules/components when integrated to verify that they work as expected i.e. to test the modules which are working fine individually does not have issues when integrated.
When talking in terms of testing large application using black-box testing technique, involves the combination of many modules which are tightly coupled with each other. We can apply the Integration testing technique concepts for testing these types of scenarios.
The main function or goal of this testing is to test the interfaces between the units/modules. We normally do Integration testing after “Unit testing”. Once all the individual units are created and tested, we start combining those “Unit Tested” modules and start doing the integrated testing.
The main function or goal of this testing is to test the interfaces between the units/modules.
The individual modules are first tested in isolation. Once the modules are unit tested, they are integrated one by one, till all the modules are integrated, to check the combinational behaviour, and validate whether the requirements are implemented correctly or not.
Here we should understand that Integration testing does not happen at the end of the cycle, rather it is conducted simultaneously with the development. So in most of the time, all the modules are not actually available to test and here is what the challenge comes to test something which does not exist!
We feel that Integration testing is complex and requires some development and logical skill. That’s true! Then what is the purpose of integrating this testing into our testing strategy?
Here are some reasons:
- In the real world, when applications are developed, it is broken down into smaller modules and individual developers are assigned 1 module. The logic implemented by one developer is quite different than another developer, so it becomes important to check whether the logic implemented by a developer is as per the expectations and rendering the correct value in accordance with the prescribed standards.
- Many a time the face or the structure of data changes when it travels from one module to another. Some values are appended or removed, which causes issues in the later modules.
- Modules also interact with some third-party tools or APIs which also need to be tested that the data accepted by that API / tool is correct and that the response generated is also as expected.
- A very common problem in testing – Frequent requirement change! Many a time developer deploys the changes without unit testing it. Integration testing becomes important at that time.
Although each software module is unit tested, defects still exist for various reasons like
- A Module, in general, is designed by an individual software developer whose understanding and programming logic may differ from other programmers. Integration Testing becomes necessary to verify the software modules work in unity
- At the time of module development, there are wide chances of change in requirements by the clients. These new requirements may not be unit tested and hence system integration Testing becomes necessary.
- Interfaces of the software modules with the database could be erroneous
- External Hardware interfaces, if any, could be erroneous
- · Inadequate exception handling could cause issues.
There are several advantages of this testing and a few of them are listed below.
- This testing makes sure that the integrated modules/components work properly.
- Integration testing can be started once the modules to be tested are available. It does not require the other module to be completed for testing to be done, as Stubs and Drivers can be used for the same.
- It detects the errors related to the interface.
Types of Integration Testing
1. Big Bang Approach:
Big bang approach integrates all the modules in one go i.e. it does not go for integrating the modules one by one. It verifies if the system works as expected or not once integrated. If any issue is detected in the completely integrated module, then it becomes difficult to find out which module has caused the issue.
Big bang approach is a time-consuming process of finding a module which has a defect itself as that would take time and once the defect is detected, fixing the same would cost high as the defect is detected at the later stage.
Advantages of Big Bang approach:
- It is a good approach for small systems.
Disadvantages of Big Bang Approach:
- It is difficult to detect the module which is causing an issue.
- Big Bang approach requires all the modules all together for testing, which in turn, leads to less time for testing as designing, development, Integration would take most of the time.
- Testing takes place at once only which thereby leaves no time for critical module testing in isolation.
2. Bottom-Up Integration Testing
In bottom-up testing, each module at lower levels is tested with higher modules until all modules are tested. The primary purpose of this integration testing is, each subsystem is to test the interfaces among various modules making up the subsystem. This integration testing uses test drivers to drive and pass appropriate data to the lower level modules.
- In bottom-up testing, no stubs are required.
- A principal advantage of this integration testing is that several disjoint subsystems can be tested simultaneously.
- Driver modules must be produced.
- In this testing, the complexity that occurs when the system is made up of a large number of a small subsystem.
3. Top-Down Integration Testing
Top-down integration testing technique used in order to simulate the behaviour of the lower-level modules that are not yet integrated. In this integration testing, testing takes place from top to bottom. First, high-level modules are tested and then low-level modules and finally integrating the low-level modules to a high level to ensure the system is working as intended.
- Separately debugged module.
- Few or no drivers needed.
- It is more stable and accurate at the aggregate level.
- Needs many Stubs.
- Modules at lower level are tested inadequately.
4. Mixed Integration Testing
Mixed integration testing is also called sandwiched integration testing. A mixed integration testing follows a combination of top-down and bottom-up testing approaches. In top-down approach, testing can start only after the top-level module have been coded and unit tested. In the bottom-up approach, testing can start only after the bottom level modules are ready. This sandwich or mixed approach overcomes this shortcoming of the top-down and bottom-up approaches. Mixed integration testing is also called sandwiched integration testing.
- Mixed approach is useful for very large projects having several sub-projects.
- This Sandwich approach overcomes this shortcoming of the top-down and bottom-up approaches.
- For mixed integration testing, require a very high cost because one part has Top-down approach while another part has bottom-up approach.
- This integration testing cannot be used for smaller system with huge interdependence between different modules.