---
title: "Regression testing"
subject: "Software Engineering"
chapter: 8
key: "semester_5/software_engineering:regression-testing"
source: https://www.bctengineer.com/q/semester_5/software_engineering/regression-testing
site: BCT Engineering
---

# Regression testing

Software Engineering · Chapter 8: Software Testing and cost Estimation

- Asked in: 2067 Ashadh (old course), 4 marks
- Video: [Regression Testing with Real Life Examples | Software Engineering](https://www.youtube.com/watch?v=5496sXljdnQ) — Gate Smashers
- Answer checked by Claude Opus 5.5 (high effort) on 2026-10-14
- Page: https://www.bctengineer.com/q/semester_5/software_engineering/regression-testing
- Whole chapter: https://www.bctengineer.com/md/semester_5/software_engineering/chapter-8

## Question

Define regression testing in the context of software engineering.

## 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.

## Answer

**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.

## Check yourself

The answer's key points as multiple-choice questions, with the correct option and why.

1. What is regression testing?
   A. Testing a new module for the first time
   B. Re-running previously passed tests after a change to check nothing that worked has broken
   C. Testing only the changed code with new test cases
   D. Testing the system under heavy load
   Answer: B. Regression testing re-executes earlier passed tests after changes to catch new faults or re-opened old ones. (Key point: Definition of regression testing)

2. Which approach runs only the tests related to the changed code?
   A. Retest all
   B. Prioritised regression
   C. Selective regression
   D. Big-bang regression
   Answer: C. Selective regression limits the run to tests related to the changed code, unlike retest all which runs the whole suite. (Key point: Regression approaches)

3. Why is regression testing usually automated?
   A. The same tests are run many times, e.g. after every commit
   B. Manual testing cannot find faults
   C. Automated tests never need updating
   D. It removes the need for a test suite
   Answer: A. Because the same tests are repeated often, automation (JUnit, Selenium, CI) saves cost and time. (Key point: Automation of regression tests)

## Related in Software Engineering

- [Top-down integration problems; regression testing](https://www.bctengineer.com/question.md?key=semester_5%2Fsoftware_engineering%3Atop-down-integration-regression) — Software Engineering, chapter 8
- [Software testing metrics](https://www.bctengineer.com/question.md?key=semester_5%2Fsoftware_engineering%3Atesting-metrics) — Software Engineering, chapter 8
- [Short note: component-based software engineering](https://www.bctengineer.com/question.md?key=semester_5%2Fsoftware_engineering%3Acbse-note) — Software Engineering, chapter 6
- [Objectives of FTR; cleanroom software engineering](https://www.bctengineer.com/question.md?key=semester_5%2Fsoftware_engineering%3Aftr-cleanroom) — Software Engineering, chapter 9
- [Failure after acceptance testing; integration testing](https://www.bctengineer.com/question.md?key=semester_5%2Fsoftware_engineering%3Afail-after-acceptance) — Software Engineering, chapter 8
- [User acceptance testing](https://www.bctengineer.com/question.md?key=semester_5%2Fsoftware_engineering%3Auser-acceptance-testing) — Software Engineering, chapter 8

## Related in other subjects

- [Software bugs and testing techniques](https://www.bctengineer.com/question.md?key=semester_5%2Finstrumentation_ii%3Abug-types-testing) — Instrumentation II, chapter 9, asked 2×
- [Software testing time paradox](https://www.bctengineer.com/question.md?key=semester_5%2Finstrumentation_ii%3Asw-testing-paradox) — Instrumentation II, chapter 9
- [Uses of correlation and regression in engineering](https://www.bctengineer.com/question.md?key=semester_5%2Fprobability_and_statistics%3Acorrelation-regression-uses-engineering) — Probability and Statistics, chapter 5
- [Regression equation for demand of fish](https://www.bctengineer.com/question.md?key=semester_6%2Fengineering_economics%3Aregression-demand-fish-price-60) — Engineering Economics, chapter 1
