What is Regression Testing?

Author: Eugene Cherkashyn

If you’ve been following this blog, you know that we are pretty serious about regression testing best practices. Visual regressions were the arch-enemies of our product AjaxSwing. To overcome them, we’ve even created our own automated regression testing tool.

Today, we’d like to talk about this type of testing. We’ll cover its key concepts and challenges. Besides, we’ll explore regression testing best practices, techniques and tools. Let’s start with addressing some of the basics.

What is regression testing?

Image credit: 360logica

Basically, we’re talking about a testing methodology/process that tells you if a previously written and tested code broke after you’ve added an update or a fix.

In other words, it helps you notice if you’ve unknowingly introduced bugs to your software while adding new code. New bugs of this kind are called regressions.

How to do regression testing?

Image credit: DZone

Okay, so how exactly do you test for regressions? In a nutshell, you perform regression testing by re-executing the same tests after each update. Passing tests ensure that your code continues to function as expected. Once a test that passed during previous runs fires a failure, you know that you’re dealing with a regression.

As a rule, it’s a good practice to run tests before the release of every new version of your product. A typical routine incorporates the following stages:

  • selecting which portions of the system to retest
  • execution of test cases (manually or automated).

Here’s another essential thing to note. In theory, regression testing applies to any testing level, including unit, API/integration, system and acceptance testing. There is a widespread convention, though, that regression testing is mostly a part of system testing.

Extent of your tests

The extent of a regression test can cover the complete functionality of your software or focus on separate aspects.

Aside from functionality, tests of this type can deal with non-functional aspects of your project. Specifically, visual regression testing of a user interface often tackles presentation issues. Most people would characterize the latter as aesthetic.

Regression testing techniques

It’s often impractical to cover every aspect of your application with regression tests. Due to this fact, several regression testing techniques exist.

Full Testing (Retest All)

This regression testing technique strives to achieve a complete coverage of all possible issues during every test run. This approach boils down to running all tests after every modification introduced to the project.

While it takes more time and effort, the retest-all technique is optimal when regressions are hard to predict and localize. Need an example? How about CSS regressions where one visual bug affects multiple pages and UI states.

In some instances, there is no way to predict which parts of the system a change will affect. In such cases, only full regression testing can guarantee that the system will perform well.