What is Integration Testing

Simply said, “integration testing” means integrating or combining the unit-tested modules one at a time and testing their behavior as a single entity.

Testing the interfaces between the units/modules is the primary purpose of this testing.

“Unit testing” is typically followed by integration testing.Following the creation and testing of each individual unit, we merge the “Unit Tested” modules and begin the integrated testing process.

Testing the interfaces between the units/modules is the primary purpose of this testing.

Initially, each module is tested separately. Following unit testing, the modules are merged one at a time until all of them are integrated in order to verify that the requirements have been met and to examine combinational behavior implemented correctly..

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 most of the time, all the modules are available for testing, and the challenge is to test something that does not exist!

Why Integration Test

Integration testing can be challenging and demands development and logical expertise. What is the reason for incorporating this testing into our overall testing approach?

Here are some reasons:

  1. In the real world, when applications are developed, it is broken down into several smaller modules and individual developers are assigned 1 module. The logic implemented by one developer differs from another developer, so it becomes important to check whether the logic implemented by a developer is as per the expectations and renders the correct value following the prescribed standards.
  2. 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.
  3. Modules also interact with a few third-party tools or APIs, which also need to be tested to ensure that the data accepted by that API / tool is correct and that the response generated is also as expected.
  4. Frequent requirement change is a very common problem in testing. Many a time, the developer deploys the changes in unit testing. Integration testing becomes important at that time.

Advantages

This testing has several advantages, and a few of them are listed below.

  • This testing ensures that the integrated modules/components work properly.
  • Integration testing can start once the modules to be tested are available. This does not require another module to be completed for testing to be done, as Stubs and Drivers can be used for the same.
  • It detects errors related to the interface.

Challenges

We have identified several challenges associated with the Integration Test.

#1) Integration testing means testing two or more integrated systems to ensure that the system works properly. Besides testing the integration links, it is necessary to perform exhaustive testing, considering the environment to ensure that the integrated system works properly.

There might be different paths and permutations which can test the integrated system.

#2) Managing Integration testing becomes complex because of a few factors involved in it like the database, platform, environment, etc.

When integrating a new system with the legacy system, extensive changes and testing are necessary. This concept is relevant when merging two legacy systems.

#4) Integrating two different systems developed by two different companies is a big challenge because the impact of changes made in one system on the other is uncertain.

To minimize the impact while developing a system, developers should consider a few things, such as possible integration with other systems, etc.

Types of Integration Testing

Given below is a type of Test Integration along with its advantages and disadvantages.

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.

The Big Bang approach consumes a lot of time in finding a module that has a defect itself because it takes time, and once the defect is detected, fixing it would cost more as the defect is detected at a later stage.

Big bang approach

Advantages of the Big Bang approach:

  • It is a good approach for small systems.

Disadvantages of the Big Bang Approach:

  • It is difficult to detect which module is causing an issue.
  • The Big Bang approach requires all the modules together for testing, which leads to less time for testing as design, development, and integration would take most of the time.
  • Testing takes place at once only, which thereby leaves no time for critical module testing in isolation.

Integration Testing Steps:

  1. Prepare Integration Test Plan.
  2. Prepare integration test scenarios & test cases.
  3. Prepare test automation scripts.
  4. Execute test cases.
  5. Report the defects.
  6. Track and re-test the defects.
  7. Re-testing & testing goes on until integration testing is complete.

Test Integration Approaches

There are fundamentally 2 approaches for doing test integration:

  • Bottom-up approach
  • Top-down approach.

Please consider the figures given below to test the approaches:

Integration 1

Bottom-up Approach

Bottom-up testing, as the name suggests, starts from the lowest or the innermost unit of the application, and gradually moves up. Integration testing starts with the lowest module and gradually progresses towards the upper modules of the application.

We continue this integration until we integrate all the modules and test the entire application as a single unit.

In this case, modules B1C1, B1C2 & B2C1, B2C2 are the lowest modules which are unit tested. Modules B1 & B2 are not yet been developed.

The functionality of Module B1 and B2 is that it calls the modules B1C1, B1C2 & B2C1, B2C2. Since B1 and B2 are not yet developed, we would need some program or a “stimulator” which will call the B1C1, B1C2 & B2C1, B2C2 modules. These stimulator programs are called DRIVERS.

In simple words, DRIVERS are the dummy programs that are used to call the functions of the lowest module in a case when the calling function does not exist. The bottom-up technique requires a module driver to feed a test case input to the interface of the module being tested.

The advantage of this approach is if a major fault exists at the lowest unit of the program, it is easier to detect it, and corrective measures can be taken.

