CSE 270: Software Testing - Reading Material

4.3 Integration Testing

Introduction

Integration testing is a critical phase in the software testing life cycle that focuses on evaluating the interactions and collaborations between different components within a system. It ensures that these components, which have been individually tested and verified, work together harmoniously as an integrated unit. The primary objective is to identify and rectify any defects that may arise at the points of integration, such as data flow issues, communication problems, or inconsistencies in how individual components interact.

Objectives

The primary goals of integration testing revolve around ensuring that the integrated components work seamlessly together:

Types of Integration Testing

In order to understand integration testing more fully, we need to revisit end-to-end testing. More specifically, we need to look at horizontal and vertical end-to-end testing.

X,Y Graph showing Horizontal and Vertical End-to-End Testing Examples. Along the horizontal axis: Checkout at position 0,0, Order at position (-1,0), Search and Find at (-2,0), Purchase at (2,0).  Along the Vertical Access API at (0,1), UI at (0,2), Database at (0,-1), External Systems at (0,-2)
Image Credit: https://katalon.com/resources-center/blog/end-to-end-testing-integration-testing

Horizontal End-To-End Testing

Horizontal end-to-end testing involves validating an entire end-to-end workflow through the entire system. This approach ensures that all components, regardless of their inclusion in a specific feature, collaborate seamlessly to deliver a complete and functioning user scenario.

Key Characteristics:

Vertical End-To-End Testing

Vertical end-to-end Testing is an approach that focuses on validating the interactions and functionalities across different components of the same feature within the application architecture. In this testing method, the goal is to ensure that all components work together harmoniously to achieve a specific aspect or feature of the system.

Key Characteristics:

Comparison:

Scope:

Depth vs. Breadth

Use Case Orientation

Horizontal and Vertical End-To-End Testing complement each other, ensuring a comprehensive assessment of the application. The choice between them depends on the testing goals, with horizontal testing ideal for validating specific functionalities, and vertical testing suitable for validating end-to-end user scenarios. The following sections will delve into the role of integration testing in vertical scenarios and explore various integration testing approaches

Integration Testing as part of Vertical End-to-End Testing

In Vertical End-To-End Testing, integration testing plays a big role in ensuring that individual components seamlessly interact to fulfill the requirements of a complete end-to-end scenario. The integration testing phase verifies that the interactions between components, whether at the same hierarchical level or different levels, contribute to the overall success of the user journey.

Key Aspects:

Data Flow Assurance

Integration testing in Vertical End-To-End scenarios places a particular emphasis on data flow, aiming to guarantee that data moves seamlessly between components. This involves:

Integration testing acts as a linchpin in Vertical End-To-End Testing, verifying that components collaborate effectively and contribute to a seamless end user experience. The meticulous examination of component interactions and data flow ensures that the integrated system aligns with the intended functionality, providing a comprehensive validation of the software's capabilities. The subsequent sections will delve into different approaches to integration testing, including the top-down, bottom-up, and hybrid approaches.

Note: The terms stub, driver and mock which are an important part of automated integration testing will be defined and explained in more detail in Unit 6 - Automation Engineering

Integration Testing Approaches

Integration testing is an important phase that ensures the seamless collaboration of individual components to form a robust and functioning system. Various approaches to integration testing are employed based on how components are integrated and tested. This section explores three prominent approaches: the Top-Down approach, the Bottom-Up approach, and the Hybrid approach.

Top-Down Approach

The Top-Down approach involves testing the higher-level modules or components first and gradually moving down the hierarchy. In this method, testing begins with the main control module such as a user interface or the top-level module, and the testing process proceeds by integrating and testing the lower-level modules step by step.

Key Characteristics:

Advantages:

Bottom-Up Approach

The Bottom-Up approach is the opposite of the Top-Down approach. Testing starts with the lower-level modules, and integration proceeds upward. The focus is on validating and testing the foundational components first, and progressively incorporating higher-level modules in subsequent stages.

Key Characteristics:

Advantages:

Hybrid or Sandwich Approach

The Hybrid or Sandwich approach combines elements of both the Top-Down and Bottom-Up approaches. It aims to leverage the strengths of both methodologies, providing a more balanced and comprehensive testing strategy.

Key Characteristics:

Advantages:

The choice of approach depends on factors such as system architecture, project timelines, and the criticality of specific components. Understanding the strengths and characteristics of each approach allows testing teams to tailor their strategies to the unique requirements of the software under test.

API Testing Tools

API testing tools are specifically designed for testing Application Programming Interfaces (APIs), which play a vital role in the interaction between software components. Here are some examples:

API testing tools validate the communication between different components through APIs. They also ensure that data exchanged between components via APIs is accurate and conforms to specifications.