What is Integration Testing? – Some basic principles

Software Testing is an integral phase of the Software Development Life Cycle. It helps determine the quality, correctness, and performance of the application. What is integration testing? Integration testing takes place after unit or component testing but before system or end to end testing.

During unit testing, a unit or module is tested to confirm that each component performs correctly as per the specification. Features might work flawlessly on their own, but problems can arise when interacting with other components. For this reason, integration testing comes into the picture because it is a phase in software testing where individual software modules are combined and tested as a group.

Is Integration Testing really necessary?

Developers release code for testing after they have performed an intensive unit test and have fixed any identified defects. If each component has already been tested, then why do we need integration testing?

A Software application is generally broken into different modules or areas, and these are worked upon by other developers. Sometimes third-party integration is involved as well. Testing a unit or a component is just one part of the overall software application testing. No matter how well an individual module is running, the effect can be massively detrimental if all parts do not properly integrate. Failure in integration leads to software failure.

Benefits of Integration Testing

Integration testing identifies flaws related to data flows, formatting, communication, exception handling, interfaces, APIs, and the interaction between two or more systems.

  1. Maintain Code Uniformity: Different developers may follow their own choice of coding practice. Integration testing helps bring uniformity to the code.
  2. Data Integrity: Sometimes, transferring data from the source system to the destination system can lead to formatting change or other exceptions. Integration testing confirms the data is sent in the correct format as expected by the target system. It provides an opportunity to correct those errors before releasing the software for system testing.
  3. Compatibility Checks: Some modules are incompatible, so it is essential to identify the causes of such errors and have them fixed for the software program to work efficiently. Integration testing also helps in testing the hardware compatibility of the modules.

Defining your Integration Testing Strategy

Integration testing starts by defining the test integration plan, determining the approach and the testable modules, appointing the team, setting up the environment, then running the planned tests.

What is integration testing

In software, the integration scope could involve the integration between different DBs, pulling data via APIs, integrating with a third party, etc. Integration Testing uses Stubs and Drivers, which are dummy programs created as replacements for modules that aren’t ready for testing. A common problem faced by all testers is that the software components are developed at different times. The decision to use a particular type of integration testing depends on the readiness of the parts.

  1. Big Bang: In Big Bang testing, all the components are combined before testing, making it similar to testing the entire system together. This method differs from system testing, because the focus is mostly on testing the interfaces and communication between the modules. Big Bang is used rarely because if all the failures occur at once, it becomes difficult to isolate the exact problem.
  2. Bottom-up testing: This approach starts with elementary components that do not call any other parts. Drivers replace top-level components, and in this context, the need for stubs is eliminated because subordinate elements are always available.
  3. Top-down testing: Testing with this method starts with the uppermost component that calls other parts. This approach uses Stubs, which are shortcode logic statements that accept the top-level modules’ request and eventually call bottom-level modules for integration and testing.
  4. Sandwich or Hybrid testing: Both top-down and bottom-up testing is employed when using this approach.

Top-down and bottom-up integration works for strictly hierarchical systems, which they rarely are. Many applications use the Ad Hoc integration approach to integrate and test modules as and when they are ready. This is a time-saving approach that helps the component to become integrated into the environment earlier.

Conclusion

Conducting integration testing isn’t as straightforward as other test types due to the added limitations of setting up the test environment with stubs and drivers. The creation of stubs and drivers, if not done correctly, leads to unsatisfactory results. Besides, it is a time-consuming and resource-intensive process. Despite these challenges, the importance of this type of testing in the software testing industry hasn’t diminished. Organizations favor conducting integration testing since it helps in the early detection of bugs, making it a cost-effective method.

Author

Priya Rani

An Enthusiastic QA Expert who loves to share knowledge and experience through blogging.