Re:Unit testing is not (generally) useful
by swombat on Thursday February 05, 2009 @05:25PM
(#468875)
Also, TDD/BDD are most useful as design practices - not as bug-finding practices. They help you think more carefully about your design and make it more modular and clear.
[ Parent
| on HN ]
I agree entirely. Whenever I leave out writing unit tests, I end up with a web of messy interdependencies which ends up far too hard to extend, and will always need refactored as soon as I need to add the smallest feature.
Writing unit tests up front forces me to write the code in a way where inputs & outputs can easily be stubbed out, which in turn makes writing messy interdependencies simply too hard!
Basically, if I write with unit tests, it becomes easier to write maintainable code, and harder to write unmaintainable code.