I’ve read lately three very interesting articles about “Why OK not to Write Unit Tests”, “Selective Unit Testing - Costs and Benefits” and “It’s Okay to Write Unit Tests”.
All these articles have valid points, but needs to be take into context of the overall development practices.
Here is my 2 cents and why developers like to be spoon fed. Since people have been born they had to be spoon fed in live, food and education. You can’t deny it! You always needed help.
Now this is where unit tests come into play with production code where they help the developer to be spoon fed to understand the API of the system. And YES it is necessary, because if someone new joined the project someone has to guide and explain to him how every little bit of the system works. That could take a couple of days.
I would rather tell the newcomer to look at the unit tests, play with them and you will understand the API and processes of the system. Everyone likes code, otherwise you are not a developer and get out!
That is my 2 cents to the whole discussion going on between the relevant articles.
Until next time!
Cheerio!