Unit tests are an extremely useful software development technique. A good suite of unit tests can do the following:
- Speed up deployments by automating the boring parts of regression testing.
- Enable professional testers to find the hidden issues rather than running the same test plan again and again.
- Remove bugs very early in the development process, thereby reducing the cost of finding and fixing them.
- Improve the software design by providing feedback as a first client of the code structure (if tests are complicated, most likely your design is complicated), as long as the developers know how to see and interpret the feedback.
- Increase the trust in the code, hence allowing for more changes, and thereby facilitating refactoring that speeds up development or removes risks from the code.
I love writing unit tests. I love figuring out the interesting test cases...