# Regression Testing

Regression testing checks that a change has not unintentionally broken behavior that previously worked.

- Type: practice
- Domain: Engineering & architecture
- Level: Foundational
- Last reviewed: 2026-10-19
- Original: [Soroush’s Product Wiki](<https://wiki.soroush.uk/topic/regression-testing/>)

## What it means

Regression testing repeats or extends checks of existing behavior after code, configuration, dependency, or environment changes. It is a testing purpose rather than a particular test level: unit, integration, and end-to-end checks can all provide regression coverage. Retesting a repaired defect confirms the fix; regression testing also examines collateral effects.

## Why it matters

Shared code makes seemingly small changes capable of damaging distant features. Deliberate regression coverage protects important customer tasks and gives teams evidence about the impact of maintenance and refactoring.

## When to use it

Use it after changes with plausible effects on established behavior, especially shared libraries, pricing rules, and migrations. Select coverage using risk and dependencies. For intentionally changed requirements, update expectations rather than treating every difference as a defect.

## How it works

1. Identify changed behavior, affected dependencies, and critical existing workflows.
2. Choose relevant established checks plus tests for newly discovered failure cases.
3. Run the checks at the narrowest useful levels.
4. Investigate differences against intended requirements and isolate real regressions.
5. Update coverage and remove obsolete or redundant assertions after review.

## A practical example

A coupon fix resolves a discount rounding bug. The team retests the defect and also runs existing refund, tax, and invoice checks because they share the pricing function. A refund mismatch blocks release even though the original coupon case now passes.

## Where it breaks

Regression suites only protect known expectations and can preserve outdated assumptions. Large indiscriminate suites consume maintenance time and may hide flaky tests. They complement exploration and new-feature validation rather than replacing them.

## Common mistakes

- Retesting only the reported bug and ignoring shared dependencies.
- Updating failed expected values without checking whether behavior is wrong.
- Keeping obsolete checks that enforce requirements the team intentionally changed.

## Sources

1. [What is regression testing?](<https://www.ibm.com/think/topics/regression-testing>) — IBM · Technical guidance
2. [Regression Testing: Definition, How it works](<https://www.browserstack.com/guide/regression-testing>) — BrowserStack · Technical guidance

## Related topics

- [Change Impact Analysis](<https://wiki.soroush.uk/topic/change-impact-analysis/>)
- [Refactoring](<https://wiki.soroush.uk/topic/refactoring/>)
- [Continuous Integration](<https://wiki.soroush.uk/topic/continuous-integration/>)
