The Agile software development method pushed organizations to more incremental delivery of software and applications. New features can address defects in functionality or feature requests from users.
While incremental delivery has many benefits, application changes can always introduce unintended effects on the software, including features that stop working. That’s what regression testing in software testing aims to fix, but it takes a tactful approach to avoid delays in product releases.
In this guide, we’ll explain a number of key points, including what regression testing is, how to do it and some best practices.
-
What is regression testing?
-
Types of regression testing
-
Automated regression testing
-
How to do regression testing
-
Regression testing in Agile
-
Applause as a regression testing partner
What is regression testing?
Software regression testing is a type of functional, black box testing in which the QA team assesses previously tested application features after system changes or modifications are made by developers. QA teams re-run previously executed test cases, such as unit and integration tests, to make sure they still pass after a code change has been made.
Through regression testing, QA professionals make sure those previously tested components still function as intended, and weren’t inadvertently broken by the new code. While most testing techniques aim to identify bugs in new features, this approach looks to simply confirm that the software is running smoothly and is not experiencing any adverse effects from the update.
Regression testing helps ensure the software unifies, meaning it works together as a whole, rather than just as separate components. Software systems are often large and have many components connected via APIs, so it’s easy for a simple change to have an unintended negative effect. Regression testing in software testing reduces the risk of poorly functioning features and helps the new version advance toward a production environment.
Regression testing often occurs on a new build any time there is a change to either the code or the environment where it will run. Code changes can include new functionality, fixes to defects or performance issues, and requirements changes. Testers typically execute these tests at the end of the software iteration, prior to release. To do this, they re-run the existing regression test cases or automated scripts again to make sure they pass or catch defects.
Now that we know what regression testing is, let’s explain what regression testing isn’t.
Regression testing vs. retesting. Both regression testing and retesting involve re-executing test cases, but they are done with different purposes in mind. QA teams use retesting on test cases that previously failed. Retesting ensures that the bug fixes put in place actually worked. Retesting is a high-priority task that is part of standard development practices. Conversely, regression testing is sometimes lower-priority. It validates test cases that previously passed and can be automated or manual.
Regression testing vs. unit testing. As the name suggests, unit testing involves validating small, separate batches of code. Unit testing is often done by developers while they code or immediately after to catch defects, and is typically part of the build process when compiling code. Regression testing occurs later in the development cycle, just prior to production deployment, and often involves larger batches of code and its interconnectedness within a broader system. Regression testing might involve re-running unit tests, but is not limited to unit tests.
Regression testing vs. integration testing. As with unit testing, integration testing is done earlier in the SDLC than regression testing. Integration testing validates how codebases interact with each other, as different batches of code serve different purposes, such as a database. Through integration testing, you might find broken code integrations that require fixing. Regression testing differs in that it typically occurs after integration testing and involves validating test cases that previously passed. As with unit tests, regression testing might include re-running integration tests.
Types of regression testing
There are many ways to do regression testing — some targeting specific areas of an application, and others more expansive. The regression testing approach likely depends on the digital quality strategy at a given point in time. Some types of regression testing require more time and resources, while others can be executed much more quickly.
Each organization should develop its own philosophy around how and when to perform this type of functional software testing. An overly prescriptive regression testing approach might leave blind spots that lead to defects. However, many types of regression testing fall into one of these buckets:
Corrective regression testing. This is a simplistic and low-effort regression testing approach in which no changes occur to the product specification, which means the tester can reuse the existing test cases.
Selective regression testing. In this approach, also called partial regression, the tester uses a subset of the existing test cases to analyze a part of the application that has changed. This is a low-cost and low-effort way to analyze the effect of new code on the existing code. This is similar to a corrective testing approach, yet is slightly more comprehensive. When merging a code change with the main branch of code, partial regression makes use of the existing test cases to make sure the system works as it did before.
If you choose to select test cases for regression testing, there are two primary ways to categorize them. Reusable test cases are ones that you will use in future regression testing cycles, while obsolete are not used again.
Retest-all regression testing. A tedious and costly yet comprehensive approach, retest-all regression testing, also called complete regression, involves testing all the system components from scratch. This regression testing approach might make sense if either the software undergoes significant functional changes or the QA team determines previous testing stages were insufficient or incorrect. Retest-all checks all small changes made to an application and reuses all valid test cases. Retest-all is easier to perform on smaller products, as it is very time-consuming on larger scale software, even with automated tests.
Progressive regression testing. When software specifications change and new test cases are required, the progressive testing approach helps ensure that the new version does not break existing features.
Unit regression testing. A combination of regression and unit testing, this approach focuses regressions on an individual segment of code, ignoring the associated dependencies and integrations.
These types of regression testing can uncover defects in different parts of the system. Sometimes it’s the feature being changed that encounters a defect, and other times it’s a different part of the system. Here are three different types of regression defects that can occur.
-
Local regression defects — bugs found in the software component being updated.
-
Remote regression defects — bugs found in a different area of the software than the area being updated.
-
Unmasked regression defects — bugs that previously existed, but didn’t cause problems until the new software update.
This speaks to the value of regression testing, as you can’t predict where, when or how defects will occur.
Automated regression testing
Test automation makes it easier to expand test coverage with a small footprint of execution time and resources. The general rule of thumb is to automate as much as you can — as long as a task can be reliably automated, it can be done cheaper and with less risk of human error.
Some types of testing are a good fit for automation, while others produce less reliable outcomes and should be done manually. Generally, regression tests are good candidates for automation if they are:
-
repeatable
-
stable
-
scriptable
Automated unit tests and integration tests are great candidates for regressions, especially when they target the area of the application that has been changed. While you can’t entirely automate your regression suites, automation makes it easier to get the coverage you need, particularly for more expansive types of regression testing. Automated regression tests generally make sense when you have an agreed-upon and understood test scope.
Keep in mind that as the automated test suite grows, so will your test scripts, which means it takes longer to run these tests the first time and again in regression — unless you target particular test cases. One way to reduce the time footprint of automated regression tests is to parallelize them — run them at the same time. However, it’s best to maintain a testing schedule to keep the team and the testing on track.
There are dozens of tools, services and frameworks available to help you automate testing, including Applause’s Automated Functional Testing. Another tool, Applause Codeless Automation, helps lower the barrier to entry for test automation, as anyone can use it to create repeatable automated tests. While these solutions require some level of investment and commitment, they often provide proven ROI — preventing bugs from escaping into production and keeping your software development process moving. Choose an option that fits your needs but can scale over time.
How to do regression testing
Ideally, you perform regression testing every time your code base is modified, whether through an update, a fix or other changes. Some organizations perform it every time a change is pushed.
After the code is debugged and defects are fixed, take the resources and timeline into account to inform the regression testing approach. Choose one of the types mentioned above, then progress through the following steps:
1. Gather test cases
If you plan to select particular test cases, the first step is to identify those tests. Some areas of the application that might require attention include main functionality, error-prone segments of code and complicated user sequences. If comprehensive written test cases do not already exist, take the time to document them so that they can reliably be executed again and again.
2. Decide which tests to automate
Some tests make sense to automate to save time and resources, while others can only reliably be executed manually. Separate the test cases into two groups to align efforts and communication. Since automation of test cases can take additional time and effort, you might need to execute the automated tests manually until the test suite is created.
3. Estimate the time and resources
Once you know which tests you will automate, you can begin to assess the time and resources required for the task. Other aspects to factor into the time and resource estimation includes: test data creation, test planning, tool execution and reporting.
4. Prioritize test cases
Even if you plan ahead, you might not have time to test it all. Development delays and rushed delivery timelines can reduce the amount of testing time remaining. Keep productivity in mind from the beginning by prioritizing test cases. You might prioritize according to the functionality with the highest business impact, which features present the most risk or another criteria. You can also classify tests for future use to avoid delay in future iterations of this step.
5. Run tests
Execute these tests using the solutions of your choosing, keeping in mind the work schedule, release schedule and ongoing feature development your teams may need to support. If the regression test suites are particularly long, you might schedule them to run overnight or over the course of a weekend. Manual testing might take longer, and it also requires documentation. Exploratory testing might fit into many different timeboxes depending on how deep and wide into an application testers explore. However, defects discovered during this testing can later be turned into repeatable test cases. Many tools provide reporting to help you make sense of the results and react accordingly.
Regression testing in Agile
Depending on the cadence of your software releases, your regression testing approach might vary. In Waterfall software development, a release follows an extended, staged process. This means there is more to validate, as more changes are being made to existing code, but it also might mean there’s more time available to test. Just because the organization follows a slower cadence, however, does not mean you should avoid any tools at your disposal to ensure comprehensive testing, such as automation or crowdtesting — these are helpful resources for any type of release.
Many organizations today practice Agile, DevOps or another type of iterative, regular release schedule. In these types of software development, anything that slows down the software iteration process is looked upon with a critical eye.
Many organizations that adopt Agile or iterative software development perform regression testing at the end of every sprint, as part of the SDLC. This is a great way to eliminate bugs from entering production, but it does present some time challenges. For that reason, this regression testing approach alone might not be feasible for some organizations, and it might need to be augmented with more automation or crowdtesting to alleviate the burden on internal teams. As another option, teams could perform regression testing in Agile on a predetermined schedule, which could be monthly, weekly or even daily depending on how frequently the team updates the software.
Over time, defects or other situations might cause the scope of regression testing in Agile to change. Likewise, the unhappy path can diverge in ways outside the original test scope. In these instances, exploratory testing can examine app behavior and functionality manually, simulating how a customer might use the app in unexpected ways. This can be particularly effective when partnered with crowdtesting; testers who are new to the application can perform exploratory testing, such as new customers would experience the application.
It’s important to remember, though, that the effort is worth the time commitment. Debugging is often a painful process, made even more harmful when customers feel the effects of those defects. The cost of your brand’s reputation is more than the cost of effective testing. It’s estimated that every issue preemptively found in regression testing and resolved prior to release can save 20 hours of reactive bug fixing. This late in the SDLC, these repairs can be 10-20 times more expensive for the company to fix, as the developer has often moved on to other projects, which means context switching and delaying new work. Not to mention, these late fixes are often stressful for the teams doing the work.
Applause as a regression testing partner
Even with a streamlined scope, regression testing can consume a lot of time and resources. Why waste internal resources on cumbersome repetitive tests or on tests that are difficult or impossible to simulate in-house?
Turn to Applause to alleviate the burden of functional testing. Applause experts can help automate predictable tests to streamline your testing footprint. And when you need a unique testing perspective from a person of a certain demographic, with a designated device or in a particular region, Applause is ready to source those experts and deliver swift results to keep your release on schedule. Applause tailors to your particular needs, providing vetted, knowledgeable testers who document defects quickly and clearly.
Contact Applause today to learn how we can add value to your functional testing efforts.
News taken from: https://www.applause.com/blog/what-is-regression-testing-types-approach