Components that work well on their own don't always work well when integrated with each other. That's why integration testing is so necessary in your testing project.
In this article, I'll show you:
Let's dive in!
Integration testing is a type of testing in which multiple parts of a software are gradually integrated and then tested as a group.
The goal of integration testing is to check if different software components work seamlessly with each other.
Let's say that you are testing a software with 10 different modules.
Each of these modules have been unit tested. They all pass, which means they work well individually. That's a good sign. However, can we be sure that those individual parts work well together?
Conflicts can always arise. Just like how people who work well on their own may not always work well as a team.
Once those modules are integrated, things can go wrong in several ways, such as:
That's why testers must perform integration testing to cover those scenarios. Out of the 10 modules, testers can first choose and integrate 2 modules. If these modules interact smoothly, they carry on with another 2 modules, until all modules are tested.
There are 2 most common approaches to integration testing:
Big Bang Integration testing is an integration testing approach in which all modules are integrated and tested at once, as a singular entity. AKA, a Big Bang.
Big Bang integration testing is not carried out until all components have been successfully unit tested.
Advantages of Big Bang integration testing:
Disadvantages of Big Bang integration testing:
Best Practices when using Big Bang testing:
📚 Read More: Big Bang Integration Testing: A Complete Guide
Incremental integration testing is an approach in which 2 or more modules with closely related logic are grouped and tested first, then gradually move on to other groups of modules, instead of testing everything at once. The process ends when all modules have been integrated and tested.
Incremental integration testing is more strategic than Big Bang testing since it requires substantial planning beforehand.
Advantages:
Disadvantages:
You can further divide incremental integration testing into 3 smaller approaches:
But what is low-level components and high-level components? The concept of “low” vs “high” here refers to the position of the software component in the system hierarchy when you do integration testing.
If you put that in the context of an eCommerce website, it's going to look like this:
|
Aspect |
Low-Level Modules |
High-Level Modules |
|
Complexity |
Simple functionalities |
Complex, multi-functional |
|
Scope |
Focused on specific tasks |
Comprehensive functionalities |
|
Granularity |
Smaller and modular |
Larger and more integrated |
|
Examples |
|
|
With bottom-up integration testing, you start integrating modules at the lowest level, then gradually move to higher-level modules.
As you can see in this diagram, the lower level components are shirts and polo (specific types of clothes). Shirts and polos fall under the “Tops” category, which falls under the “Men's clothing” category. At the highest and most generic level, they are simply called “Clothing”.
When using the bottom-up approach for integration testing, we go from the specific modules to more comprehensive modules, or from the “shirt” module to the “clothing” module.
Here is when you should use bottom-up integration testing:
📚 Read More: Bottom-up Integration Testing: A Complete Guide
With top-down integration testing, testers start with the highest-level modules, then gradually move to lower-level modules. Here's a simple diagram to illustrate:
Here's when you should use top-down integration testing:
📚 Read More: Top-down Integration Testing: A Complete Guide
Hybrid Integration Testing is also called Sandwich Testing. It is an approach in which testers perform both top-down and bottom-up testing simultaneously.
Advantages:
Disadvantages:
If you ever wanted to create a test strategy, test pyramid is a great framework to follow.
The Test Pyramid is a popular framework to illustrate the proportion of different types of tests in a software testing strategy. The idea is to focus resources on automating tests at lower levels (unit tests and integration tests) while minimizing the more expensive E2E tests at the top.
The 3 layers of test pyramid include:
If you follow The Test Pyramid strategy, usually you'll go with a testing ratio of roughly 70-80% unit tests, 15-20% integration tests, and 5-10% end-to-end (E2E) tests.
The rationale is that:
Although these ratios are a good guideline, in actual practices, you should vary it based on your team size and resources.
Put simply:
Integration testing checks the interactions between individual components.
End-to-end testing checks the flow of an entire user journey.
The scope of end-to-end testing is bigger than that of integration testing.
Here is a simple comparison table of differences between integration testing vs. end-to-end testing for you:
|
|
End-to-End Testing |
Integration Testing |
|
Purpose |
Checks system behavior in real-world scenarios |
Checks integration between components |
|
Scope |
Broader in scope and covers the entire technology stack of the application |
Interaction between different components/modules |
|
Testing stage |
Performed at the end of the software development lifecycle before releases |
After unit testing and before end-to-end testing |
|
Technique |
Black-box testing, often uses User Acceptance Testing (UAT) |
White-box testing, often uses API testing |
📚 Read More: End-to-end testing vs Integration Testing
|
Aspect |
Unit Testing |
Integration Testing |
|
Scope |
Focuses on testing individual units of code (functions or methods). |
Focuses on testing interactions between multiple units or modules. |
|
Purpose |
Verifies that each unit of code works as intended in isolation. |
Verifies that different units or modules work together correctly. |
|
Dependencies |
Mocks or stubs external dependencies to isolate the unit being tested. |
Uses real dependencies, as it tests the integration between units. |
|
Granularity |
Tests specific functionality within a small code unit. |
Tests how different units collaborate with each other. |
|
Execution Environment |
Can be executed in a development environment or Continuous Integration (CI) system. |
Requires a more elaborate environment to host multiple units working together. |
|
Test Data |
Typically uses small datasets or mocked data to isolate the unit. |
May use larger datasets to mimic real-world scenarios for interactions. |
📚 Read More: Unit Testing vs Integration Testing: In-depth Comparison
The Katalon Platform is a powerful All-in-One platform to help QA teams plan and design test cases in 1 place without having to use any additional tools. Katalon also supports a wide range of application types, including API Testing and UI Testing to cover all of your needs.
A major pain of testers performing UI Testing is the huge number of devices and browsers to test the application on. The UI of an application may look perfectly fine on this device but is messy on another due to differences in screen sizes, resolution, or other technical specifications. Katalon allows you to stay within budget thanks to its cross-platform, cross-browser testing capabilities on cloud environments.
Katalon Platform is also built for test maintenance. When an application is updated, testers need to review if their test cases need to be adapted for the code changes. This is a daunting task that Katalon Platform can help you with thanks to its page object design model approach.
Katalon stores locators across tests in an object repository. When changes occur, locators and artifacts are already grouped together to make updates easily.