App & Browser Testing Made Easy

Give your users a seamless experience by testing on 3500+ real devices and browsers. Don't compromise with emulators and simulators

Get Started free
Home Guide What is Incremental Testing

What is Incremental Testing

By Mamta Singh, Community Contributor -

Incremental testing is a method for evaluating individual modules using stubs and drivers. It is performed during Integration testing and helps identify errors or defects within each module.

After completing unit testing, integration testing ensures that the modules interact with each other correctly. Incremental testing is key in this process, as it integrates modules with stubs and drivers.

What is Incremental Testing?

Incremental testing is an Integration testing approach. This form of testing uses stubs and drivers to check and verify different modules. The use of stubs and drivers is a method of incremental testing that integrates the modules one by one.

Stubs are simplified implementations of lower-level modules used in top-down integration testing, while drivers simulate higher-level modules in bottom-up integration testing.

Several stubs and drivers are used to test the modules consecutively and uncover bugs. Incremental testing involves testing a module, connecting it with another module, and verifying its integration. This is followed by adding another module to continue with the same steps.

Examples of Incremental Testing:

  • Identifying growth opportunities: A company might use incremental testing to identify strategy gaps or optimize a marketing campaign.
  • Launching new products: A company might use incremental testing to compare sales of a new product to a similar older model to determine if marketing efforts are driving sales.
  • Integrating software: Incremental testing can integrate software modules individually, starting with smaller pieces and working on the entire system. This approach can provide early feedback, simplify troubleshooting, and reduce complexity.

Why is Incremental Testing Important?

The many advantages of Incremental testing make it a preferred go-to approach for Integration testing.

Here are some reasons that highlight the importance of Incremental testing:

  • It helps identify issues in specific modules by conducting unit tests before proceeding to the next testing phase.
  • It helps identify bugs early in the Integration testing phase before the modules are connected. This saves time and resources.
  • It ensures all modules are successfully connected and are functioning efficienctly post integration.
  • It has the benefits of flexibility and cost-effectiveness from a business point of view.
  • The customer can provide feedback on each module as it is developed.

When to Perform Incremental Testing

Software incremental testing involves interlinking each component individually rather than combining them all at once. This is performed only if all the defects detected at the unit testing phase have been fixed.

  • The best time to use incremental testing is when software components are still being developed.
  • The drivers and stubs can be used for any unfinished components if required during testing.

For example, if modules 2 and 3 are still under development during the testing phase of modules 1, 2, and 3. In that case, drivers can be combined with module 1 to replicate the unfinished module and continue the integration process.

Different Methodologies for Incremental Testing

There are three methods of Incremental testing. Depending on which methodology they are using, testers use stubs/drivers.

  • Top-down method
  • Bottom-up method
  • Sandwich method

Top-Down Methodology

In the top-down approach, integration starts from the top-level modules and connects lower-level modules to the top-level one after the other. Stubs are used as a substitute if any lower-level module is unavailable for testing or under development.

Stubs, also called programs, are dummy programs that replace any lower-level module in a top-down hierarchy. They are as higher-level modules call them to check the interface and integration.

Let us consider some modules for integration:

  • Module Log: Log-in page for users to log into the application/website
  • Module FPP: Forgot password option present on the log-in page
  • Module PLP: The product list page
  • Module PDP: The product description page
  • Module Cart: Shopping cart on PDP page
  • Module Pay: Payment option on PDP page

For example,

If you have already checked the Log module and need to integrate it with the FPP module, but FPP is still under development, a stub can be used to replace FPP. In this case, the integration hierarchy will go down with Log, PLP, and PDP modules. If any other lower-level modules are missing, they can also be replaced by stubs.

Pros of Top-Down Methodology

  • With the top-down approach, you can identify higher-level defects quickly,
  • It is easy to discover interface errors sequentially as you go testing and integrating the modules incrementally.

Cons of Top-Down Methodology

  • Stubs do not accurately mimic the replaced modules.
  • The modules with major/important functionalities coming in the bottom level will not be able to highlight functionality issues.

BrowserStack Automate Banner

Bottom Up Methodology

The bottom-up method of Incremental Testing moves in an upward manner. In this method, the lower-level modules are tested first and integrated with higher-level modules.

This is the right approach when bottom-level subsystems are test-ready.

In this case, stubs are not required because the lower-level modules are already running. However, if higher-level subsystems are not ready for testing and integration, drivers (called calling programs) replace them.

For example,

In the bottom-up approach, the testing will begin with the Pay and Cart modules. Once tested, they are integrated with the PDP module. After this, PDP is tested with PLP, and the process is repeated until all modules are integrated, ending with the Log module—the highest-level subsystem in the application.

