Thread:Talk:Requests for comment/Unit testing/advantages of unit testing

I think you have undersold the benefits of having unit tests. Here are two more reasons to have unit tests: Unit tests document exactly how the author expects the unit to be used. Providing known working examples of use makes it easier for someone else to learn to use that unit. My personal favorite reason is that, when it comes time to revise the unit (if it stays, you will), you have a way of assuring yourself that you have not broken the externally visible behavior. I like this because it helps relieve that knot in my stomach when I have to make changes to old code.