Regression Testing Fundamentals
Differentiate progressive vs regressive testing and restate objectives — ISTQB Foundation Level §5.2 | Chapter 8: Regression Testing
Learning Objectives
- Define regression testing and explain why it is a software maintenance necessity.
- Distinguish between progressive testing and regressive testing with examples.
- State the three core objectives of regression testing.
- Identify the contexts that trigger a regression testing cycle.
- Explain why regression testing is both necessary and challenging (the regression testing problem).
What Is Regression Testing?
"Regression testing is the selective retesting of a system or component to verify that modifications have not caused unintended effects and that the system or component still complies with its specified requirements."
Chowdhury (Software Testing, 2nd ed.) Definition:
"Regression testing is a software maintenance task performed on a modified program to instil confidence that changes are correct and have not adversely affected the unchanged portions of the program."
Regression testing does not re-run every test that has ever been written. It selects tests relevant to the change made — a fundamental challenge in practice.
The primary fear in regression is that a correct fix in one area silently breaks something that was working correctly before.
Regression applies whenever the software changes: bug fix, new feature, configuration change, library upgrade, or database change.
Why Regression Testing Is Needed
Software changes constantly. Every change — no matter how small — carries the risk of introducing new defects or reactivating previously fixed ones. Regression testing is the safety net that catches these regressions before they reach users.
- Shared code paths: A function used by Feature A and Feature B is modified for Feature A, unknowingly altering Feature B's behaviour.
- State dependencies: A change to a database schema or shared variable affects multiple downstream modules.
- Configuration interactions: A configuration change for one environment affects another.
- Integration side effects: A library upgrade fixes one issue but changes behaviour elsewhere.
- Incorrect fix scope: The fix addresses the symptom but not the root cause, leaving related failures dormant.
Progressive vs Regressive Testing
These two concepts are frequently confused. They are complementary, not alternatives, and both are necessary in every development cycle that involves change.
Progressive Testing
Testing performed to verify new functionality that was just added or to verify a previously untested area of the system.
- Purpose: Confirm new code works as specified.
- Trigger: New feature implemented or new requirement added.
- Test basis: New or updated requirements/user stories.
- Example: A payment module was just built. Tests are written to verify payment processing for the first time.
Regressive Testing
Testing performed to verify that previously working functionality still works correctly after a change to the system.
- Purpose: Detect unintended side effects of a change.
- Trigger: Bug fix, feature change, or any software modification.
- Test basis: Existing test cases from previous test cycles.
- Example: A discount calculation was changed. Existing checkout tests are re-executed to confirm other pricing logic still works.
| Dimension | Progressive Testing | Regressive Testing |
|---|---|---|
| What is tested | New or changed functionality | Previously passing functionality |
| Test cases | New test cases written | Existing test cases re-executed |
| Objective | Confirm new code works | Confirm nothing was broken |
| Triggered by | New requirements / new code | Any modification to existing code |
| Risk if skipped | New features shipped untested | Hidden regressions reach production |
Objectives of Regression Testing
The objectives of regression testing are directly traceable to the software quality goals it supports. Three core objectives are widely accepted in the ISTQB and academic literature:
After a defect is reported and fixed, regression tests re-execute the test cases that originally exposed the problem to confirm the fix is effective. This is called bug-fix confirmation.
Without this, a "fixed" defect may still fail in edge cases not initially tested.
Fixing one bug can introduce new bugs or reveal related defects in the same code area. Regression testing broadens the scope to cover the changed module and its immediate dependencies, looking for newly introduced issues.
Related bugs often share root causes (e.g., a misunderstood business rule) that affect multiple code paths.
This is the core regression concern: verifying that the change did not adversely affect previously correct functionality in other parts of the system. This is called side-effect regression or stability regression.
Most regression test failures fall into this category: untouched code that broke due to a shared dependency.
Software Maintenance Context
Regression testing is fundamentally a software maintenance activity. Software maintenance includes all activities that modify a system after initial delivery. Four maintenance types each trigger regression testing:
Fixing defects discovered after delivery. Bug-fix regression tests confirm the fix and check for side effects.
Modifying software to work in a changed environment (new OS, DB version, regulatory change). Regression tests verify existing behaviour under new conditions.
Adding new features or improving performance. Progressive tests cover new functionality; regression tests protect existing functionality.
Refactoring, code restructuring, documentation improvement. No functional change is intended — regression testing verifies this is true.
When Regression Testing Is Triggered
Regression testing is not a one-time event. It must be performed whenever the software is modified. Key triggering events include:
Performed after a reported bug has been fixed. Re-executes the original failing test case(s) plus related tests to confirm the fix is effective and stable. Corrective maintenance
When new functionality is added to an existing system. Regression ensures the new code does not break existing functionality. Perfective maintenance
In sprint-based and continuous integration environments, regression tests run after every build or commit. Automated regression suites are essential here. Agile / DevOps
When newly completed modules are integrated with existing modules, regression testing verifies existing module behaviour is preserved. Integration phase
When the system is deployed to a new OS, browser version, database, or hardware platform. Regression confirms parity with the known-good baseline. Adaptive maintenance
When internal code is reorganised without changing external behaviour, regression tests verify the behaviour guarantee holds. Preventive maintenance
Regression Testing & Software Quality
Regression testing is one of the most direct mechanisms for maintaining and increasing software quality across a product's lifecycle. Without it, software quality degrades with each release as undetected side effects accumulate.
- Creates a verified quality baseline after each change.
- Prevents accumulated technical debt from causing cascading failures.
- Supports safe refactoring by providing a safety net.
- Builds stakeholder confidence in release quality.
- Reduces production incidents caused by regression defects.
- Defect escape rate: Fewer regressions reaching production.
- Defect density: Tracks regression defect density per release.
- Test coverage stability: Ensures passing tests remain passing.
- Mean time to detect (MTTD): Regression testing reduces MTTD for side-effect defects.
The Regression Testing Problem
Regression testing is necessary, but it creates a fundamental challenge: the test suite grows with each release, making full re-execution increasingly expensive and time-consuming.
"Given a program P, its modified version P′, and a test set T that was used to previously test P, find a way to utilize T to gain sufficient confidence in the correctness of P′."
This means: we cannot always re-run all of T (too expensive). We need strategies to select, prioritize, and reduce T intelligently.
A mature product may have thousands of test cases. Re-running all of them after every change is impractical, especially in Agile environments with daily builds.
Which subset of the existing test suite is sufficient to expose any regressions introduced by the change? Selecting too few risks missing regressions; selecting too many wastes time.
If we cannot run all tests, in what order should we run them? High-priority tests should detect regressions as early as possible in the test run.
As the program changes, some old test cases may become invalid or redundant. Running them wastes time and can produce misleading results.
- Regression testability — designing the system and tests to support efficient regression (Session 4.6).
- Regression test selection — choosing a minimal subset of tests relevant to the change (Session 4.7).
- Test case prioritization — ordering tests to detect regressions early (Session 4.7).
- Test suite reduction — eliminating redundant tests to reduce test suite size (Session 4.7).
Worked Example: E-Commerce Order Processing
Context: An e-commerce system has the following modules: User Registration, Login, Product Catalogue, Shopping Cart, Checkout, Payment Processing, and Order History. A bug is reported: "10% loyalty discount is not applied correctly for premium members."
checkout.py is corrected. The condition if user.tier == 'premium' was checking the wrong field; it now checks user.membership_tier.
| Objective | Tests to Execute | Reason |
|---|---|---|
| 1. Verify bug is fixed | TC-CHK-047: Premium member checkout with 10% discount | Direct confirmation of the reported defect fix |
| 2. Find related bugs | TC-CHK-045 to TC-CHK-052: All discount-related checkout tests | Other discount tiers (student, staff) use similar logic; may be similarly broken |
| 3. Check side effects | TC-CHK-001 to TC-CHK-030: Full checkout test suite TC-PAY-001 to TC-PAY-015: Payment processing tests TC-ORD-001 to TC-ORD-010: Order creation tests |
The checkout function is called by payment and order creation; changes may have affected these |
- Progressive: If the team simultaneously adds a "gift voucher" feature, new test cases are written for voucher application (TC-CHK-060 onwards).
- Regressive: TC-CHK-001 to TC-CHK-052 and payment/order tests are re-executed to verify the discount fix did not break existing functionality.
ISTQB Connections
This principle directly motivates regression test selection. Since we cannot re-run every test after every change, we must select intelligently based on risk and change impact.
Running regression at unit and integration level (not just system level) finds regressions at the cheapest fix point.
A fully passing regression suite does not mean the system is correct — only that it behaves as it previously did. New requirements may not be covered.
ISTQB classifies regression testing as the primary technique within maintenance testing. Impact analysis should precede regression test selection.
Common Mistakes
No change is too small to cause a regression. Off-by-one fixes, typo corrections in configuration, and dependency version bumps have all caused production outages.
Retesting re-executes a specific failed test after a fix. Regression testing re-executes a broader set of tests to check for side effects. Both are needed but they serve different purposes.
Running only the test cases for the changed module satisfies Objective 1 but ignores Objective 3 (side effects). The most dangerous regressions are in untouched code.
A regression suite that grows without pruning becomes bloated with obsolete tests. Running invalid or redundant tests wastes time and can create noise.
Without a known-good baseline (test results from the last stable build), it is impossible to determine whether a test failure is a regression or a pre-existing condition.
In rapid-release environments, manual regression cannot keep pace with the change rate. Lack of automation makes regression testing a bottleneck or causes it to be skipped.
Class Activity
- Bug fix: Course registration now correctly prevents students from registering for more than 6 courses per semester.
- New feature: A "dark mode" toggle has been added to the UI settings page.
- Classify each change as the trigger for progressive testing, regressive testing, or both. Justify your answer.
- For the bug fix (change 1), identify tests that satisfy each of the 3 regression objectives.
- List 3 modules (other than Course Registration) where side-effect regression tests should be considered, and explain why each is at risk.
- What would you include in a regression test baseline for this system?
- 2 marks: Correct classification of progressive vs regressive with justification.
- 3 marks: Regression tests correctly mapped to all 3 objectives for change 1.
- 3 marks: Reasonable risk justification for 3 side-effect modules.
- 2 marks: Appropriate regression baseline definition.
Exit Ticket
- In one sentence, state the formal problem that regression testing addresses (use the P, P′, T formulation).
- What is the difference between retesting and regression testing?
- Name the three objectives of regression testing and give a one-line description of each.
- Give two real-world maintenance scenarios (one corrective, one adaptive) that would trigger a regression test cycle.
Summary & Assignment
Regression testing is the safety net that ensures software quality does not degrade as a system evolves. It is triggered by any change — bug fix, new feature, refactor, or environment update — and serves three core objectives: confirm the fix, find related bugs, and check side effects. The fundamental challenge is that re-running the entire test suite after every change is impractical at scale.
- Regression testing is a maintenance activity, not a one-off event.
- Progressive testing verifies new code; regressive testing protects existing code.
- Three objectives: verify fix, find related bugs, check side effects.
- The regression testing problem (P, P′, T) motivates the need for selection, prioritization, and reduction strategies.
- For your mini-project, identify the last code change made (bug fix or new feature) and map it to one of the four maintenance types.
- Design a regression test plan for that change addressing all three regression objectives. List at least 8 test cases (IDs and descriptions).
- Identify which modules in your system are most at risk of side-effect regression for that change, and justify your answer using the concept of shared code paths or shared data.