Updated: Jan 25, 2022
The software lifecycle is dynamic, especially in an Agile environment where changes are frequent and welcome. From a customer perspective, this approach of frequent changes is awesome as it means they gain the most from the development efforts. However, from an engineering perspective, changes mean that there will be code modifications that add risk to the overall development effort.
To ensure that such changes do not harm the development effort and reduce the percentage of unseen bugs, the team must invest in regression testing to ensure that functionality that already worked will still work after this code change.
When to use regression tests?
Use regression tests whenever there is a risk that the code already tested may be affected; the risk could come from different modifications, for example:
New features added to an application.
Bug fixes that may influence nearby code.
New requirements added.
New patches or updates.
Regression test Flow
Step 1: Understand the impact of the change
This step is critical; you cannot create good regression tests if you skip them. Here are a few questions you should answer:
How does this change affect other components not directly relevant to the change?
How does the change affect the test data of the original code’s tests?
How does this change affect existing tests for the original code?
How does this change affect the software’s documentation?
How does this change affect the current automation flow?
How does the new feature combine with the current code?
Which areas are most affected by the change?
Step 2: Determine the test strategy
Like any other testing, you cannot run regression tests forever. Therefore, it is essential to understand what was changed and the risks associated with it, so you can choose which of the following strategies is the best fit:
Test the entire code – This strategy is best when you have time, money and highly effective automation frameworks that allow you to run the whole test suite at any given time.
Test based on risk – By following this strategy, the team concentrates on areas most likely affected by the change and runs specific tests in these areas without running the entire test suite.
Step 3: Choosing the execution technique
The execution of regression tests can be done in three different ways:
Manual execution – There is no place for manual regression testing in the Agile environment. However, the team still has not built the automated tests in some cases, so manual effort is still needed.
Automated Tests – The most suitable technique for handling regression testing in the Agile environment.
Automation and Manual testing – A combination of the previous execution types and sometimes the right solution. There is a critical test that cannot be automated in some cases but still needs to be tested again.
Step 4: Analysis of the execution results
To gain the most from the regression process and to be able to improve it, the team must analyze the execution results and adjust the test to increase its effectiveness.