The code base should have automated tests that cover a large percentage of possible test combinations using relevant test data. The automated tests should be developed using a suitable test framework that can cover all tiers or parts of the software project.
With proper automation tests in place, bugs in the source code can be easily detected when the automation build script runs. Integrating automated tests into the build process will ensure that good test coverage and reports of failing or passing tests are provided to facilitate refactoring of the code.