The disadvantage is that the main program does not exist until the last module is integrated and tested. As a result, we can only detect the higher-level design flaws at the end.

Top-down Approach

This method begins with the highest module and works its way down to the lower modules. Isolated unit testing is only done on the top module. The lower modules are then integrated one at a time. Until every module has been incorporated and tested, the procedure is repeated.

According to our figures, Module A is tested first, and then we gradually incorporate the lesser modules B1 and B2. These are the B1 and B2 lower modules that cannot be integrated. Thus, we create “Stubs” after testing the topmost module A.

“Stubs” are code snippets that receive inputs or requests from the top module and return the response or results. In this manner, even though there are no lower modules, we can test the top module.

In practical scenarios, the behavior of stubs is not as simple as it seems. In this era of complex modules and architecture, the called module, most of the time involves complex business logic like connecting to a database.

As a result, creating Stubs becomes as complex and time-consuming as the real module. Sometimes, the Stub module may be bigger than the stimulated module.

Both Stubs and drivers are dummy pieces of code which is used for testing the “non-existing” modules. They trigger the functions/method and return the response, which is compared to the expected behavior.

Let’s conclude with some differences between Stubs and Driver:

StubsDriver
Used in Top down approachUsed in Bottom up approach
Top most module is tested firstLowest modules are tested first
Stimulates the lower level of componentsStimulates the higher level of components
Dummy program of lower level componentsDummy program for Higher level component

Change is the only constant in this world, so we have another approach called “Sandwich testing” which combines the features of both top-down and bottom-up approaches. When we test huge programs like operating systems, we have to have some more techniques that are efficient and boost confidence.

Sandwich testing plays a very important role here, where both the top-down and bottom-up testing start simultaneously.

Integration starts with the middle layer and moves simultaneously towards up and down. With our figure, our testing will start from B1 and B2, where one arm will test the upper module A and the other arm will test the lower modules B1C1, B1C2 & B2C1, B2C2.

Since both approach starts simultaneously, this technique is complex and requires more people along with specific skill sets, thus adding to the cost.

GUI Application Integration Test

Let’s now discuss how the Blackbox technique can be used to suggest integration testing.

A web application is a multi-tier application, as we are all aware. The user is able to view our front end. The database is the back layer, followed by a middle layer with business logic, another intermediate layer that performs validations, integrates third-party APIs, etc.

Integration Testing Example

Check out the example below:

I am the owner of an advertising company, and I post ads on different websites. At the end of the month, I want to see how many people saw my ads and how many people clicked on my ads. I need a report for my ads to be displayed and I charge accordingly to my clients.

GenNext software developed this product for me and below is the architecture:

Integration 2

UI module, which is visible to the end user, is where all the inputs are given.
BL is the Business Logic module, which has all the calculations and business-specific methods.
VAL is the Validation module, which has all the validations of the correctness of the input.
CNT is the content module that has all the static contents, specific to the inputs entered by the user. These contents are displayed in the reports.
EN is the Engine module, this module reads all the data that comes from the BL, VAL, and CNT modules, extracts the SQL query, and triggers it to the database.
Scheduler is a module that schedules all the reports based on the user selection (monthly, quarterly, semiannually & annually)
DB is the Database.

Now, having seen the architecture of the entire web application, as a single unit, Integration testing, in this case, will focus on the flow of data between the modules.

The questions here are:

  1. How will the BL, VAL, and CNT module read and interpret all the data entered into the UI module?
  2. Is BL, VAL, and CNT modules receiving the correct data from UI?
  3. In which format the data from BL, VAL, and CNT is transferred to the EQ module?
  4. How will the EQ read the data and extract the query?
  5. Is the query extracted correctly?
  6. Is the Scheduler getting the correct data for reports?
  7. Is the result set received by the EN, from the database is correct and as expected?
  8. Is EN able to send the response back to the BL, VAL, and CNT modules?
  9. Is the UI module able to read the data and display it appropriately to the interface?

In the real world, the communication of data is done in an XML format. So whatever data the user enters in the UI, it gets converted into an XML format.

In our scenario, the data entered in the UI module gets converted into an XML file which is interpreted by the 3 modules BL, VAL, and CNT. The EN module reads the resultant XML file generated by the 3 modules, and extracts the SQL from it and queries into the database.

The EN module also receives the result set, converts it into an XML file, and returns it to the UI module, which converts the results in a user-readable form and displays it.

In the middle, we have the scheduler module, which receives the result set from the EN module, creates and schedules the reports.

So where does integration testing come into the picture?

