I tried it for a few weeks. I got mildly test infected, but I don't do it anymore.
I found unit tests are most adequate for the parts of my code I'm the most confident about anyway (i.e., the functional parts). Testing side-effects intensive code (e.g., games) can be done and the discipline can improve your design skills and taste. But it can also drag you into boilerplate addiction and architecture astronautics.
But what really keeps me from writing unit tests is that they are a hindrance for the types of changes that scare me the most: those that introduce far-reaching changes to the interfaces between parts of my codebase. Those kinds of changes force you to rewrite your tests anyway. Thus, they add a cost and a mental barrier without offering the desired confidence in the transition (in a way, tests and code 'validate' each other; part of that confidence is lost while you are refactoring your tests).
To summarize: they help where I least need it, and they are a net hindrance where I'd need their help the most.
I don't do pacemakers or financial software, so I'd rather get the occasional bug during development, and use heavy human testing before release.
I found unit tests are most adequate for the parts of my code I'm the most confident about anyway (i.e., the functional parts). Testing side-effects intensive code (e.g., games) can be done and the discipline can improve your design skills and taste. But it can also drag you into boilerplate addiction and architecture astronautics.
But what really keeps me from writing unit tests is that they are a hindrance for the types of changes that scare me the most: those that introduce far-reaching changes to the interfaces between parts of my codebase. Those kinds of changes force you to rewrite your tests anyway. Thus, they add a cost and a mental barrier without offering the desired confidence in the transition (in a way, tests and code 'validate' each other; part of that confidence is lost while you are refactoring your tests).
To summarize: they help where I least need it, and they are a net hindrance where I'd need their help the most.
I don't do pacemakers or financial software, so I'd rather get the occasional bug during development, and use heavy human testing before release.
I said something on these lines a while ago here:
http://news.ycombinator.com/item?id=46284