Integration testing is a level of software testing where individual units are combined and the connectivity or data transfer between these units are tested. The main aim of this testing is to recognize the interface between the modules.
Problems Before Integration Testing:
In software testing, although each level of unit testing is done still it shows errors at different levels. For example, a module in general is usually designed by an individual developer who can face issues such as different programming logic, change in user requirements, database issues, inadequate exception handling, etc., at such time unit test stuck at levels developed by developers at different levels.
These types of issues cannot be handled at unit testing level. Hence testers have to perform integration testing. Similarly, user may have external hardware failure issues as well, even after performing each level of unit testing for each module where users face problems. Solution to this is integration testing.
This level test how the unit test work together. Individual modules are combined and tested as a group. Integration testing helps to determine and ensures that applications run properly. It identifies interface issues between modules.
Different Approaches to Integration Testing:
There are three approaches to integration testing.
- Top-down Approach (TDA):
In TDA testing takes place from top to bottom following the control flow or architectural structure. High level modules are tested first then low-level modules and finally getting into the low level to high level. The diagrammatic flow will show you the top-down approach.
Fig: Top-down Approach
Less time required.
Fault localization is easier.
Detects major flaws.
Requires several stubs.
Poor support for early release.
Basic functionality is tested late.
- Bottom-up Approach (BUA):
This method of testing takes place from the bottom of the control flow upwards.
Fig: Bottom-up Approach
Less time requirements.
Test conditions are easier to create.
Requires several drivers.
Data flow is tested late.
Poor support for early release.
Key interface defects are detected late.
- Big-Bang Approach (BBA):
In this approach, all components or modules are integrated simultaneously after which everything is tested as a whole.
Fig: Big-Bang Approach
All components tested at once.
Convenient for small systems.
Saves testing time.
Lots of delay before testing.
Difficult to trace cause of failures.
Possibility of few missing interface links.
Critical modules are not prioritized.
Sandwich Integration Approach:
To overcome the limitations and exploit the advantages of these top-down, bottom-up and big-bang approaches, we have something called Sandwich integration approach. It is a mixture of top-down and bottom-up approach.
In this approach, the system is viewed as 3 layers consisting of the main target layer in the middle, another layer above the target and last below the target layer.
Below diagram will clearly demonstrate the sandwich integration approach.
Fig: Sandwich Integration Approach
Sandwich integration approach is very useful for large enterprises for huge projects that have several sub-projects. When developers use spiral model for large projects, at that time one can also use sandwich integration approach.
Both layers can be tested in parallel.
High cost, big skill set, extensive testing is not done.
How to do integration testing?
First a tester must prepare a test plan, then design test cases, test scenarios according to the plan. Execute the test cases followed by reporting of defects. Now, track andÂ read these defects as soon as they arise. Then follow the entire process again and again until the entire system is tested. So, this is how one can perform integration testing.
The below diagram will show you clearly how to perform integration testing.
Fig: Steps to perform Integration Testing
Example of Integration Testing:
Consider an application with three modules. Login page, mailbox and delete emails. All these modules are integrated logically by programmers.
Priority here is given to the integrated links instead of unit functions that are tested in advanced. So you do not have to focus on testing the login page as it is already done at unit testing. User should focus on its interface links in the mailbox page. Similarly, check the interface links of mailbox with the delete email module.
Fig: Example of Integration testing
Challenges of Integration Testing:
Integration testing also has challenges that user might come across. For example;
- Difficult test data management.
- Multiple ways for testing.
- Issues when integrated with legacy system.
- Challenging test cases.
- Time constraints.
Steps to Kick of Integration Testing:
- Focus on architecture of application.
- Identify each module.
- Check how data is communicated.
- Understand the user requirements.
- Create multiple test conditions.
- Focus on one test conditions at a time.
Advantages of Integration Testing:
- Integration testing makes ensures modules work together properly.
- Helps to uncover errors that lie in interfaces.
- Ensures that newly added components are not affected.
Integration testing is an important part of testing cycle that makes it easy to find defects when two or more units are integrated.