The Value of Unit-Testing Perfect Code
Unless you've done a fair amount of unit-testing, it's simply impossible to understand all the advantages that are to be gained from it. A lot of the focus has naturally been on the positive effects of unit-testing on the current state of the code: it helps you find the bugs. Duh. But there are also huge benefits to the future state of that codebase that are often overlooked. In a nutshell, unit-tests ensure the ongoing health of your codebase and the consistent flow of your development. Here's how:
Better regression testing when the code changes.
Manual testing is boring, tedious, time-consuming, and above all, error-prone. If you invest the extra time to automate a test, and then the machine can do the tests for you in a way that's superfast, complete, and mechanically consistent, you'll test more often and more comprehensively with automated tests.
Better on-boarding.
Unit-tests serve as a kind of indicator of how code should be consumed, and what it is expected to do. They're not meant to supplant good (internal or external) documentation, but unit tests can serve a lot of the same goals as documentation and they tend to be better maintained; if you don't maintain your tests as code changes, you'll get failed tests. Documentation doesn't have an automatic check like this, and can go stale more easily without proper vigilance. New-comers to your codebase will be able to make changes with a great deal more confidence too, because there's an easy way for them to tell if their changes have caused a regression.
Improved velocity.
Code written to be unit-tested is code that's better factored. I strongly believe that without significant unit-testing experience, a developer can't imagine the myriad of ways that he/she factors things improperly. It certainly was an eye-opener for me. Better factored code leads to faster development (easier code re-use, better understandability, etc). Couple that with faster testing and fewer defects and you get vastly improved velocity in your development process.
It's natural for managers and developers to question the extra time taken to write unit-tests, and to put value on them only equal to the number of defects they uncover when first written, but there's a whole lot of extra value that you get from them afterward as well.
This might be one of those things that has to be experienced to be understood. It definitely was for me.