In this Regression Testing guide, we will learn what is regression testing and the following.
What is Regression Testing with example?
Regression testing is a type of software testing that seeks to identify bugs or errors in software code that was previously working correctly.
This testing is typically performed after new code has been added or modified, in order to ensure that the new code does not break existing functionality.
Regression tests can be run manually or automated, and there are various tools available to help with both approaches.
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.
In this, we are going to test only the changed unit, not the impact area, because it may affect the components of the same module.
Assume there is a form to accept user details such as First Name (accept only alphabets of max 10 characters), Last Name (accept only alphabets of max 10 characters), Emai Id (accept alphabets, numbers & special characters of max 30 characters).
Based on the test case design techniques, testers test the above form once the build is released.
Once the development team releases the build (B0001), testers start testing this build to verify whether the form is working as expected or not.
If the client request some modificiations in the form say the First name and Last name filed should accept max 15 characters instead of previously given 10 characters.
Developers will modify the functionality and release another build (B0002) and testers here test only whether the First name and Last name accepts max 15 characters or not and wont check any other features of the first build (B0001).
Here, testers are sure that the increase in the character count in the First name and Last name fields wont affect the form functionality, so they test only the character count.
Testing only the modified feature is known as Unit Regreession Testing.
#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.
It is also known as Regional Regression Testing.
Assume we have Login page along with User details form. If the tester finds a defect (D0001) in the form functionality and reported it.
Developers fix it and release another build (say B0003) which contains bug fix.
While testing the build (B0003), testers identify tha the bug fixing in the User details form impacts Login Page.
So testers test the bug fix first and then tests the Login page functionality.
Pro Tip: Whenever a build is released, as a tester you need to following the order – perform smoke test, test newly released features, test modified features, retest the bugs, test the impact areas by performing the regional regression testing.
#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.
It is also known as Full Regression Testing.
If there are new features and some bug fixes in a build. Test team will do the impact analysis. If they identify that the new build will lead to test the entire application then they perform testing the new features along with all the existing features.
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.
Automated Regression Testing
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.
When using automation for regression testing, it is important to consider the frequency with which the tests will be run.
For example, if the codebase is constantly changing, it may be necessary to run the tests on a nightly basis. Alternatively, if the code is only changed occasionally, it may be possible to run the tests less frequently.
It is also important to consider the impact of false positives when automation is used for regression testing.
A false positive is when a test incorrectly reports a bug or error.
This can happen for various reasons, such as changes in the environment, code that is no longer used, or incorrect test cases.
If false positives are not properly handled, they can cause significant problems, such as wasted time and resources investigating bugs that don’t actually exist.
What are 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.
What is Configuration Management During Regreesion Testing
In Agile Environments, Configuration Management in the regression testing becomes critical where code is frequently changed.
We must follow these steps in order to create a effective regression tests:
- During the regression test phase, no modifications should be permitted to the code. Developer changes must be kept out of regression test code.
- The regression test data must be kept isolated. No modifications to the database are permitted.
- The code being tested should be under a configuration management tool.
Must read: Configuration Testing Tutorial
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 Practices of Regression Testing
Following are some of the best practices 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 tools for regression testing that help you in automating your regression test cases efficiently and quickly.
Selenium is a free and open source test automation tool that is used to automate web applications. It can be used to test web-based applications on all major browsers, including Firefox, Chrome, Internet Explorer, Safari and Opera. Selenium can also be used to test mobile apps on Android and iOS platforms.
Katalon Studio is a powerful automated testing tool that can be used for both web testing and mobile testing. It supports many popular programming languages such as Java, Python, Ruby, Groovy, and C#. It helps testers save time and money by automating web, API, and mobile testing.
It 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 Studio is a codeless test automation tool that enables testers to create, maintain, and execute automated tests for desktop, web, and mobile applications. Ranorex provides an all-in-one solution for end-to-end test automation, including support for Ranorex Studio – an integrated development environment (IDE) for creating and maintaining Ranorex test cases.
Ranorex also integrates with popular continuous integration (CI) systems such as Jenkins and TeamCity, making it easy to set up automated testing workflows.Ranorex supports testing on a wide variety of platforms, including Windows, macOS, and Linux. Ranorex tests can be executed on physical devices or emulators/simulators.
Must read: Best Regression Testing Tools
Advantages and Disadvantages
Advantages of Regression Testing
- It can be automated.
- Checks for code changes to ensure that they do not negatively impact other features.
- It improves the quality of the application.
- Ensure that already fixed issues and bugs are not repeated.
- During testing, it acts as a risk-mitigation approach.
Disadvantages of Regression Testing
- Regression testing might be time-consuming task without automating it.
- It must be done for every small change in the software code.
- We need to design complicated test cases to perform regression testing.
- Every time in an agile sprint, regression testing should be repeated.
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.
- Manual Testing Tutorial
- Unit Testing Tutorial
- Integration Testing Tutorial
- Functional Testing Tutorial
- System Testing Tutorial