TDD – a better option for developers with ADD
September 8, 2012 3 Comments
So I’m back on the unit testing kick again. In my defense, I do spend an awful lot of time thinking about them – either feeling guilty about not writing them, or thinking about them as I code them, then (optimistically making it sound like I write tests first) or thinking about the testability of a particular piece of code as I write it. They are dear to my heart, in a strange kind of way. Part of me loathes them – being a pale approximations of actual applications behaviour, and the rest of me has only ever found them useful. Either proving my code, having decisions I (or those before me) have made confirmed to be conscious or driving my design. And that’s what I want to talk about. Test Driven Development.
I’m fairly convinced that most people don’t have a firm grip on what Test Driven Development is. Before we begin properly, I’d like to mention that I have actually read the book by Kent Beck. Including the code examples!
Now that my credentials are clearly proven and sufficient, I’d like to start by saying that test-first and test-driven development are not the same thing. That’s where most people get it wrong. Both are Good Things, but I favour test-driven development for a couple of significant reasons.