Today, we’ll learn – “What is Regression testing?”, “Why is it important?”, “What are its Pros and Cons?”, “How to select cases for Regression?”, and “How to perform Regression testing?”
Table of contents
- Introduction to Regression testing
- Summary – Regression Testing Concepts.
Introduction to Regression testing
Regression testing is an incremental validation technique for testing a product. It aims to verify that no new change in the product breaks the existing functionality during the ongoing development. Adding new test cases for each new feature makes sure the regression testing becomes successful.
The developers may not find it conducive as not only do they have to fix issues reported via regression but also maintain a sync with the QA on changes impacting the system behavior. However, it also poses a challenge for the testers too for selecting cases that are more relevant, realistic, and repetitive.
Regression testing is useful in all types of testing models. However, it is more successful in Agile testing. It can significantly reduce the testing cost in the long run if applied correctly. It is one of its one-of-a-kind testing approaches that aims to build confidence in software going through rapid changes without unintended side effects.
Since the scope of regression is going to increase, it’s not viable to do it manually. The best way is to choose an automation framework pertaining to your test requirements. And use it to create the test suite, start test case automation, and reduce manual testing efforts.
When is it useful to perform Regression testing?
We should adopt the regression testing approach in the following scenarios.
- In a product that continually requires new feature additions.
- For testing product enhancement where you want to minimize manual testing efforts.
- To validate fixes of defects reported by customers.
- When the product is expecting changes that relate to its performance.
Regression testing works best if implemented correctly. It improves the quality of the product under test and has the following benefits over traditional methods.
- Notify us of any side effects that occurred due to a fix or an enhancement in the module or application.
- Ensure that the bugs found earlier don’t re-emerge.
- Not only can it be done manually but tools are available to automate it.
- It contributes towards improving the quality of the product.
- In products with a long lifecycle, it can considerably reduce manual testing efforts with the help of automation.
Regression testing makes life easier for the testers while working on a large software project. However, it has some limitations which we can overcome with the steps mentioned in the next sections of this tutorial.
- Without automation, it is hard to manage the cost of regression testing as the testing scope grows with every new feature coming to the product.
- Automating regression requires skilled software engineers.
- Changes in old features lead to modifications in the related test cases which further require versioning.
- Testing new features requires more cases to be added which increases maintenance cost.
- It impacts the overall cost of the project budget.
- Regression tests have to run upon any small or big change taking place in the code as the smallest of modifications could bring down the existing functionality.
What are the challenges with Regression testing?
Regression testing can be tough for the testers in the following scenarios.
- The more features a product has, the more complex it is to test, and therefore the more test cases are needed.
- Executing a big regression suite takes time and sometimes turns unfeasible due to time and budget constraints.
- Running a regression test suite on a nightly basis demands a dedicated infra or systems which incur additional hardware costs.
- Optimizing a test suite for reducing execution time and achieving maximum test coverage is not at all easy.
- Full utilization of the regression testing suite is a challenge. It requires knowing when to run the suite, i.e., for every minor change, after every build, or when a bunch of bug fixes are available.
Must Read: 100+ Questions for Manual Testing Interview.
How do you select test cases for Regression testing?
You already know how critical regression testing is for delivering a quality product. And test cases are the primary elements of a regression test plan that contributes the most to making it successful. Hence, it is inevitable to select the most appropriate test cases to get the best results. So here are a few ideas for you to ponder.
1. Select test cases for features that get the most defects.
Find out the areas in your product that receive the most bugs and cause it to fail with just a small change in the code. By reviewing the weekly/monthly bug reports, it is easy for you to identify the areas leading to the maximum number of defects. First of all, you can add those defects to regression and then look to increase the test coverage of that particular area.
2. Select test cases for features that are core to the product.
Before you start designing the test cases for regression, find out the core areas of the product. So get to the requirements specs, review the product design documents, and come up with the features that are most critical to the product.
Consequently, you can proceed with the test case selection and cover the desired functionality. With the help of a traceability matrix, you can confirm the test coverage.
For example, in a web application, the regression should cover areas like login, dashboard, reports, and other core features apparent on the home page.
3. Focus on test cases for areas updated recently in the product.
In an Agile world, requirements keep on changing frequently. But most of the time, the changes occur only in parts of the product.
Once the product’s first version is ready, there could be changes as little as 20-30% due to enhancements or bug fixes.
In such cases, try focusing on the recent changes and add cases that can break the existing functionality.
4. Select test cases that cover integration testing.
However, the integration testing happens as a part of the software testing process. But some of its tests should also run along with the regression testing. It helps rule out any chances that the product could miss an important functionality because of the last-minute change.
For example, a change in the auth protocol may cause the login API to fail, and fixing an error message could lead to failure in the reporting API.
5. Select all end-to-end test cases.
Every product has some critical end-to-end business flows that require following a composite sequence of UI actions.
For example, to buy a product from an e-commerce website, first of all, a user needs to find the product from a particular category, select the product, add it to the cart, apply a coupon if available, select the payment method, supply contact/delivery details and proceed to pay.
By adding more actions in the sequence, you can increase the probability of finding a serious bug. If any of the actions stumbles from the chain, then the entire functionality could collapse. And that’s why we are advocating such complex test cases to become part of the regression testing suite.
6. Filter test cases based on priority for regression testing.
We can’t have a regression that keeps adding indefinite numbers of these cases. Somewhere we’ve to stop and we should know by making an informed and well-thought decision.
So start classifying all the regression test cases. Have priority categories like P1 (Very High), P2 (High), P3 (Moderate), and so on. Alternatively, you can segregate test cases based on their functionality. And you can even add tags to filter test cases. It could be a release tag, a label for a Service Pack, or a Patch.
The ideas behind such a classification of test cases into several priorities should derive from the importance and customer impact.
Here are a few rules that a software tester can apply to customize the regression test execution.
i. If the Severity and the Impact of a bug are Low, then executing a bunch of tests from P1, P2 & P3 priorities would suffice.
ii. If the Severity and the Impact of a bug are Medium, then execute all P1 & P2 test cases. However, the tester can also run P3 test cases if required. By the way, if the bug fix requires adding new test cases, then they should also run as a part of the regression.
iii. If the Severity and the Impact of a bug are High, then execute all P1, and P2 test cases and include a few of the selected P3 cases.
7. Select test cases to update when an old functionality gets changed.
It’s not often that a customer requests a re-writing of an old feature. However, such things do happen. And the developers have to amend it. And so the tester has to respond accordingly.
- A significant shift in the product functionality.
- Build procedure/prerequisites have changed.
- Some parts of the regression test cases never got executed.
- The regression test cycle includes only a few selected test cases.
- Expect a steep deviation in the test results from the previous execution.
What are the steps required to perform Regression testing?
The purpose of regression testing is to uncover bugs during the various stages of the product lifecycle. To achieve this objective, the QA team along with developers should devise an effective regression testing strategy starting from its onset. Here, we are laying down a list of steps that would help in carrying out successful regression testing.
Step 1: Establish the requirements and target components
It is important to identify whether the product is developing from scratch or it’s the part of the product that is under development. Once you filter the first part, then go after looking a further deeper and isolate the components/modules getting changed. That’s how one can determine what exactly should become part of the regression testing. It’s a step that you should repeat whenever a module has a bug fix or a new feature added to the product.
Step 2: Select an automation tool for regression testing.
Select a bunch of automation tools that meet your test requirements. Evaluate and identify their pros/cons. Discuss with business stakeholders, developers, and software testing engineers. And identify the appropriate tool for your project or product. Come to an agreement for the current and future costs with all the parties involved. It’s a step that you need to perform once so you must be very clear in choosing the right tool for regression testing.
Step 3: Define entry criteria for regression test cases.
The entry criteria outline the minimum eligibility or the least of conditions to satisfy before you begin the testing. So a test engineer should take care of the following.
- Make sure the test or the defect is repeatable and has proper documentation.
- If it’s a defect to cover in regression, then check its history to identify and track the regression testing efforts.
- Add a regression test that targets the defect or the test requirement.
- Get the tests reviewed and approved by stakeholders.
Step 4: Define exit criteria for regression test cases.
Since the scope of regression keeps increasing with the arrival of new features and defects, it’s important to set an exit point. Like the entry criteria, exit criteria also define the minimum eligibility or the least of conditions to satisfy before you declare the testing phase as closed.
- A software test engineer should complete this step during the planning phase and get it approved timely. Here are a few tips to follow.
- Ensure that the regression test completes the full cycle.
- Check if the desired code coverage is ready.
- Don’t miss to check any severe bugs or defer it after approval.
- Finally, verify that regression has not skipped any “high-risk” areas.
Step 5: Define a schedule for execution.
After finalizing the above steps, it’s time to decide the frequency and schedule of test execution. Usually, the best practice says regression should run after any commit happens in the code. However, it’s a bit overkill to launch all the tests for every small change. So you can segment the test cases and classify a few tests to ensure sanity. You can run the sanity frequently. However, you should prepare to execute the complete Regression at least once a day.
Since it’s not feasible to run the regression or part of it manually, so prefer using a continuous integration tool like Jenkins. It will make your life easier. You can use it to configure the tests to run any number of times. It will let you control the regression the way you wish it to be.
Summary – Regression Testing Concepts.
While we tried to simplify the idea of regression testing above, we hope this information will help you implement an effective regression testing strategy.
It is one of the most important concepts of software testing and is also practically relevant to the test requirements of modern development.