| Part of a series on |
| Software development |
|---|
Paradigms and models |
Standards and bodies of knowledge |
Regression testing (rarely,non-regression testing[1]) is re-runningfunctional andnon-functional tests to ensure that previously developed and tested software still performs as expected after a change.[2] If not, that would be called aregression.
Changes that may require regression testing includebug fixes, software enhancements,configuration changes, and even substitution ofelectronic components (hardware).[3] As regressiontest suites tend to grow with each found defect, test automation is frequently involved. Sometimes achange impact analysis is performed to determine an appropriate subset of tests (non-regression analysis[4]).
As software is updated or changed, or reused on a modified target, emergence of new faults and/or re-emergence of old faults is quite common.
Sometimes re-emergence occurs because a fix gets lost through poorrevision control practices (or simplehuman error in revision control). Often, a fix for a problem will be "fragile" in that it fixes the problem in the narrow case where it was first observed but not in more general cases which may arise over the lifetime of the software. Frequently, a fix for a problem in one area inadvertently causes asoftware bug in another area.
It may happen that when a feature is redesigned some of the same mistakes that were made in the original implementation of the feature also occur in the redesign. In most software development situations, it is consideredgood coding practice, when a bug is located and fixed, to record a test that exposes the bug and re-run that test regularly after subsequent changes to the program.[5]
Although this may be done throughmanual testing procedures using programming techniques, it is often done usingautomated testing tools.[6] Such atest suite contains software tools that allow the testing environment to execute all the regressiontest cases automatically; many projects have automatedContinuous integration systems to re-run all regression tests at specified intervals and report any failures (which could imply a regression or an out-of-date test).[7]
Common strategies are to run such a system after every successful compile (for small projects), every night, or once a week. Those strategies can be automated by an external tool.
Regression testing is an integral part of theextreme programming software development method. In this method, design documents are replaced by extensive, repeatable, and automated testing of the entire software package throughout each stage of thesoftware development process. Regression testing is done after functional testing has concluded, to verify that the other functionalities are working.
In the corporate world, regression testing has traditionally been performed by asoftware quality assurance team after the development team has completed work. However, defects found at this stage are the most costly to fix. This problem is being addressed by the rise ofunit testing. Although developers have always written test cases as part of the development cycle, these test cases have generally been eitherfunctional tests orunit tests that verify only intended outcomes. Developer testing compels a developer to focus on unit testing and to include both positive and negative test cases.[8]
The various regression testing techniques are:
This technique checks all the test cases on the current program to check its integrity. Though it is expensive as it needs to re-run all the cases, it ensures that there are no errors because of the modified code.[9]
Unlike Retest all, this technique runs a part of thetest suite (owing to the cost of retest all) if the cost of selecting the part of the test suite is less than the Retest all technique.[9]
Prioritize the test cases so as to increase a test suite's rate of fault detection. Test case prioritization techniques schedule test cases so that the test cases that are higher in priority are executed before the test cases that have a lower priority.[9]
This technique is a hybrid of regression test selection and test case prioritization.[9]
Regression testing is performed when changes are made to the existing functionality of the software or if there is a bug fix in the software. Regression testing can be achieved through multiple approaches; if atest all approach is followed, it provides certainty that the changes made to the software have not affected the existing functionalities, which are unaltered.[10]
Inagile software development—where the software development life cycles are very short, resources are scarce, and changes to the software are very frequent—regression testing might introduce a lot of unnecessaryoverhead.[10]
In a software development environment which tends to useblack box components from a third party, performing regression testing can be tricky, as any change in the third-party component may interfere with the rest of the system (and performing regression testing on a third-party component is difficult, because it is an unknown entity).[10]
Regression testing can be used not only for testing thecorrectness of a program but often also for tracking the quality of its output.[11] For instance, in the design of acompiler, regression testing could track the code size and the time it takes to compile and execute the test suite cases.
Also as a consequence of the introduction of new bugs, program maintenance requires far more system testing per statement written than any other programming. Theoretically, after each fix, one must run the entire batch of test cases previously run against the system to ensure that it has not been damaged in an obscure way. In practice, suchregression testing must indeed approximate this theoretical idea, and it is very costly.
— Fred Brooks,The Mythical Man Month, p. 122
Regression tests can be done at any level, fromunit through tosystem integration. Functional tests exercise the complete program with various inputs. These tests are often automated due to the need for repetition, and may be done by test tools that are not part of the compiler suite. Non-functional tests assess aspects such as performance, security, or reliability. Conducting non-functional regression tests presents additional challenges. For example, detecting changes in performance is often statistically complex,[12] while security issues typically arise from vulnerabilities in the software ecosystem rather than from individual code changes.[13]
Testing activities that focus on regression problems are called (non) regression testing. Usually "non" is omitted