“A bug is simply a test case you forgot to write.”
Keep the test suites maintained along with the code; when you check in new code, run against the regression suites to make sure you didn’t break anything
Adding new features means adding new regression tests