Regression Testing

Regression Testing is a method of automated software testing. The idea is simple: whenever you come across a bug, you write a test to replicate that bug. This test will ensure that the same bug will not be introduced in the future, and that whatever fix you come up with doesn’t get removed for some reason.

The method can be well-combined with TDD: whenever a bug is found, first write a test to reproduce the bug, then come up with a fix. This forces you to “formalize” the bug, and can help clarify what it is that you’re actually trying to fix. Doing it this way around can also save a lot of time, as trying to write a test first will allow you write a lot of tests that do not fail, which increase your test coverage, but they also narrow down onto the bug itself, which makes any debugging unnecessary, or at the very least less important for actually figuring out the fix.