You fixed one thing.
Did you break another?
Software never stops changing — bug fixes, new features, refactors, a new server OS. Every one of those changes can quietly break code that used to work fine. Regression testing is the discipline of re-running your test suite after every change so "it worked yesterday" doesn't turn into "it's broken today" without anyone noticing.
Change is constant — and it doesn't stay where you put it
This is the whole justification for regression testing existing as a discipline: change happens everywhere, all the time, and it doesn't respect boundaries.
Happens throughout the SDLC
Before delivery (still in development) and after delivery (in maintenance) — change never fully stops.
Can happen to every aspect
Requirements, code, design, configuration, environment — nothing is off-limits.
Can affect unchanged areas
A change in one place can break code, introduce new bugs, uncover previously unknown bugs, or reintroduce old bugs — all in code nobody edited.
What regression testing actually is
Regression Test
re-verify after modificationTesting of a previously tested program following modification, to ensure that new defects have not been introduced or uncovered in unchanged areas of the software, as a result of the changes made. It should be performed whenever the software or its environment changes, and it applies to testing at all levels.
A type of software testing that intends to ensure that changes — enhancements or defect fixes — to the software have not adversely affected it. It reruns both functional and non-functional tests, and it's a type of change-related testing: it detects whether defects have been introduced or uncovered in unchanged areas.
The cycle repeats: build → run tests → find/resolve bugs → write regression tests for the fix → run regression tests → ship — then it all starts again on the next change.
The instructor's slides place regression testing side by side with the two other test types students already know, to sharpen what makes it different.
| System | Acceptance | Regression | |
|---|---|---|---|
| Test for… | Correctness, completion | Usefulness, satisfaction | Accidental changes |
| Test by… | Development test group | Test group with users | Development test group |
| Category | Verification | Validation | Verification |
Why regression testing is needed
Conducted to make sure that fixing one thing has not broken another. The need can arise from any of these changes.
Defect fix
A bug was patched — did the patch touch anything else?
New feature
New code paths can interact with existing ones in unexpected ways.
Change in existing feature
Behavior shifted — every dependent path needs re-checking.
Code refactoring
Internals restructured, external behavior should be unchanged — prove it.
Design / architecture change
A structural shift can ripple through every subsystem.
Configuration / environment change
New hardware, software, or network — same code, different world.
The two problems that make regression testing expensive
Maintaining the test suite
upkeepIf I change feature X, how many test cases must be revised because they use feature X? Which test cases should be removed or replaced? Which should be added?
Cost of re-testing
execution costOften proportional to the size of the whole product, not the size of the change. A big problem if testing requires manual effort.
Some maintenance is inevitable. Some should be avoided.
Two reasons a test case might not deserve to stay in the suite
| Term | Meaning | What to do |
|---|---|---|
| Obsolete | A test case that is no longer valid — it tests features that have been modified, substituted, or removed. | Should be removed from the test suite. |
| Redundant | A test case that does not differ significantly from others — unlikely to find a fault missed by similar test cases. | Has real cost in re-execution and (maybe more) in human effort to maintain — may or may not be removed, depending on those costs. |
Should you re-run the whole suite? In what order?
Maybe you don't care — if you can re-run everything automatically over lunch break, just do it. But sometimes you do care.
If a very large suite can't be executed every day → Prioritization matters.
Code-Based Regression Test Selection
coverage-drivenObservation: a test case can't find a fault in code it doesn't execute. In a large system, many parts of the code are untouched by many test cases. So: only execute test cases that execute changed or new code.
A codebase map where most regions are shaded "executed by test case" — but only the test cases whose shaded region overlaps the small "new or changed" patch get selected to re-run.
Specification-Based Regression Test Selection
functionality-drivenLike code-based selection: pick test cases that test new and changed functionality. Difference: no guarantee of independence — a test case that isn't "for" a changed or added feature X might still find a bug in feature X anyway.
Because there's no coverage guarantee like in code-based selection — an "unrelated" test might be the one that catches the bug, so it's safer to reorder than to drop.
Prioritized Rotating Selection
everything, eventuallyBasic idea: execute all test cases, eventually — but execute some sooner than others.
| Scheme | Priority rule |
|---|---|
| Round Robin | Priority to least-recently-run test cases. |
| Track record | Priority to test cases that have detected faults before. |
| Structural | Priority for executing elements that have not been recently executed. |
The whole chapter in one scannable table
| Concept | Key idea | Note / example |
|---|---|---|
| Regression testing | Re-test a previously-tested program after modification, to catch new defects in unchanged areas | Applies at all test levels |
| Why it's needed | Defect fix, new/changed feature, refactor, design/architecture change, config/environment change | "Fixing one thing broke another" |
| Maintaining the suite | Which tests need revising, removing, or adding as features change | Some maintenance is inevitable; trivial changes shouldn't cascade |
| Cost of re-testing | Proportional to product size, not change size | Worse if manual |
| Obsolete test case | No longer valid — features modified/substituted/removed | Should be removed |
| Redundant test case | Doesn't differ meaningfully from others | May or may not be removed — a cost tradeoff |
| Selection matters when | Test cases are expensive to execute | Otherwise, just re-run everything |
| Prioritization matters when | A very large suite can't run every day | Order execution instead of skipping tests |
| Code-based selection | Only run tests that execute changed/new code | A test can't find a fault in code it doesn't touch |
| Spec-based selection | Pick tests tied to changed/new functionality — no independence guarantee | Typical: run everything, prioritize changed-feature tests |
| Prioritized rotating | Round Robin · Track record · Structural | Run all eventually, some sooner |
Where students actually lose marks
Each of these is a genuinely confusable point straight from the slides — drill the RIGHT side until it's automatic.
1. Regression testing "checks correctness" like system testing
2. "Redundant" and "Obsolete" test cases are treated the same
3. Assuming re-testing cost scales with the size of the change
4. Confusing selection with prioritization
5. Assuming spec-based selection is as safe as code-based selection
6. Believing you should always minimize which tests you run
7. Letting a trivial change invalidate a huge chunk of the suite
Quick self-check
Click a question to reveal the answer.
Scenario questions, worked through
Exam-style scenarios grounded directly in the chapter's concepts.