In this post, we will deep dive into a vital integration testing technique, known as Incremental Testing.
Upon completing this segment, readers should have an in-depth comprehension of the ensuing aspects:
Recommended IPTV Service Providers
- IPTVGREAT – Rating 4.8/5 ( 600+ Reviews )
- IPTVRESALE – Rating 5/5 ( 200+ Reviews )
- IPTVGANG – Rating 4.7/5 ( 1200+ Reviews )
- IPTVUNLOCK – Rating 5/5 ( 65 Reviews )
- IPTVFOLLOW -Rating 5/5 ( 48 Reviews )
- IPTVTOPS – Rating 5/5 ( 43 Reviews )
- The concept of Incremental Testing
- Purposes of Incremental Testing
- Various approaches
- Pros and Cons of Incremental Testing
Content Outline:
Understanding Incremental Testing
Incremental Testing, often termed as Incremental Integration Testing, is an approach to integration testing that leverages basic integration testing principles.
The process incorporates testing each module separately during the unit testing phase, subsequently incrementally integrating and examining these modules for ensuring smooth interactions and interfaces amongst them.
Contrasting traditional integration testing where all modules are integrated simultaneously, incremental testing is characterized by a step-wise integration of modules to construct the required application. Each group of integrated modules is tested for confirming successful integration and data flow.
The primary objective of incremental testing, similar to integration testing, is to validate the interface, integrated connections, and the flow of information between different modules. This procedure is reiterated until every module has been successfully integrated and tested.
An Illustration
To comprehend this concept better, let’s consider an example:
A software application or a system consists of the following modules:
Approach to Incremental Integration Testing
- Individual modules (M1, M2, M3, and so on) are separately tested during the unit testing phase.
- Modules are combined incrementally and examined for successful interaction.
- In Fig 2, Modules M1 and M2 are joined and tested.
- In Fig 3, Module M3 is added for testing.
- In Fig 4, Module M4 is included and tested to confirm successful interaction.
- The remaining modules are incrementally integrated and tested for correct interaction at each stage.
Fig 2
Fig 3
Fig 4
Purpose of Incremental Testing
- To guarantee successful interaction between different modules after integration
- To detect defects during early development stages, enabling efficient identification and resolution of issues by developers
- To reduce rework and costs by addressing issues early in the development process
Techniques of Incremental Integration Testing
Before we get into the diverse approaches of incremental integration testing, it’d be helpful to briefly understand the notions of ‘stubs’ and ‘drivers’ as these terms will be frequently referred to.
Stubs and drivers are pseudo codes or false codes utilized in integration or component testing to simulate the behavior of modules that have not been developed yet.
In top-down testing, stubs function as “called programs” and replicate the interactions between lower-level modules that have not been developed or are unavailable.
In bottom-up testing, drivers function as “calling programs” and simulate the interaction between top-level modules that have not been developed or are unavailable.
The reasons for using stubs and drivers instead of waiting for all modules to be completed before testing begin are simple: waiting until all modules are developed increases project execution time and makes defect root analysis difficult. This approach is recognized as Big-Bang Integration Testing.
Now, let’s delve into the various approaches of Incremental Integration Testing:
#1) Top-Down Method
In the top-down method, testing starts from the top level of the application’s architecture and gradually moves down to the sub-modules. The modules that constitute the top level are tested initially.
This approach follows the structural flow of the application under test. When certain modules or components are unavailable or haven’t been developed, stubs are used as replacements.
Let’s explain this method with an example:
- Module: Website Login (L)
- Module: Order (O)
- Module Order Summary (OS) [Yet to be developed]
- Module: Payment (P)
- Module Cash Payment (CP)
- Module Debit/Credit Payment (DP) [Yet to be developed]
- Module Wallet Payment (WP) [Yet to be developed]
- Module: Reporting (R) [Yet to be developed]
Top-Down Approach in Incremental Integration Testing
The following test cases can be deduced:
Test Case 1: Integration and testing of Module L and Module O
Test Case 2: Integration and testing of Module L, O, and P
Test Case 3: Integration and testing of Module L, O, P, and R
Similar test cases can be deduced for the “depth-first” approach:
Test Case 1: Integration and testing of Module L and Module O
Test Case 2: Integration and testing of Module L, O, and OS
Test Case 3: Integration and testing of Module L, O, OS, and P
Test Case 4: Integration and testing of Module L, O, OS, P, and CP
And so on for other test cases.
Benefits of Top-Down Approach
- Identification of architectural defects early on
- Early comprehension of the application’s holistic functionality, leading to early detection of design issues
- Preliminary testing of crucial control points within the application
Drawbacks of Top-Down Approach
- Key modules are only tested later in the cycle
- Formulating test conditions can be challenging
- Stubs may not entirely mimic the behavior of the connected module, as they only simulate data flow between modules
#2) Bottom-Up Method
In the bottom-up method, testing initiates from the bottom layer, moving up towards the top, with the integration and examination of modules from the bottom-up first. Drivers are used to replace undeveloped or unavailable modules.
Let’s look at the following example for better comprehension:
Modules Rank, Marks, Percentage, and Sports Grade haven’t been developed yet, so they’ll be replaced by corresponding drivers:
Approach to Bottom-Up Incremental Integration Testing
The following test cases can be deduced:
Test Case 1: Unit testing of Module Practical and Theory
Test Case 2: Integration and testing of Modules Marks, Practical, and Theory
Test Case 3: Integration and testing of Modules Percentage, Marks, Practical, and Theory
Test Case 4: Unit testing of Module Sports Grade
Test Case 5: Integration and testing of Modules Rank, Sports Grade, Percentage, Marks, Practical, and Theory
Benefits of Bottom-Up Approach
- This approach is quite beneficial for applications following a bottom-up design model
- Defining test conditions is simpler in the bottom-up method
- The critical modules or functionalities at the bottom level are tested early on, aiding in early error detection
- Early spotting of interface defects
Drawbacks of Bottom-Up Approach
- Creating drivers is more complex compared to formulating stubs
- Design defects are only identified later during the cycle
- The final working application is not available until every module has been built
- Drivers do not completely mimic the behavior of the connected module as they simply simulate data flow among modules
#3) Sandwich Testing
Sandwich Testing is a hybrid practice that merges top-down and bottom-up methods. It employs stubs and drivers for incomplete or underdeveloped modules.
Testing Strategy
- A target layer, also referred to as the middle layer, is identified for sandwich testing. This layer facilitates minimal usage of stubs and drivers.
- The top-down and bottom-up testing methods initiate from the target layer and move toward the top and bottom layers, respectively.
- Stubs and drivers are employed to test the user interface and functions of lower-level modules.
- Finally, only the middle layer remains for the final test execution.
Example:
Following are the test cases that can be deduced using the Sandwich Testing technique:
Test Case 1: Individually test A, X, Y, and Z – Test A falls under the top-level test, while Tests X, Y, and Z fall under the bottom-level tests
Test Case 2: Test A, G, H, and I
Test Case 3: Test G, X, and Y
Test Case 4: Test H and Z
Test Case 5: Test A, G, H, I, X, Y, and Z
Benefits of Sandwich Testing Approach
- Effective for large-scale projects with multiple sub-projects
- Top-down and bottom-up testing methods can be implemented simultaneously
Drawbacks of Sandwich Testing Approach
- Subsystem and interface testing are not thoroughly conducted before module consolidation
- Costlier due to the combination of both top-down and bottom-up testing methods
- Not advisable for systems having highly reliant modules
Wrapping Up
Incremental Testing is a subset of integration testing. It includes the integration testing of individual modules during the unit testing phase, followed by a step-wise integration and examination of modules as a group.
The choice of Incremental Testing methodology can be dictated by the structure of the application and the importance of specific modules.
All three incremental testing methodologies fall under the horizontal category due to the following behavioral characteristics:
- All three methodologies focus on layer testing.
- All of them consider a structural or hierarchical design.
- All of them involve incremental integration at different layers.
Pros:
Incremental testing enables early defect identification and facilitates developers in determining the cause of problems. It’s an effective and precise testing technique that leverages the basics of structured testing.
Cons:
This testing can be time-consuming because of the use of stubs and drivers. It may also be noticeably repetitive.
Author: This informative tutorial was curated by Neha B., a Lead Quality Analyst with an ISTQB certification and over 8 years of experience.
Your questions and suggestions are always welcome.