You get a bonus - 1 coin for daily activity. Now you have 1 coin

Regression Testing

Lecture



Regression testing is a type of testing aimed at verifying changes made to an application or its environment (a defect fix, code merge, migration to a different operating system, database, web server, or application server), to confirm the fact that functionality that existed previously still works as before (see also sanity testing, or consistency/correctness checking). Regression tests can be either functional or non-functional tests.

As a rule, test cases written at the early stages of development and testing are used for regression testing. This guarantees that changes in the new version of the application have not damaged existing functionality. It is recommended to automate regression tests, in order to speed up the subsequent testing process and detect defects at the early stages of software development.

The term "regression testing" itself, depending on the context in which it is used, can have different meanings. Sam Kaner, for example, described 3 main types of regression testing:

  • Bug regression (Bug regression) - an attempt to prove that a fixed error is in fact not fixed
  • Old bug regression (Old bugs regression) - an attempt to prove that a recent code or data change has broken the fix for old errors, i.e., old bugs have started to reproduce again.
  • Side-effect regression (Side effect regression) - an attempt to prove that a recent code or data change has broken other parts of the application being developed

Regression testing (from Lat. regressio — backward movement) — a collective name for all types of software testing aimed at detecting errors in already-tested sections of source code. Such errors — where, after changes are made to a program, something that was supposed to keep working stops working — are called regression errors (regression bugs).

Regression testing (according to some[which?] sources) includes new bug-fix — verifying the fix of a newly found defect, old bug-fix — verifying that a previously fixed and verified defect does not reproduce in the system again, and also side-effect — verifying that the operability of previously working functionality has not been broken, if its code could have been affected while fixing certain defects in other functionality. The commonly used methods of regression testing include re-running previous tests, as well as checking whether regression errors have entered the next version as a result of code merging.

From software development experience it is known that the recurrence of the same errors is a fairly frequent occurrence. Sometimes this happens because of weak version-control technique or because of human error when working with the version control system. But just as often the solution to a problem turns out to be «short-lived»: after the next change to the program, the fix stops working. And finally, when rewriting some part of the code, the same errors that were present in the previous implementation often resurface.

Therefore it is considered good practice, when fixing a bug, to create a test for it and run it regularly with subsequent changes to the program. Although regression testing can also be performed manually, it is most often done using specialized programs that allow all regression tests to be run automatically. Some projects even use tools for automatically running regression tests at a given time interval. This is usually done after every successful build (in small projects), or every night or every week.

Regression testing is an integral part of extreme programming. In this methodology, design documentation is replaced by extensible, repeatable and automated testing of the entire software package at every stage of the software development process.

Use

Regression testing can be used not only to verify the correctness of a program; it is also often used to assess the quality of the result obtained. For example, when developing a compiler, running regression tests examines the size of the resulting code, its execution speed, and the compilation time of each of the test examples.

Classification

In their article, S. Yoo and M. Harman provide the following classification of regression testing:

  • Test suite minimization seeks to reduce the size of the test suite by eliminating redundant test cases from the test suite.
  • Test case prioritization. Its goals consist of executing ordered tests based on some criterion. For example, based on history, a baseline, or requirements that are expected to lead to earlier detection of faults or help maximize some other useful properties.
  • Test case selection is concerned with the problem of selecting a subset of tests that will be used to verify the changed parts of the software. This requires selecting a subset of tests from the previous version that can detect faults, based on various strategies. Most documented regression testing methods focus specifically on this technique. A common strategy is to focus on identifying the modified parts of the SUT (SUT - system under test) and on selecting the test cases relevant to them. For example, the technique of full re-testing (retest-all) – is one of the naive types of regression test selection, by re-running all kinds of tests from the previous version on the new one. It is often used in industry because of its simple and quick implementation. Nevertheless, its fault-detection ability is limited. Thus, a significant amount of work is devoted to developing efficient and scalable selective methods.
  • Hybrid test. It is a combination of the prioritization and selection tasks.

Test Suite Minimization Task

Test suite minimization seeks to reduce the size of the test suite by removing test cases from the set of tests based on a given criterion. There are three approaches, the first of which applies automated security testing to detect vulnerabilities by studying application faults that can reveal known malicious programs, such as viruses or worms. This approach considers only the tests that failed in the previous version, for re-running in the new version of the system after the fault has been fixed.

