regression testing
Regression testing is the practice of re-running previously passing checks against software after a change to confirm that existing behavior still works. A regression is a defect in which a feature that used to work breaks, often as a side effect of a bug fix, an enhancement, a refactor, or a configuration change. It exists to catch that breakage before it reaches users.
Regression tests accumulate over a project’s life. A new test is typically added whenever a defect is found and fixed, so that the same fault can never silently return. The growing set is collected into a regression suite that runs repeatedly against new revisions, which makes automation and automated testing necessary as the suite scales.
Re-running the entire suite is thorough but slow, so several strategies trade coverage for speed:
- Retest-all: Re-execute every test, giving full coverage at the highest cost.
- Regression test selection: Run only the tests that exercise the changed code.
- Test case prioritization: Order tests so the ones most likely to reveal a fault run first.
In practice, regression suites are wired into continuous integration, where each commit triggers a run that flags a regression before the change is merged.
Related Resources
Tutorial
Getting Started With Testing in Python
Learn Python testing in depth by writing unit and integration tests, measuring performance, and uncovering security issues. Find bugs before your users do!
For additional information on related topics, take a look at the following resources:
- pytest Tutorial: Effective Python Testing (Tutorial)
- Testing Your Code With pytest (Course)
- Test-Driven Development With pytest (Course)
- Continuous Integration With Python: An Introduction (Tutorial)
- Continuous Integration With Python (Course)
- Continuous Integration and Deployment for Python With GitHub Actions (Tutorial)
- Build Robust Continuous Integration With Docker and Friends (Tutorial)
- Getting Started With Testing in Python (Quiz)
- Effective Testing with Pytest (Quiz)
- Python Continuous Integration and Deployment Using GitHub Actions (Course)
- GitHub Actions for Python (Quiz)