Not everyone is a fan of test-driven development.
Writing unit tests for your code can be a laborious task, and it has no immediate benefit to your customers. So why waste any time writing the tests, right?
This past week, a colleague of mine summed up the problem pretty well:
He’s not following test-driven development. Instead, his tests come in as an afterthought. Actually, most of us code this way.I’ve finished writing the code for that feature. Now I just need to take some time to sit down and write some unit tests for it.
We write a chunk of code to perform a task. Then a customer asks for a new feature, so we write some more code. Then a new hire comes in to the company demanding we take some time to go back and document our existing code base with unit tests.
It’s not fun. It’s not glamorous. It feels like a waste of time.
But I still feel it’s the way things should be done. [Read more…]