They drive your design. You write a test, add code to fix the test, refactor code with confidence, and apply the design. This results in a simple, clean, maintainable, loosely coupled, and cohesive design. You write code to satisfy a failing test, so it limits the code you write to only what is needed.
The tests provide fast, automated regression for refactoring and enhancing the code.
You should configure your tests to follow the following principles:
Tests should be reliable. Tests should fail if the production code is broken. Your tests will be considered unreliable in situations where you break the production logic but the tests pass, or you don't touch the production...