What is an integration test? Definition, types and examples

By Indeed Editorial Team

Published 3 January 2022

The Indeed Editorial Team comprises a diverse and talented team of writers, researchers and subject matter experts equipped with Indeed's data and insights to deliver useful tips to help guide your career journey.

If you commonly work with computer software, then you may frequently use integration tests as part of your role. An integration test involves testing different modules and linked aspects of a software program as a group. Integration testing is an important part of testing products, as it allows you to find defects and errors in particular modules when they combine with other modules. In this article, we discuss what is an integration test, the different types of integration test, how to conduct them and how they link to other software tests.

What is an integration test?

If you're interested in the process of testing different module units of a software or program collectively, you may want to know the answer to the question, 'What is an integration test?' It involves combining the different elements to see how they interact, behave and communicate with each other. This way, developers can see if the different modules of the program work logistically together and they can also determine if there are any bugs or errors when the different modules combine together. Users sometimes also refer to integration testing as I&T (integration and testing), string testing or thread testing.

There are many ways in which specific modules or units can suffer defects during integration testing. For instance, an individual software developer may have designed one aspect of the program, thus not knowing how it may fit with the other aspects. Minor changes to particular modules and designs may change due to the desires of clients. Some module combinations may simply not be compatible and report frequent errors. Therefore, integration testing is a necessary element of software development, as it allows developers to create fully integrated systems.

Related: How to become a software architect: definition and steps

Different types of integration tests

Here is a list of the different types of integration tests:

Big bang testing

In the 'big bang' version of integration testing, developers combine all the individual components of software and test them at once. During the testing process, combining these components and modules is called an entity. The 'big bang' integration test relies on each module being complete, otherwise, the testing of the entity may not work. When conducting an integration test using the 'big bang' method, developers require minor planning and test the whole system at once, hence it may be an easy method. It may be easier to carry out 'big bang' integration testing on smaller systems.

Incremental testing

You can perceive the incremental approach to be the opposite of the 'big bang' method of integration testing. Whereas the 'big bang' approach tests all of the modules collectively, incremental testing involves testing modules one-by-one, adding a new module to test once the developers have completed testing of the previous combination. Once they have combined all of the individual modules, then they can test the whole integrated system.

In incremental testing, users are typically better able to identify where errors are originating from, beneficial if they are testing a large system. On the contrary, it can be a time-consuming process and developers may use stubs in place of incomplete modules. There are three different types of incremental testing that developers may typically use:

Top-down testing

The first type of incremental testing is the top-down method. As the name suggests, this method of incremental integration testing starts at the top and works its way down to the sub-modules. Developers begin by testing the two higher-level units, before adding each of the lower-level units one at a time until they have integrated all of the units. The advantage of using top-down integration testing is that it tests the main controls and aspects of a system first, prioritising the most important elements. It also is easier to identify where defects arise from.

Bottom-up testing

Bottom-up incremental testing is the reverse of top-down testing, where developers test the lower-level modules of a system first. Developers add the main, core modules at the end of bottom-up testing, after they have integrated the typically smaller units. Again, they add individual modules one at a time in an incremental manner. The advantages of bottom-up testing are similar to those of top-down testing. It is easier to identify the location of faults and defects and often developers can detect faults with interface modules earlier on. Disadvantages include not detecting design issues until later in the process.

Sandwich testing

Another form of incremental testing within integration tests is the 'sandwich' testing method. 'Sandwich' testing involves using both top-down and bottom-up testing on a system. Developers tend to begin with a layer in the middle of the system, which they call a 'target layer', on which they conduct top-down testing on the lower level units, and bottom-up testing on the higher-level units. Similarly to the individual bottom-up and top-down methods, 'sandwich' testing adds one module at a time for easy localisation of errors. It can be very useful when testing complicated systems with many sub-categories.

Stubs/drivers

Stubs and drivers are not methods of integration test, but are common concepts that developers use when conducting various integration tests. Developers use these as substitutes for units and modules that they are yet to complete when conducting an integration test and stubs and drivers may simulate the communication of a module. They may use stubs more commonly in top-down testing, whilst using drivers in bottom-up testing. Stubs and drivers are beneficial as they allow developers to conduct integration tests on systems where they haven't finished developing individual units. Stubs and drivers can be time consuming for developers to create.

Related: 10 essential web developer skills

How to conduct an integration test

Once you've incorporated integration tests into your everyday role, you may follow a set of detailed instructions on how to integration test correctly. Follow the steps below to conduct an integration test:

  1. Write a test plan

  2. Decide which integration test method to use

  3. Design test scenarios, cases and scripts

  4. Begin the integration tests on the chosen modules

  5. Detect, track and fix errors

  6. Repeat by adding more modules if necessary until the system is complete

Example - Mailbox software

Here is an example of conducting an integration test for a new mailbox software:

  1. Developers compose different modules, including login page, inbox, default folders and move and flag functions.

  2. They choose to conduct the top-down incremental method.

  3. They write the scenarios that they wish for each module to communicate with each other. For instance, when a user correctly inputs their login credentials, they want to direct the user instantly to their inbox.

  4. They start by testing just the login page and the inbox folder, as these are the higher-level modules.

  5. During testing, they find that after logging in, users see their oldest messages first. They run tests to fix this so that the most recent messages are at the top.

  6. Once they have fixed the particular issue, they repeat steps 4 and 5 by incrementally adding lower-level units until they have integrated the entire system without faults.

Different levels of testing

Integration testing forms an important part of the entire software testing process. It is the second of four levels of dynamic testing of software, the others being unit, system and acceptance testing. Here are the three other levels of software testing:

Unit testing

The first level of software testing is unit testing. It comes directly before your choice of integration testing, whereby developers individually test each of the components and modules individually. They run automated tests to ensure that there are no errors when modules perform on their own before testing alongside other modules.

Related: 6 essential software engineer skills

System testing

System testing comes directly after the integration test. It is where developers or quality analysts test the entire system as a whole, with all the integrated components that they tested in the previous stage. It is an important stage as issues can still arise when developers test the entire system.

Acceptance testing

The final level of the software testing process is the acceptance testing phase. A vital stage during the final stages of the testing, stakeholders or clients now test the application and its usability to see if it meets all of their business needs. Acceptance testing may come in the form of alpha or beta testing, or 'a/b' testing.

Explore more articles