Another approach is intended for detecting and eliminating vulnerabilities in minor releases of web applications. It sets up a rigid link to the pages of the previous version using iterators, which are selected for studying the web pages that contain vulnerabilities.

And, finally, the third approach proposes testing with self-adaptation of the system for already-known failures. The authors avoid reproducing already-known errors by considering for execution only those tests that revealed known failures in previous versions.

Prioritization Task

The test prioritization task concerns the correct ordering of tests, which maximizes the desired properties, such as early detection of faults. Moreover, current approaches to priority assignment consider only vulnerabilities.

One of the methods proposes fault-based priority tests that directly use knowledge of their ability to detect faults.

Another proposes a modifiable record-and-replay system that allows a recorded, executed version of the application to be rewritten into a new, modified one. Their execution is prioritized based on determining the optimal modifiable rewriting using a cost function and measuring the difference between the original execution and the modified one on replay.

Test Selection Task

The selection method makes it possible to choose a subset or all of the test cases in order to verify the changed parts of the software. The following approaches test both security mechanisms and vulnerabilities.

  1. A state-diagram-based (UML-based) approach to regression testing for the security requirements of authentication, confidentiality, availability, authorization and integrity. Tests represented as a sequence diagram are selected based on the requirements-change test.
  2. An approach to improving regression testing based on non-functional requirements ontologies. Tests are selected based on changes and the impact analysis of non-functional requirements, such as security, performance and reliability. Each test is linked to the changed requirement that is selected for regression testing.
  3. An approach for providing verification of additional evidence for the certification of service security requirements. This approach is based on detecting changes in the service test model, which will determine whether new test cases must be created or existing ones will be selected for re-execution on the dedicated service.
  4. An approach to developing secure systems evaluated against Common Criteria. In this approach, test tasks for security requirements are created manually and represented as a sequence diagram. In the event of a change, new tests are written if necessary, and then all tests are run on the new version.
  5. An approach to the security testing requirements for web service releases. The service user can periodically re-run the set of tests directed against the service to verify that the user still has the correct rights.
  6. A coverage-based selection method for the evolutionary testing of security policies, each of which includes a sequence of rules for determining who has access to a resource and under what conditions.

Advantages and Disadvantages

Regression testing is performed when changes are made to existing functional capabilities of the software, or when there is a bug fix in the software. Regression testing can be implemented through several approaches. Successful passage of all tests by the modified program provides confidence that the changes made to the software have not affected existing functional capabilities, which must remain unchanged in any case.

In agile project management processes, where the software development life cycle is very short, resources are lacking, and changes are made to the software very frequently, regression testing can introduce a great deal of unnecessary overhead.

As a rule, regression testing is carried out using automation tools, but the current generation of regression testing tools is not designed to handle database applications. For this reason, when running a regression test on applications that use databases, unplanned expenses may arise, since this will require a great deal of manual labor.

Quotes

The fundamental problem in program maintenance is that fixing one bug has a fairly high probability (20—50 %) of introducing a new one. So the whole process proceeds on the principle of «two steps forward, one step back».

Why can't errors be fixed more carefully? First, even a hidden defect manifests itself as a failure in just one place. In reality, however, it often has ramifications throughout the whole system, usually not obvious ones. Any attempt to fix it with minimal effort will fix the local and obvious part, but unless the structure is very clear, or the documentation very good, the remote consequences of that fix will go unnoticed. Second, errors are usually not fixed by the program's author, but often by a junior programmer or an intern.

Because of the introduction of new errors, program maintenance requires significantly more systematic debugging per statement than any other kind of programming. In theory, after every fix the entire set of test cases against which the system was previously verified should be re-run, to make sure that it has not been damaged in some incomprehensible way. In practice, such regression testing really ought to approach this theoretical ideal, and it is very costly.

F. Brooks The Mythical Man-Month, or How Software Systems Are Created

See Also

  • Quality Control
  • Test-Driven Development
  • Smoke Testing
created: 2016-04-02
updated: 2026-03-10
791



Was this answer useful?
Choose a quick rating so we can improve the next answer for you.
How satisfied are you?


Comments

To leave a comment

If you have any suggestion, idea, thanks or comment, feel free to write. We really value feedback and are glad to hear your opinion.
To reply

Lectures and tutorial on "Quality Assurance"

Terms: Quality Assurance