Regression testing is a software testing practice that ensures an application still functions as expected after any code changes, updates, or improvements.
Whenever developers change or modify their software, even a small tweak can have unexpected consequences. Regression testing is testing existing software applications to make sure that a change or addition hasn’t broken any existing functionality. Its purpose is to catch bugs that may have been accidentally introduced into a new build or release candidate, and to ensure that previously eradicated bugs continue to stay dead.
By re-running testing scenarios that were originally scripted when known problems were first fixed, you can make sure that any new changes to an application haven’t resulted in a regression, or caused components that formerly worked to fail. Such tests can be performed manually on small projects, but in most cases repeating a suite of tests each time an update is made is too time-consuming and complicated to consider, so an automated testing tool is typically required.
Types Of Regression Testing
Unit Regression is done during the Unit Testing phase and code is tested in isolation i.e. any dependencies on the unit to be tested are blocked so that the unit can be tested individually without any discrepancy.
Partial Regression is done to verify that the code works fine even when the changes have been done in the code and that unit is integrated with the unchanged or already existing code.
Complete Regression is done when a change in the code is done on a number of modules and also if the change impact of a change in any other module is uncertain. The product as a whole is regressed to check any changes because of the changed code.
When to perform regression testing
- A new requirement is added to an existing feature
- A new feature or functionality is added
- The codebase is fixed to solve defects
- The source code is optimised to improve performance
- Patch fixes are added
- Changes in configuration
Regression Testing Techniques
Regression testing has three most prominent implementation methods, including re-test all, regression test selection and test case prioritizations.
In this technique, regression testing is applied to all existing test suites. Although it is the safest way to ensure all bugs are detected and resolved, this method requires substantial time and resources.
That is why the complete regression approach fits better in certain contexts — for example, when the application is adjusted for a new platform or language, or when the operating system gets a major update.
Regression Test Selection
You may select the relevant parts that can be affected by the changes and perform regression testing on these chosen parts only. By picking out the related areas, you can apply limited and relevant test cases to reduce both the time and effort invested in regression testing.
Test Case Prioritization
You may choose to prioritize test cases that must be included and performed first in the regression testing process. These test cases should be prioritized based on these criteria: failure rate, business impact, and gradually used functionalities.
The test cases that relate to customer-facing aspects and newly added functionalities are of high priority as well.
Techniques for the selection of Test cases for Regression Testing:
Select all test cases:
In this technique, all the test cases are selected from the already existing test suite. It is the most simple and safest technique but not much efficient.
Select test cases randomly:
In this technique, test cases are selected randomly from the existing test-suite but it is only useful if all the test cases are equally good in their fault detection capability which is very rare. Hence, it is not used in most of the cases.
Select modification traversing test cases:
In this technique, only those test cases are selected which covers and tests the modified portions of the source code the parts which are affected by these modifications.
Select higher priority test cases:
In this technique, priority codes are assigned to each test case of the test suite based upon their bug detection capability, customer requirements, etc. After assigning the priority codes, test cases with highest priorities are selected for the process of regression testing
Advantages of Regression Testing:
- It ensures that no new bugs has been introduced after adding new functionalities to the system.
- As most of the test cases used in Regression Testing are selected from the existing test suite and we already know their expected outputs. Hence, it can be easily automated by the automated tools.
- It helps to maintain the quality of the source code
Disadvantages of Regression Testing:
- It can be time and resource consuming if automated tools are not used.
- It is required even after very small changes in the code.
Regression testing tools
An IT team can use a tool or platform to execute and optimize regression tests. A test management tool helps testers apply script automation, as well as trigger smoke and regression tests. In most cases, a regression testing tool leaves some level of manual test work for QA.
The regression testing tool market includes options with support for different programming languages which provides support of integration with CI/CD.
Open source regression testing options include Watir, Sahi and Selenium, TestComplete, Tesbo and Ranorex Studio. Tesbo is a front-end and functional testing platform, which could be work as GUI test automation framework. Each product integrates with a variety of CI systems. With the help of Tesbo, software testers can automate the complex regression test cases with minimal coding.