Regression Testing: Don't Break What's Already Working
Regression testing asks: 'Did my new code break old features?' It's re-running existing tests after a change to catch unintended side effects. It's crucial in CI/CD pipelines before deploying. The footgun is a slow suite that developers skip.
Why it exists
Software is complex and interconnected. A change in one module can have ripple effects, breaking seemingly unrelated functionality. Regression testing was created to systematically detect these "regressions"—when a feature that used to work stops working after a change. It provides confidence that a new feature or bug fix doesn't come at the cost of existing stability.
The mental model
Think of it like a doctor prescribing a new medication. They don't just check if the new drug treats the target symptom; they also run standard tests (blood pressure, heart rate) to ensure it isn't causing harmful side effects elsewhere in the body. Regression testing is that standard checkup for your codebase after you've introduced a change. It verifies that the "patient" (your application) is still healthy overall.
How it works
After a developer commits a change, an automated system like a CI/CD pipeline triggers a pre-defined set of tests. These are not new tests for the new feature, but a curated collection of existing functional and non-functional tests covering the application's core functionality. If any test that previously passed now fails, the build is marked as "broken," and the change is blocked from proceeding to production until the regression is fixed.
When to use it
Regression testing is essential in any project with a continuous delivery model. It should be an automated step in your CI/CD pipeline that runs on every merge to the main branch. It's also critical before major releases or when refactoring large, sensitive parts of the codebase. The goal is to catch regressions as early as possible, when they are cheapest to fix.
When not to use it
You don't run the full regression suite for every single keystroke while developing locally; that would be too slow. Instead, developers might run a smaller, targeted subset of tests relevant to their changes. The full suite is reserved for integration points, like pull requests. The key is balancing test coverage with feedback speed.
One canonical example
A developer fixes a bug on a user profile page by changing a shared CSS file. The new test confirms the fix. However, when the code is merged, the automated regression suite runs. A test for the checkout page, which also uses that CSS file, now fails because the "Proceed to Payment" button has disappeared. This is a classic regression caught before it reached a customer.
Interview question
What is the primary goal of implementing regression testing in a software development lifecycle?
- a.To ensure that newly added features function correctly according to specifications.
- b.To confirm that specific bugs reported by users have been successfully resolved.
- c.To verify that recent code changes have not adversely affected existing, stable functionalities.Correct
- d.To measure and improve the application's overall performance and scalability.
Why? this is the answer
Option C accurately describes the core purpose of regression testing: to catch unintended side effects on existing features after changes. Option B describes retesting a bug fix, which is distinct from regression testing's broader scope of checking for unintended side effects across the entire system.
Just read this? Test yourself on what you have been reading.
Read the original → en.wikipedia.org
- #testing
- #ci/cd
- #automation
- #quality assurance
Put your scrolling time to good use
Learn one idea, try a quiz and save useful cards for revision. Tezvyn makes it easy to learn and stay current in your tech field, a few minutes at a time.
The iPhone app is on the way
We are building it. Until it lands, nothing here is held back from you: every interview card, your saved cards, streaks and the job board all work in Safari, plus hundreds of free practice quizzes of thirty questions each. Sign in and it all carries over to the app the day it arrives.
Want it as an icon? Tap Share at the bottom of Safari, then Add to Home Screen. It opens full screen and the cards you have read stay available offline.
We are hiring for this. Open roles that interview on testing — each one lists the topics its interview covers.
See open roles