As shown in the example, any missing top-level modules can be replaced with drivers such as PDP and PLP.

This is the integration and testing sequence:

  • Unit test module Cart and Pay
  • Integrate and test PDP-Cart-Pay
  • Integrate and test PLP-PDP-Cart-Pay
  • Unit test module FPP
  • Integrate and test Log-FPP-PLP-PDP-Cart-Pay

Pros of Bottom-Up Methodology

  • A bottom-up approach can help you test and integrate critical application functionalities at an early stage.
  • Creation of test conditions like transactions and functions, is also easier in the bottom-up method.

Cons of Bottom-Up Methodology

  • Writing drivers takes more time.
  • It is more complex than stubs.
  • The complete integration and testing process takes more time.

Sandwich Testing Methodology

Sandwich testing methodology combines top-down and bottom-up testing approaches.

It is also known as hybrid integration testing.

In sandwich testing, there are three distinct layers involved:

  1. Main target layer – the core layer being tested.
  2. Layer above the target – the higher-level interface or module.
  3. Layer below the target – the lower-level functions or modules.

The process starts by testing the user interface (top layer) using stubs, which simulate the middle and lower layers. Next, the lowest-level functions (bottom layer) are tested using drivers, which mimic the upper layers. Finally, once all layers are integrated, the main target (middle layer) is tested as part of the whole system, ensuring proper interaction between all layers.

Pros of Sandwich Testing Methodology

  • Sandwich testing is useful when we have multiple layers with several modules.
  • We can use this approach to run top-down and bottom-up testing methodologies in parallel.

Cons of Sandwich Testing Methodology

  • It requires a higher budget.
  • Testing is not accurate if modules are hugely dependent on each other.

Automating Incremental Testing

Automating incremental testing is beneficial because it enables faster feedback loops, early bug detection, and improved software quality. It allows small, incremental pieces of functionality to be tested, which also allows for quicker identification and resolution of issues.

List of scenarios where you can automate Incremental testing:

  • Automation will be helpful when you need to test multiple modules multiple times
  • It will also be useful when regression testing needs to be performed to test all features
  • Manual effort will be less if script is ready for modules.

Key Benefits of Automating Incremental Testing:

  • Issues can be caught early in the development cycle, making them easier to fix.
  • Testing can be performed on multiple platforms in parallel.
  • Reusability of the test script will be helpful to optimize time.
  • Maximum test coverage can be achieved for the entire application.

Try BrowserStack Now

Limitations of Incremental Testing

  • It requires good planning and designing
  • Complexity will increase.
  • It is costlier than the waterfall model.
  • Application requirements should be clear and complete.
  • Not guaranteed for absolute correctness for testing.

Best Practices for Incremental Testing

  • Prioritize critical features: To identify critical issues early, focus on testing the most important functionalities first in each incremental build.
  • Small, focused test suites: Break down test cases into smaller, manageable units that target specific features or functionalities for efficient execution.
  • Automate regression tests: Leverage automation frameworks to automatically re-run tests on existing features after each incremental change to ensure no regressions are introduced.
  • Usage of CI/CD pipeline: Integrate incremental tests in CI/CD pipeline for any failure detection.
  • Multiple browser and devices parallel testing: Utilize BrowserStack’s cloud-based platform to run parallel tests on multiple browsers and devices.
  • Visual regression testing tool: Use visual regression testing tools, such as BrowserStack Percy, to detect visual changes in the UI.
  • Data-driven testing: Data-driven approach will be helpful to run tests with different data sets to cover different scenarios.

Incorporating any testing practices is faster and easier to execute on a real device cloud. BrowserStack offers a real device cloud platform where you can access over 35000+ different devices, browsers, and OS combinations.

Test results can vary between the development environment and real user conditions, making it essential to test on real devices for accurate outcomes. This approach guarantees a smooth and consistent user experience across diverse device-browser-OS combinations in real-world situations, optimizing time efficiency and maximizing test coverage.

Talk to an Expert

Frequently Asked Questions

1. What is incremental and non-incremental integration testing?

Incremental integration testing involves integrating and testing software modules one by one, gradually building up the system, while non-incremental integration testing, like the “Big Bang” approach, combines all modules at once for testing.

2. What are two types of incremental integration testing?

The two main types of incremental integration testing are “top-down” and “bottom-up,” where top-down starts from the highest level modules and works downwards, while bottom-up starts from the lowest level modules and works upwards.

Tags
Automation Testing Types of Testing Website Testing

Featured Articles

What is Integration Testing

What is System Integration Testing

Seamless Software Testing with BrowserStack

Test on 3500+ real devices and browsers for accurate testing. Don't compromise with emulators and simulators