Your integration testing, which in this case would be evaluating the XML files, will determine whether or not the information/data is flowing appropriately. Are the created XML files accurate? Are they using the right data? Are the data transfers between modules occurring correctly? Integration testing will include testing these items.

Try creating or obtaining the XML files, updating the tags, and observing the behavior. Although this is a significant departure from the typical testing that testers perform, it will improve their application expertise and comprehension.

A few other sample test conditions can be:

  1. Are the menu options generating the correct window?
  2. Are the windows able to invoke the window under test?
  3. For every window, identify the function that calls for the window that the application should allow.
  4. Identify all calls from the window to other features that the application should allow.
  5. Identify reversible calls: closing a called window should return to the calling window.
  6. Identify irreversible calls: calling windows closes before the called window appears.
  7. Test the different ways of executing calls to another window e.g. – menus, buttons, keywords.

Steps to Kick Off Integration Tests

  1. Understand the architecture of your application.
  2. Identify the modules.
  3. Understand what each module does.
  4. Understand how the data is transferred from one module to another.
  5. Understand how the data is entered and received into the system (entry point and exit point of the application).
  6. Segregate the application to suit your testing needs.
  7. Identify and create the test conditions.
  8. Take one condition at a time and write down the test cases.

Entry/Exit Criteria for Integration Testing

Entry Criteria:

  1. Integration test plan document is signed off and approved.
  2. Integration test cases have been prepared.
  3. Test data has been created.
  4. Unit testing of developed modules/Components is complete.
  5. All the critical and high-priority defects are closed.
  6. The test environment is set up for integration.

Exit Criteria:

  1. All integration test cases have been executed.
  2. No critical and Priority P1 & P2 defects are opened.
  3. Test Report has been prepared.

Integration Test Cases

Integration test cases focus mainly on the interface between the modules, integrated links, and data transfer between the modules as modules/components that are already unit tested, i.e. the functionality and other testing aspects have already been covered.

So, the main idea is to test if integrating two working modules works as expected when integrated.

For example, Integration Test cases for LinkedIn applications will include:

  1. Verifying the interface link between the login page and the home page, i.e. when a user enters the credentials and logs, it should be directed to the homepage.
  2. Verifying the interface link between the home page and the profile page, i.e. profile page, should open up.
  3. Verify the interface link between the network page and your connection pages, i.e. clicking the accept button on Invitations of the network page should show the accepted invitation on your connection page once clicked.
  4. Verify the interface link between the Notification pages and the Say Congrats button, i.e. clicking the Say Congrats button should direct toward the new message window.

Many integration test cases can be written for this specific site. The above four points are just an example to understand what integration test cases are included in testing.

Is Integration a White box or Black box Technique

There are two types of integration testing methods: black box and white box methods.While a white box technique necessitates inside knowledge of the application, a blackbox technique does not require any internal knowledge of the system, such as coding knowledge.

When conducting integration testing, it may involve testing the two integrated web services that will retrieve data from the database and deliver it as needed. In this case, the white box testing technique may be used, while the black box technique may be used to test the integration of a new feature into the website.

Therefore, whether integration testing is a black box or white box technique is not specified.

Integration Testing Tools

There are several tools available for this testing.

Below is a list of tools:

  • Rational Integration Tester
  • Protractor
  • Steam
  • TESSY

For more details on the above tools, check this tutorial:

Top 10 Integration Testing Tools to Write Integration Tests

https://www.softwaretestinghelp.com/integration-testing-tools/embed/#?secret=aSoxbdYJib#?secret=eoQjp43iDn

System Integration Testing

System Integration Test is done to test the complete integrated system.

The team tests modules or components individually in unit testing before integrating them. Once all the modules undergo testing, the team integrates them and performs system integration testing to test the system as a whole.

Difference Between Integration Testing and System Testing

One or two unit-tested modules are combined to test as part of integration testing, which verifies whether or not the combined modules function as intended.

System testing involves testing the system as a whole, that is, integrating all of the modules or components to ensure that everything functions as it should and that there are no problems as a result of the integrated modules.

Conclusion

Integration testing and its use in both white box and black box methodologies were the main topics of discussion. I hope we were able to clearly explain it using pertinent instances.

In the testing cycle, test integration is important since it aids in identifying flaws in the merging of modules. Early defect detection saves money and time. This ensures the integrated modules are operating properly.

YOU MAY BE INTERESTED IN

The Art of Software Testing: Beyond the Basics

Automation testing course in Pune

Automation testing in selenium

Mastering Software Testing: A Comprehensive Syllabus

Scroll to Top