← Home ← Codex ← DEBT
Browse by Category
+ added · updated 7d
← Back to glossary

Regression Testing

Testing Beginner
debt(d7/e5/b5/t5)
d7 Detectability Operational debt — how invisible misuse is to your safety net

Closest to 'only careful code review or runtime testing' (d7), missing regression tests aren't flagged by phpunit/pest themselves — you only notice when a bug returns or during code review of a bug fix PR without an accompanying test.

e5 Effort Remediation debt — work required to fix once spotted

Closest to 'touches multiple files / significant refactor in one component' (e5), backfilling a regression suite means writing many tests across the codebase, not a one-line fix; per-bug the fix is small but establishing the practice is broader.

b5 Burden Structural debt — long-term weight of choosing wrong

Closest to 'persistent productivity tax' (b5), the suite applies across web/cli/queue contexts and must be maintained on every commit; slow suites slow every workstream but don't define system shape.

t5 Trap Cognitive debt — how counter-intuitive correct behaviour is

Closest to 'notable trap' (t5), per misconception developers think regression testing is a separate phase rather than the cumulative effect of CI running all tests on every commit — a documented gotcha most devs learn.

About DEBT scoring →

Also Known As

regression suite regression test

TL;DR

Re-running existing tests after code changes to verify that previously working functionality has not been broken — the primary safety net for continuous delivery.

Explanation

Regression testing encompasses all tests that verify known-good behaviour is preserved after a change. In CI/CD, the entire test suite is a regression suite — every commit runs all tests to catch regressions early. The cost of regression testing is proportional to test execution time, which is why the test pyramid (many fast unit tests, few slow E2E tests) optimises for fast regression feedback. Mutation testing extends regression testing by verifying that the tests themselves are meaningful.

Common Misconception

Regression testing is a separate testing phase — in modern CI/CD, all tests run on every commit and collectively serve as the regression suite.

Why It Matters

Without regression tests, every change risks silently breaking existing features — the larger the codebase, the more likely an unrelated change introduces a regression.

Common Mistakes

  • Not running regression tests on every commit — regressions compound when multiple unverified changes accumulate.
  • Slow regression suite that developers skip locally — fast feedback loops require tests to run in minutes.
  • Not adding a regression test when fixing a bug — without a test, the bug returns silently.
  • Deleting tests that are 'in the way' of a refactor — they are protecting against regression.

Code Examples

✗ Vulnerable
// Bug fixed without adding a regression test:
// Report: calculate_discount() returns negative for items over $1000
// Fix applied — but no test added
// Next refactor: same bug reintroduced, silently
function calculate_discount(float $price): float {
    return $price > 100 ? $price * 0.1 : 0; // Bug: should be $price - $price * 0.1
}
✓ Fixed
// Bug fixed WITH a regression test:
function testDiscountNeverExceedsPrice(): void {
    $discount = calculate_discount(1500.00);
    $this->assertGreaterThanOrEqual(0, 1500.00 - $discount); // Price never goes negative
    $this->assertLessThanOrEqual(1500.00, $discount); // Discount never exceeds price
}

Added 15 Mar 2026
Edited 11 Jun 2026
Views 67
Rate this term
No ratings yet
🤖 AI Guestbook educational data only
| |
Last 30 days
0 pings T 0 pings W 1 ping T 0 pings F 1 ping S 0 pings S 0 pings M 0 pings T 0 pings W 2 pings T 2 pings F 1 ping S 1 ping S 0 pings M 1 ping T 0 pings W 1 ping T 0 pings F 0 pings S 0 pings S 1 ping M 0 pings T 1 ping W 0 pings T 0 pings F 0 pings S 0 pings S 1 ping M 1 ping T 0 pings W
No pings yet today
Perplexity 1
Perplexity 11 Amazonbot 9 Scrapy 7 Google 5 SEMrush 5 Ahrefs 4 ChatGPT 4 Unknown AI 2 Claude 2 Bing 2 Meta AI 1 PetalBot 1
crawler 48 crawler_json 5
DEV INTEL Tools & Severity
🟠 High ⚙ Fix effort: Low
⚡ Quick Fix
Write a test reproducing every bug before fixing it — the test proves the bug exists, ensures the fix works, and prevents the bug from reappearing silently
📦 Applies To
any web cli queue-worker
🔗 Prerequisites
🔍 Detection Hints
Bug fixed without a corresponding test; same bug reported multiple times; no test suite to detect regressions
Auto-detectable: ✗ No phpunit pest github-actions
⚠ Related Problems
🤖 AI Agent
Confidence: Low False Positives: High ✗ Manual fix Fix: Medium Context: File Tests: Update

✓ schema.org compliant