For enquiries call:

Phone

+1-469-442-0620

April flash sale-mobile

HomeBlogSoftware TestingIntegration Testing: Types, Approaches, Tools, Examples

Integration Testing: Types, Approaches, Tools, Examples

Published
12th Sep, 2023
Views
view count loader
Read it in
16 Mins
In this article
    Integration Testing: Types, Approaches, Tools, Examples

    An integration test is a process that tests interfaces between two software modules or units. It focuses on determining whether the interface is correct. The aim of integration testing is to expose faults in the interaction between integrated units. All modules are unit tested before integration testing is done.  

    What Is Integration Testing in Software Testing?  

    In integration testing, also called integration and testing (I&T), the different components of a software application are tested together as a single unit. Despite this, these modules may be coded by different programmers. Integration testing aims to discover any defects that may arise when the modules are integrated and must interact with each other. 

    Integrating various components of an application and testing their behavior as a single unit is known as thread testing or string testing. Ensure that the individual units are communicating properly and working as intended after integration. 

    A process in which various modules of an application are integrated, and then their behavior is tested as a single unit or a combined area. Integration Testing is also known as string testing or thread testing. Insights into Best Software Testing Certification is to check the correctness of communication among all the modules. 

    Benefits of Integration Testing  

    In Integration Testing, we can prioritize modules on top or bottom levels based on their priority since we can move upwards and downwards. The following are some of the benefits: 

    • The testing process is relatively fast 
    • Code coverage is high 
    • An efficient method of detecting system-level issues 
    • The early stages of development enable it to detect bugs early 

     Integration Testing Types  

    There are two types of integration testing: 

    1. Incremental Integration testing 
    2. Non-incremental Integration testing 

    Integration Testing

    1. Incremental Approach 

    According to the Incremental Approach, modules are added one by one or based on need. There must be a logical relationship between the selected modules. In general, two or more modules are added and tested to ensure that their functions work. Testing continues until all modules are successfully tested.There is a strong relationship between the dependent modules in this type of testing. Consider two or more modules and test whether the data flow between them is working properly. You can add more modules and test again if it is. 

    Incremental Approach

    For example:  In the case of a Flipkart application, we will perform incremental integration testing, and this is the flow of the application: 

    Flipkart→ Login→ Home → Search→ Add cart → Payment → Logout 

    The following methods are used for incremental integration testing: 

    • Top-Down approach 
    • Bottom-Up approach 

    1.1 Top-Down Approach 

    Top-down testing involves testing higher-level modules with lower-level modules until all modules are successfully tested. By testing critical modules first, major design flaws can be detected and fixed early. The modules are added incrementally, or one by one and the data flow is checked in the same order. 

    Top Down Approach

    According to the top-down approach, we will ensure that the module we add is a child of the previous one, like Child C is a child of Child B, etc. as shown below: 

    Advantages: 

    • Defects are difficult to identify. 
    • It is possible to develop an early prototype. 

    Disadvantages: 

    • It becomes quite complicated due to the high number of stubs. 
    • The testing of lower-level modules is inadequate. 
    • Modules that are critical are tested first to reduce defects. 

    1.2 Bottom-Up Method  

    Bottom-to-up testing involves testing lower-level modules with higher-level modules until all modules are successfully tested. A defect may occur when top-level critical modules are tested last, or we will add modules from bottom to top and check the flow of data in the same order. 

    Bottom Up Approach

    In the bottom-up method, we ensure that the modules we are adding are the children of the previous ones. 

    Advantages: 

    • Defects are easily identified. 
    • There is no need to wait for all the modules to be developed as it saves time. 

    Disadvantages: 

    • Defects can occur because critical modules are tested last. 
    • An early prototype is not possible. 

    Hybrid testing is an additional approach in this case. 

    1.3 Hybrid Testing Method  

    In this approach, Top-Down and Bottom-Up testing approaches are combined. The top-level modules are tested with low-level modules and the low-level modules are tested with high-level modules simultaneously. Each module interface is tested, so there are fewer chances of a defect. 

    Hybrid Method

    Advantages: 

    • A hybrid method combines the benefits of both top-down and bottom-up approaches. 
    • This method reduces the amount of time spent on the process. 
    • All modules are tested comprehensively. 

    Disadvantages: 

    • The process of this method requires a higher level of concentration since it is carried out simultaneously in both directions 
    • It is a complicated process. 

    2. Non- incremental Integration Testing 

    We will use this method when the data flow is complex, and it is difficult to find out who the is parent and the child is. In such a case, we will create data in any module and check whether the data exists in all existing modules. Therefore, it is also called the Big Bang method. 

    Non-Incremental Integration Testing

    2. 1 Big Bang Method  

    In this approach, all modules are integrated at once for testing. Although it is convenient for smaller software systems, identifying defects in large software systems is more difficult. 

    Testing can be performed after the completion of all modules, so the testing team will have less time to execute this process so that internal interfaces and high-risk critical modules are more likely to be missed. 

    Advantages: 

    • The system is convenient for small software systems. 

    Disadvantages: 

    • Defects can be difficult to identify because the source of the error is not known, and it is hard to locate. 
    • It is easy to miss small modules. 
    • Testing is provided with very little time. 
    • There is a possibility that some of the interfaces will not be tested. 

    For a better understanding of non-incremental integrating testing or the big bang, let's look at the following examples: 

    Example 1: 

    • The development team develops the application and sends it to the CEO of the testing team. The CEO will then log into the application, generate a username and password, and email the manager. The CEO will then instruct them to begin testing the application. 
    • The test engineers will submit a report to the test lead once they are done with testing, then the test leads will submit a report to the manager, and the manager will submit a report to the CEO. As shown in the following image, this is called Bottom-up incremental integration testing. 

    Note: Sandwich testing combines incremental integration testing (I.I.T) and non-incremental integration testing. 

    Example 2: 

    Below is an example of the Gmail Inbox home page, when we click on the Inbox link, we are sent to the Inbox page. In this case, we have to do Non-incremental integration testing since there is no concept of a parent and a child. 

    Stub and driver
    Stubs are dummy modules that receive data and create lots of probable data, but they perform like real modules. The Stub Q receives the data from module P without confirming or validating it, and produces the estimated outcome. 

    • Essentially, the function of a driver is to verify the data from P and send it to the stub as well as to check the expected data from the stub and send it to P. 
    • In addition to setting up the test environments, the driver handles the communication, evaluates the results, and sends reports. Stubs and drivers are never used during testing. 
    • A bottom-up integration test is ideal for white box testing, since it allows drivers to be written easily. As for black box testing, no preference is given to any testing, since it depends on the application. 

    Test Integration Approaches  

    To execute Integration testing, Software Engineering defines a variety of strategies, including: 

    1. Big Bang Testing 

    A Big bang test is an integration test that integrates all components or modules together at the same time. This unit is then tested as a whole. During testing, this combined set of components is considered an entity. An integration process cannot be executed if all the components of the unit are not complete. 

    Advantages: 

    • It is convenient for small systems. 

    Disadvantages: 

    • It is difficult to locate faults. 
    • With this approach, some interface links might be missed because of the sheer number of interfaces to be tested. 
    • As the integration testing can only begin after "all" the modules are designed, the testing team will have less time for testing. 
    • Since all modules are tested at once, high-risk critical modules are not isolated and tested on a priority basis. Also, peripheral modules that deal with user interfaces are not isolated and prioritized for testing. 

    2. Incremental Testing 

    Incremental Testing refers to the process of integrating two or more modules that are logically related to one another and testing the application for proper functioning. Following that, the other related modules are incrementally integrated and the process continues until all logically related modules have been integrated and tested. 

    3. Stubs and Drivers  

    Stubs and drivers are dummy programs that facilitate software testing in integration testing. The programs act as substitutes for missing models in the testing. Instead of implementing the entire programming logic, they simulate data communication with the calling module while testing. 

     Stub: This function is called by the module that is being tested. 

     Driver: This method calls the module that needs to be tested. 

    3.1 Bottom-up Integration Testing  

    The bottom-up integration testing strategy involves testing lower-level modules first. The tested modules are then used to facilitate the testing of higher-level modules. Testing continues until all top-level modules have been tested. After the lower-level modules have been tested and integrated, the next level of modules is created. 

    Bottom-up Integration Testing

    Advantages: 

    • It is easier to locate faults. 
    • Unlike the Big-bang approach, no time is wasted waiting for all modules to be developed 

    Disadvantages: 

    • The most important modules (at the top level of software architecture) are tested last and may be prone to defects. 
    • Early prototypes are not possible. 

    3.2 Top-down Integration Testing  

    In top-down integration testing, the control flow of the software system is followed from top to bottom. Initially, higher-level modules are tested and then lower-level modules are tested and integrated to ensure software functionality. If some modules aren't ready, stubs are used. 

    Diagrammatic Representation

    Top-down Integration testing

    Advantages: 

    • It is easier to locate faults. 
    • Early prototypes may be available. 
    • Priority is given to critical modules; major design flaws can be found and corrected first. 

    Disadvantages: 

    • Many stubs are needed. 
    • Low-level modules are inadequately tested. 

    3. Sandwich Testing 

    Sandwich testing consists of testing top-level modules with lower-level modules at the same time as lower-level modules are integrated with top-level modules and tested as a system. Because it combines both top-down and bottom-up approaches, it is called Hybrid Integration Testing. Drivers as well as stubs are used. 

    Integration Testing Techniques   

    Integration Testing can be conducted using any testing technique (Blackbox, Whitebox, and Greybox). Some of them are listed below: 

    1. Black Box Testing 

    • State Transition technique 
    • Decision Table Technique 
    • Boundary Value Analysis 
    • All-pairs Testing 
    • Cause and Effect Graph 
    • Equivalence Partitioning 
    • Error Guessing 

    2. White Box Testing 

    • Data flow testing 
    • Control Flow Testing 
    • Branch Coverage Testing 
    • Decision Coverage Testing 

    How to Do Integration Testing?  

    Integration means combining the unit-tested modules one by one and testing their functionality together. The integration test is usually conducted after the unit test. After we have created and tested the individual modules, we combine them and perform the integration test. The goal is to test the interface between the units/modules. 

    1. Prepare Integration Test Plan  

    Creating a test integration plan is an important step in the process. It is important to create a test integration plan before you begin the project. 

    Download the Test Plan Template here! 

    2. Prepare integration test scenarios & test cases  

    Preparation of test cases and scenarios for integration testing should be done beforehand. Make sure that integration test scenarios and test cases are prepared for integration testing. 

    3. Prepare test automation scripts  

    Scripts that automate the testing process should be prepared. It is important to prepare scripts that automate the testing process as soon as possible. 

    4. Execute test cases  

    Performing test cases in accordance with the requirements. Performing test cases according to the requirements set out in the specification 

    5. Report the defects  

    The defect should be reported as soon as possible if it is found. Reporting the defect as soon as possible is the best course of action. 

    6. Track and re-test the defects  

    Taking note of the defects and retesting them as soon as possible is the best thing you can do. Keep track of the defects and re-test them as soon as possible. 

    7. Re-testing & testing goes on until integration testing is complete  

    It can be safely assumed that re-testing and testing will continue until the integration testing is completed. There can be no doubt that re-testing and testing will continue until the integration testing is complete. 

    Enroll in KnowledgeHut best Software Testing certification and get a hands-on understanding of the integration testing process and the steps involved.

    Integration Testing Example  

    Let's imagine we have a Gmail application where we perform integration testing. 

    Our first step will be to perform functional testing on the login page, which includes the username, password, submit button, and cancel button. Integration testing can only then be performed. The following are the different scenarios for integration: 

    Scenarios1: 

    • We begin by logging in as P users and clicking Compose mail and performing the functional testing of the components. 
    • The next step is to click on the Send button and also to check the Save Drafts box. 

    • After that, we send a mail to Q and check the Sent Items folder of P for the sent mail. 
    • We will now log out of P and login as Q and move to the Inbox to verify that the mail has arrived. 

    Integration Testing Tools  

    This testing can be done using several tools. Here is a list of tools you can use: 

    • Rational Integration Tester 
    • Protractor 
    • Steam 
    • TESSY 

    Best Practices/ Guidelines for Integration Testing  

    • The first step is to determine the Integration Test Strategy and to prepare the test cases and test data accordingly. 
    • Analyze the application architecture and identify the critical modules. There is a need to test these on a priority basis. 
    • Create test cases to verify all of the interfaces in detail based on the interface designs provided by the Architectural team. A detailed test must be performed on interfaces to databases, external hardware, and software applications. 
    • Test data plays a critical role after the test cases. 
    • Ensure that the mock data is prepared before executing. The test cases should not be executed with test data selected. 

    Pros and Cons of Integration Testing  

    Advantages of integration testing  

    • A software integration test involves assembling a software system and conducting tests to uncover interfacing errors. 
    • Testing ensures that the application meets the client's expectations, as well as reassuring the development team that assumptions made during unit testing are valid. 
    • Integration testing does not need to wait until all modules of a system have been coded and unit tested. The process can begin as soon as the relevant modules are available. 
    • The integration testing or incremental testing ensures that the software modules are working together. 
    • In System Integration testing, we use techniques such as Incremental Testing, Top-down Testing, Bottom-up Testing, Sandwich Testing, and Big Bang Testing. 

    Disadvantages of Integration Testing  

    • It is difficult to locate faults. 
    • Due to the sheer number of interfaces that need to be tested, some interface links to be tested might be missed. 
    • Since integration testing can begin only after "all" modules are designed, the testing team will have less time to execute tests. 
    • As all modules are tested at the same time, high risk critical modules are not isolated and tested on a priority basis. In addition, peripheral modules that deal with user interfaces are not isolated or prioritized for testing. 
    • The most important modules (at the top level of software architecture) are tested last and may be prone to defects. 
    • A prototype cannot be developed in an early stage 

    Conclusion  

    This is about Integration testing and its implementation in both White Box and Black Box Techniques. We hope the examples we used were clear and relevant. As part of the testing cycle, it is essential to integrate two or more modules in order to integrate all the modules at the same time in the first step so that defects can be identified instantly. By detecting the defects at an early stage, effort and cost are saved. As a result, the integrated modules work properly as expected. 

    Integration Testing FAQs

    1What is the main purpose of integration testing?

    Integrating the modules and testing their interfaces is the purpose of integration testing so that defects can be exposed when the components are integrated and need to interact. 

    2What are the three types of integration testing? 

    The integration test can be performed in three different ways. 

    • Bottom-up Integration Testing 
    • Top-down Integration Testing 
    • Sandwich Integration Testing
    3What is API integration testing? 

    Integration testing of APIs is testing a set of application programming interfaces directly or in an integration test to determine whether they meet functional, reliability, performance, and security expectations. 

    4How many types of integration testing techniques are there? 

    There are four key strategies for executing integration testing: big-bang, top-down, bottom-up, and sandwich/hybrid.

    Profile

    Mohan Jayabal

    -

    Mohan Jayabal is a highly experienced senior corporate trainer and consultant with a strong background in software testing. With over 17 years of professional experience, he specializes in testing consultation and training, delivering comprehensive solutions to clients worldwide. Mohan has conducted testing training programs in various countries including Ethiopia, Tanzania, Vietnam, UK, and USA, covering both manual and test automation techniques. He has also served as a performance testing consultant for esteemed organizations such as City Union Bank and the Government of Tamilnadu's Public Distribution System. As an official accredited trainer for renowned companies like Accenture, Cognizant, Microsoft, IBM, and Deloitte, Mohan has successfully streamlined training processes and developed training materials for testing-related domains.

    Share This Article
    Ready to Master the Skills that Drive Your Career?

    Avail your free 1:1 mentorship session.

    Select
    Your Message (Optional)

    Upcoming Software Testing Batches & Dates

    NameDateFeeKnow more
    Course advisor icon
    Course Advisor
    Whatsapp/Chat icon