Regression Testing
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
}
Tags
🤝 Adopt this term
£79/year · your link shown here
Added
15 Mar 2026
Edited
22 Mar 2026
Views
33
🤖 AI Guestbook educational data only
|
|
Last 30 days
Agents 0
No pings yet today
No pings yesterday
Perplexity 10
Amazonbot 7
Google 5
Ahrefs 2
Unknown AI 2
ChatGPT 2
SEMrush 1
Also referenced
How they use it
crawler 27
crawler_json 2
Related categories
⚡
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