Skip to main content

Regression testing

Short answer

Regression testing re-executes previously passed tests after code changes to check that new faults were not introduced. It is done after bug fixes, new features, or configuration changes. Approaches are retest all, selective, and prioritized, and it is usually automated in continuous integration.

Define regression testing in the context of software engineering.

Regression testing is the re-execution of previously passed test cases after the software has been changed, to check that the change has not introduced new faults or re-opened old ones in parts that were working before. A "regression" is a feature that used to work but has stopped working.

When it is done

  • After a bug fix
  • After adding a new feature or module (during integration)
  • After changes in configuration, platform or performance tuning
  • During maintenance, before every new release

Regression test suite (Pressman)

  1. A representative sample of tests that exercise all major functions.
  2. Extra tests for functions likely to be affected by the change.
  3. Tests that focus on the changed components.

Approaches

  • Retest all: run the whole suite; safe but slow and costly.
  • Selective regression: run only tests related to the changed code.
  • Prioritised regression: run the most important or high-risk tests first.

Since the same tests are run many times, regression testing is usually automated (e.g. JUnit, Selenium) and run in continuous integration after every commit.

Example: in a college result system, the grading rule for "Distinction" is changed. Regression tests re-run the pass/fail, percentage, transcript printing and merit-list tests to make sure they still give correct results.

✓ Answer checked by Claude Opus 5.5 (high effort)

All Software Engineering chapter 8 questions →