In this Regression Testing guide, we will learn what is regression testing and the following.
Let’s get started.
What is Regression Testing with example?
In the interview perspective, you will be asked to define It. Let’s see what is Regression Testing in Software Testing
Regression Testing Definition
Repeated testing of an already tested program, after modification, to discover any defects introduced or uncovered as a result of the changes in the software being tested or in another related or unrelated software components.
In simple words, We do regression by re-executing the tests against the modified application to evaluate whether the modified code breaks anything which was working earlier. Anytime we do modify an application, we should do regression testing (we run regression test).
Also Read: What is Retesting? When Do We Do Retesting?
Regression testing gives confidence to the developers that there is no broken functionality after modifying the production code. It makes sure that there are no unexpected side effects. Hope you have understood what is regression tests. Now let’s see when do we do this type of testing.
Regression Testing Example
Assume there is an application which has a functionality to ‘Add’, ‘Save’, and ‘Delete’. These functions allow users to add data, save data and delete data. Now developers are developing a new feature i.e., ‘Update’. This feature allows users to edit and update the data. As a tester, you have to verify the introduction of a new feature (ie., Update) impacting the existing features (such as ‘Add’, ‘Save’, and ‘Delete’ functions) or not.
Check the below video to see “What Is It & When Do We Do It”
Please be patient. The video will load in some time.
If you liked this video, then please subscribe to our YouTube Channel for more video tutorials.
What are the types of Regression Testing?
There are three types of Regression Testing.
- Unit Regression
- Partial Regression
- Complete Regression
#1. Unit Regression
Unit Regression Testing is done during the unit testing phase and the code is tested as a single unit without any dependencies. Dependencies if any are temporarily blocked to test the unit independently.
#2. Partial Regression
Partial Regression Testing means when regression testing is done on a module where the change in the code is related to that particular module and there wont be any change impact on other modules.
#3. Complete Regression
Complete Regression Testing means when regression testing is done on a number of modules where the change in the code is related to the other module is uncertain.
Regression Testing Techniques
Software maintenance is the process of modifying a software application which includes improvements, bug fixing, deletion of existing features, and optimization. When we do these modifications, the system may work incorrectly. To avoid issues while modifying the code, we do follow regression testing techniques. These techniques help us to eliminate the risks associated with the modifying code.
Following are the various techniques.
- Retest All
- Regression Test Selection
- Test Case Prioritization
#1. Retest All
All the test cases in the existing test bucket or test suite are re-executed to verify that there are no bugs that occurred due to the modified code.
This is a very expensive method as it needs enormous time as well as resources when compared to the other techniques.
#2. Regression Test Selection
By using the regression test selection technique, we select a part of test cases from the test suite to run to verify whether the modified code affects the application or not instead of re-executing the complete test suite. This selection of test cases from the test suite is done on the basis of the modified code. The test cases chosen are categorized into two parts such as reusable test cases and obsolete test cases.
Reusable test cases – Test cases that can be used in succeeding regression cycles.
Obsolete test case – Test cases that cannot be used in succeeding regression cycles.
#3. Test Case Prioritization
By using this technique, we select the test cases with high priority first to run instead of a medium and low priority ones. Test case priority depends on its business impact, frequency, and criticality.
Difference Between Re-Testing and Regression Testing
Retesting is a testing types to test the functionality or bug again to ensure that the defects which were found and posted in the earlier build were fixed or not in the latest build.
Regression testing is a testing types to repeat the testing of an already tested program, after modifications, to discover any defects introduced or uncovered as a result of the changes in the software being tested or in another related or unrelated software component.
Most of the time testers get confused with both regression and retesting. As a tester you have to remember that both these regression testing and retesting are different. You can read the complete list of differences between Regression Testing vs Retesting in detail here.
When do we do Regression Check?
Interviewers may ask you why do you do regression testing. We do software regression testing whenever the production code is modified. Usually, we do execute regression tests in the following cases:
Some regression tests examples are here.
#1. When new functionalities are added to the application.
Example: A website has a login functionality that allows users to do login only with Email. Now the new features look like “providing a new feature to do login using Facebook”.
#2. When there is a Change Requirement (CR).
Example: Remember password should be removed from the login page which is available earlier
#3. When there is a Defect Fix.
Example: Imagine the Login button is not working on a login page and a tester reports a bug stating that the login button is broken. Once the bug is fixed by the developers, testers test it to make sure whether the Login button is working as per the expected result. Simultaneously testers test other functionalities that are related to the login button
#4. When there is a Performance Issue Fix.
Example: Loading the home page takes 5 seconds. Reducing the load time to 2 seconds
#5. When there is an Environment change.
Example: Updating the Database from MySQL to Oracle)
So far we have seen what is regression and when do we do regression. Now let’s see how we do it.
How do we perform Regression Testing?
Steps to carry out to perform regression tests are
Step 1: Get clear understanding on what are the changes made to the software
Step 2: Analyse which part of the software might be impacted with the modified code
Step 3: Make sure whether you have to follow which type of regression such as Unit, Partial, or Full regression.
Step 4: Execute the selected test cases.
Regression Testing – Manual or Automation?
Regression tests are generally extremely tedious and time-consuming. We do regression after every deployment, so it would make life easy to automate test cases instead of running manually each and every time. if we have thousands of test cases, it’s better to create automation test scripts for the test cases which we do on every build (i.e., regression testing)
Automated regression test is the best practice and it is the choice of organizations to save a lot of time and to run nightly builds.
The Challenges of Regression Testing
There are some challenges in performing regression testing, even though it plays a crucial role in the QA process.
#1. Right Tool
Selecting the appropriate tool plays a key role in the success of regression test automation. If we select an inappropriate tool then regression test automation will become time-consuming and won’t generate good ROI.
To utilize the selected tool in a proper manner to generate good ROI, we need to have skilled resources who can use the tool effectively.
#3. Time Consuming
Regression testing involves running the same test cases again and again. It leads to large test suites and consumes more time to complete the test execution. Sometimes due to time constraints, we may not run the entire regression test suite.
#4. Test Coverage
To overcome the time consumption, we have to minimize the test suites. We may not achieve maximum test coverage when minimizing the test suites.
Regression Testing in Agile
Now adays, most of the organizations are following Agile practices. Agile works in an iterative and incremental method. Developers work on new functionality and release them in every 2-4 weeks as sprint release. In agile, it is sure that for every 2-4 weeks once there will be a code change. In this case, the regression tests help in testing the new code change in every iteration to make sure that tested application continues to perform correctly after every iteration.
Best Practises of Regression Testing
Following are some of the best practises to be followed while doing this testing.
- Select the test cases that causes frequent defects.
- Select the work flow that has more visibility to the users.
- Conduct regression tests after smoke and sanity testing.
- Conduct regression tests at the end of functional testing.
- Have a regression test plan handy.
- Run regression test cases regularly to avoid the release risk in the next build.
- Use right tool to speed up the test process.
- Select all integration test cases, complex test cases, boundary value test cases.
Automated Regression Test Tools:
In most cases, the software undergoes frequent changes and we spent a lot of time to execute these regression test cases and which leads to high-cost and time consuming.
To avoid these problems we can choose automated regression tests.
Automation testing is a great way to run regression tests in efficient and cost effective way. It also helps testers not to test the repeated and boring tests.
In general, regression test suites have to be updated frequently. So while selecting a tool for your needs make sure the tool has the ability to update a test suite.
Here are some of the regression test tools that help you in automating your regression test cases efficiently and quickly.
- Selenium: This is a free tool that is used to automate web applications.
- Katalon: Katalon studio comes with Katalon Recorder which acts as a record and playback tool. Katalon Studio IDE supports the creation of test cases in Java and groovy.
- Ranorex: Ranorex Studio is a codeless test automation tool that accelerates regression tests for desktop, web, and mobile.
For a detailed explanation of the regression testing tools, check out our article on Best Regression Testing Tools.
If you think, we missed some of the popular Regression Test Tools, please comment below and we will try to include them.
Regression testing saves time and money. It helps organizations to deliver a quality product by ensuring that the code change should not affect the existing functionality.
If you have any questions related to regression testing, please comment below.