TDD (Test Driven Development) is a software development process where your code is driven by tests. It follows the red-green refactor cycle, which has the following standards:
- Write test for a small chunk of your functionality
- Watch it fail (red)
- Add code so the test will pass (green)
- Repeat 1 to 3, until your functionality is complete
Time spent writing tests for your application is always time well spent, because it gives you confidence that your code works like it should.
With a full suite of regression tests to back you up, you will know that both you and your team will be safe when refactoring or adding new features.