What is Integration Testing?
Integration Testing or the ‘Integration & Testing’ is the process of testing the specific modules where there is a contribution of more than one application as a whole or only the modules from other applications. This testing is used to make certain that the applications are capable of functioning smoothly by assimilating and communicating with one another. This type of testing can be either a black box or white box, depending on the level of contribution from other applications that are involved.
To understand what integration testing means, first, we need to understand what software testing means! Software Testing is an activity to check whether the output/result of a test is equivalent to the expected output/result, which means that the software is correctly running. The result which is obtained after a certain software/system is run must match with the result which is expected as the output from the software/system; if it fails to do so, the software needs to be re-written, or certain changes need to be done inside code written.
Software testing of a software system is done at different levels.
Testing levels are depicted as follows :
Chronologically, integration testing is done after the first step, “Unit Testing”, is done. As the name integration goes, the textual definition of Integration Testing is “Individual software modules are combined and tested together, like a group”. It means, in software, there are many components. These many components, together when combined, form a software system. This software system is tested together, and the testing level at which it is tested is known as integration testing. So when these modules are combined, the result which is obtained out of it must be equivalent to the result which is expected; that’s where integration testing comes into a part. The main purpose of integration testing is to check whether individual modules work together correctly when combined.
Also known as I & T (Integration and Testing) can help in the testing of an individual as well as full module testing. It is included in both Black Box and White Box Testing. Most organizations only test their software using Unit Testing and Functional Testing methodologies.
Types and Approaches
There are four types and approaches mentioned below:
- Big Bang Approach
- Bottom-Up Approach
- Top-Down Approach
1. Big Bang Approach
The developed modules/components of the software systems are coupled together. These individual modules are tested together when coupled. After Unit Testing, these modules are tested together, which forms a software system. But some of us may have this question that, how is Software System testing as a whole and Integration testing different? The main thing we understand here is that, in integration testing, the testing is done for the individual modules are combined together, after unit tests are conducted, and in software system testing, the whole system is tested with all the parameters taken into consideration.
The following diagram depicts exactly what the Big Bang approach of Integration testing means:
With Big Bang Approach, there are some advantages and disadvantages associated:
- It is very convenient to approach if the systems are small. As the time taken for this approach is more, big systems can lead to more consumption of time.
- Fault detection is very easy with this, considering small systems.
- Since all modules are coupled, if some fault arises in the systems, it is difficult to spot it on.
- Some modules are very important, and they need to be tested. These modules must be tested before being used in the system. But during integration testing, these modules might not be tested efficiently, as all the modules are coupled together.
- Time taken by the entire software system is much more than other integration testing approaches.
- Coupling of the modules might take up some time, which might result in taking up the time of the total process time of the software system.
- Time taken for this approach is more, as many modules are coupled together, and testing each module will take up more time.
2. Bottom-Up Approach
In this approach, the low-level modules are tested first, together and individually. All the bottom-level modules are integrated which includes, functions and procedures, and everything is coupled and tested. This helps in testing the higher-level modules, as it forms a base for them. This procedure is repeated to all of the modules from the bottom level to the top-level module is tested thoroughly. In simple terms, testing begins from the inner and the most bottommost modules and gradually heads up. Now, as stated in the diagram, the help of a driver is taken while doing so. So what is a Driver, and how does it help? As the flow suggests, the top-level modules cannot be integrated into the system until and unless bottom-level module testing is done and coupled. So the driver here helps in coupling the bottom-level and top-level modules and works as a medium or, in a technical term, as a call function.
- Development of individual modules can be done while the integration testing bottom-up approach is being used, as the coupling and integration testing is done after the bottom level modules are tested first.
- If some error exists/arises, it can be fixed at the same time and at the same level. The error identification and correction are much easier than other approaches.
- The time required for error identification and error correction is much less as compared with other approaches.
- Errors can be solved at the same instance, bottom level or at the top level.
- Time taken for the whole process is more; the process of testing does not finish till all the modules of both the top and the bottom levels are included and tested.
- Drivers are necessary to call the high-level modules.
- If the software system contains more and more small but complex modules, it may take more time for the completion of the software testing process.
3. Top-Down Approach
This approach goes exactly the opposite of the bottom-up approach. The top-level module/s are tested initially, and then simultaneously, other lower-level modules are tested. The topmost modules are first tested individually like specialized unit testing is run for the topmost module, and eventually, other modules are taken into consideration and tested. The top-down approach requires a call function just like a bottom-up approach called Stubs. The stubs are shortcode logic statements that are used to accept inputs from the top-level modules and eventually call bottom-level modules for integration and testing.
- Easily faults or errors can be detected in this approach.
- Crucial modules are tested thoroughly and prior to other modules.
- Software system integration testing can be done in less time as when compared with other approaches.
- Bottom-level modules may not be tested to the expected level or may not be tested to the requirements.
- Stubs are needed and are required for the testing process to progress further.
4. Hybrid/Sandwich Approach
Also known as Mixed Integration Testing. Bottom-Up Approach and Top-Down Approach are combined into this approach. Hence known as Hybrid or Sandwich or Mixed Integration testing approach. This approach is being used to cover up the fallouts of both approaches individually. The topmost module is unit tested, and at the same time, bottom-level modules are integrated and tested with the top-level modules.
- Mostly used for big projects and which require lots of time for completion.
- The costs of this type of testing are quite high as both approaches are used in the completion of testing.
Advantages of Integration Testing
- Integration testing for different modules at the same time is easy.
- It can be used in the early as well as later stages of the testing process.
- Code length coverage is more as compared with other software testing techniques as both the bottom-up and top-down approaches can be used.
- According to the changes in the requirements, the development varies, so the testing of modules at different levels becomes important, for which Integration testing can be used easily.
Why is Integration Testing used?
- People who have been in the IT industry might know about the constant changes which happen. Every day, according to the requirements, the need to develop a certain software system changes, so each day, new patches of code are developed. Now when these patches are coupled together to form one software. So, to check this, integration testing and its approaches are a must.
- When a complex or huge software is being coded or built, it is classified into separate modules. Many people work on these modules at the same time, but when these modules are integrated, testing is done. In most of cases, integration of modules requires integration testing to be done on it before it is processed further.
- Most of the software applications require some support libraries to work. Integration testing is done when these libraries are used along with the code developed.
- Integration becomes a must when the software is being developed, as the errors may be rectified at the stipulated level. Now, as we know about the approaches, one of the approaches may be used for it.
Integration Testing Cases
Consider we are building one employee management software.
This software has three main aspects:
- Employee Login
- Employee Report
- Employee Salary Designation Page and Salary Level
Now, considering the above case, first, the software is developed, and the flow should be Employee registration (Entering the values, ex: employee id, name, phone number, etc.). After the correct inputs, it should redirect to the net page that the employee report page. Now, if here the employee is not directed to the reports page and directly directed to the salary information page, and then it is an error. So, to rectify this, the flow, the sequence of activities, integration testing are done.
Another example of integration testing would be:
We daily check our emails. All the email service providers provide us with the same functionality.
Login-> Inbox->Send / Delete Mail-> Logout
Now, here when we log in to their servers, first, the values are checked for correctness, that is, unit testing. So, now after the credentials match, the login page should transfer us to the inbox page. That is the expected result. If it doesn’t transfer us to the Inbox page instead transfer us to some junk folder, then it becomes a case of integration testing case. The same goes for sending and deleting emails.
Other causes may be:
- After successful registration on any online/offline application, a display message should appear in front of the user.
- Banking applications should direct users to the account summary page that is required.
- After successful login into social media apps, the default page, for ex: Home / Profile for Facebook, should appear.
With so many advancements in the field of IT, day-by-day, and so many developers sitting at different locations working upon the same software, integration testing has become a must. With its approaches, integration testing can be used with small and large software applications alike. Integration testing, being at the middle of the software testing levels and having so many advantages, becomes more and more important for commercial level clients and regular check helps to keep the software intact.
This has been a guide to Integration Testing. Here we discuss the concepts of integration testing, types, and approach with their advantages and disadvantages. You can also go through our other suggested articles to learn more –