Regression Testing
Regression testing is the practice of re-running existing tests after a code change to confirm that previously working functionality has not been broken by the change.
Definition
Regression testing is the practice of re-running existing tests after a code change to confirm that previously working functionality has not been broken by the change.
Overview
Every time code is modified — whether to add a feature, fix a bug, or refactor internals — there's a risk that the change unintentionally breaks something that used to work, a phenomenon commonly called a 'regression.' Regression testing exists specifically to catch that risk: by maintaining a suite of tests covering previously verified behavior and re-running it after every change, a team gets confidence that new work hasn't silently broken old functionality. In modern software development, regression tests are almost always automated rather than manually re-executed, precisely because manual re-testing of the entire application after every change doesn't scale. A regression suite typically accumulates over time: whenever a bug is found and fixed, a new test is added that specifically reproduces the original bug, ensuring it can never silently reappear (sometimes called a 'bug regression test'). The suite also includes broader tests covering core functionality across unit, integration, and end-to-end layers, following the shape of the test pyramid so that the majority of regression coverage comes from fast, cheap unit tests rather than slow end-to-end tests. Regression testing is what makes continuous integration trustworthy — without a comprehensive, fast-running regression suite, teams either slow down releases to manually verify nothing broke, or ship changes blind and discover regressions from users in production. As a codebase and its test suite both grow, managing regression test run time becomes its own engineering problem, commonly addressed through parallelization, selectively running only tests affected by a given change, and periodically pruning redundant or low-value tests.
Key Concepts
- Re-runs previously passing tests after a code change to catch unintended breakage
- Almost always automated in modern development workflows rather than manual
- Grows over time as new tests are added for each bug fix, preventing recurrence
- Spans unit, integration, and end-to-end tests following the test pyramid
- Central to making continuous integration and continuous deployment trustworthy
- Requires ongoing management of test suite run time as the codebase grows
- Distinct from smoke testing, which is a narrower, faster sanity check
Use Cases
Frequently Asked Questions
From the Blog
Testing Python Code with pytest: A Beginner's Guide
Untested code is legacy code from the moment it's written. This guide explains how to write effective Python tests with pytest — from your first test function through fixtures, parametrize, mocking, and measuring coverage.
Read More Data ScienceLinear Regression Explained From Scratch
Linear regression fits a straight-line relationship between inputs and a number you want to predict. Learn how it works, how it learns, and where it fits.
Read More Data ScienceLogistic Regression: Classification Made Simple
Logistic regression predicts the probability of a category, making it the go-to model for classification. Learn how it works, reads out, and gets evaluated.
Read More Data ScienceWhat Is A/B Testing? A Data-Driven Guide
A/B testing compares two versions of something to see which performs better using real data. Learn how to design, run, and interpret experiments correctly.
Read More