One of the best practices to ensure quality and to protect yourself from regression bugs (those that happen when you modify something, and reintroduce an earlier, previously corrected, bug) is to make sure that your code is unit tested. There are three types of testing:
- Unit testing, which applies to each component, on their own
- Integration testing, which applies to components working together
- End-to-end (E2E) testing, which applies to the system as a whole
Unit testing is good—not only because it helps try out your code, but because if done well, as in Test-Driven Design (TDD), in which you basically first set up the tests, and only then write the code—as it will help produce code of a better quality, and this will surely have an impact on reducing bugs all over your system. (Finding bugs even before any testing work begins is also a money...