Thursday, May 27, 2004

TDD for amateurs...

I do like Test Driven Development. I really do. I can see how it (along with the other aspects of agile programming, eXtreme programming and the like. I can see how it can create quite a clear focus, expected outcome --> test --> code to pass the test. It sounds great.

I really can't get myself motivated to do it, though. The problem with being a hobbyist developer is that you never have a properly specced project. It's always something focused on what you know/what you're interested in/what you want to do. Because there's no 'client' to satisfy, you end up with a very organic development process. There's rarely a clear outcome at the beginning, and so, you can't write the tests to produce that outcome. Now I guess you could argue that if you're ultra disciplined or ultra skilled, then that doesn't matter. You can write your code, and you'll be able to make sure it fits nicely and all the rest. If you're not, though, it can be a it frustrating.

Not too bad, though. I've discovered that there are very few coding mistakes that can't be brushed under the carpet with an inherited class.

Test Driven is really good, though. The few times I've managed to keep myself disciplined enough to write the tests and develop from there have been really good fun. I'm focused, and there are a whole load of really quick wins. Which is nice.

I guess I really should start writing the tests and coding around them again. Of all the things I miss, NUnit's big green bar really does fill me with joy!

No comments: