What is Regression Testing?
Regression testing is the practice of rerunning existing tests after a code change to verify that previously working functionality still works. When you fix a bug, add a feature, or refactor code, regression tests catch side effects that break behavior somewhere else. The name comes from bugs that reappear after they were supposedly fixed — 'regressions' — and the tests exist to catch them. For a comprehensive breakdown of regression testing types, techniques, tools, and implementation in modern development workflows, see our complete guide on regression testing.
When to run regression tests
On every pull request, before merge. Running regression tests only on main means regressions are caught after they have already landed on the main branch — at which point fixing them takes longer, blocks other developers, and sometimes requires a revert. Modern teams gate the merge button on the regression suite result via branch protection so broken code cannot merge in the first place.
For very large codebases where the full suite takes too long to run on every PR, selective regression testing uses the diff to pick a subset of tests most likely to catch an issue. This is a trade-off: faster feedback per PR in exchange for a small risk that an affected test is missed. Teams at Google, Facebook, and Microsoft have written extensively about how they do selection at scale; for most teams the simpler approach is to parallelize the full suite across workers.
Regression testing vs other test types
Regression testing is a use case, not a test technique. Unit tests, integration tests, contract tests, and E2E tests can all serve as regression tests when they run on every PR. The distinction matters because teams sometimes build a dedicated "regression suite" separate from their unit suite, which results in duplicated coverage and maintenance overhead. A better framing: all your automated tests form the regression suite, and running them on every PR is what makes them regression tests.
The scaling problem
A service that has been in production for two years typically accumulates thousands of test cases. Running them all on every PR becomes a bottleneck that slows the team down. Three responses:
- Parallelization. Run tests across multiple CI workers in parallel. Linear speedup up to the point where test setup dominates.
- Selective testing. Pick a subset of tests based on the changed files. Requires a dependency map from code to tests.
- Test consolidation. Delete tests that have not caught a bug in the last 12-24 months. Requires discipline to treat the test suite as a living codebase.
How Keploy automates regression testing
Keploy captures real HTTP, gRPC, WebSocket, and database traffic flowing through your running service using eBPF at the Linux kernel level. Every captured request becomes a YAML test case with auto-generated mocks for every downstream dependency. On every PR, Keploy replays the committed fixtures against the rebuilt service and fails the build on any behavior change. Unlike hand-written tests that cover what a developer thought to check, Keploy covers what users actually did — which is typically a broader and more meaningful regression surface.
See Keploy Regression Testing for the product page and CI/CD Integration for the exact GitHub Actions / GitLab CI / Jenkins workflows.