For me, the problem with using test-driven or behaviour-driven development while working on my own projects is that these projects are largely learning exercises. I’m not working for a client, and I don’t have a fixed specification to work to. If I think something is too hard for me to do right now, I can just not do it. Equally, to find out if I can do something I need to poke and play and fiddle with things.
All this fiddling doesn’t sit well with big honking red test fail messages. I’m not trying to make a proper thing, just figure out how the bits work. So I don’t write tests and I just play around a bit, and it’s all good, right?
Except that the playing and fiddling does have a goal behind it, and as I learn how the bits go together the fiddling becomes more directed until I’m actually building the application. And, oops, still no tests. This is what happened with Failcount.
So I’m taking a new approach for the next project. I’ve been fiddling with ym4r, GeoKit, and Paperclip enough to learn how to do what I need each of those tools for. I’ve got a pile of junk in a git repo, and I’m going to scrap most of it. I’ll keep some things (like config files) around just to save copy/pasting API keys and nonsense again, but the rest is going away.
By starting out from scratch again I can produce code in the proper way without worrying about if what I want to do is too hard and without my ‘play time’ code encouraging me to just hack and not to it properly.
It seems weird to do be redundant like this, but a little bit of repetitious work is worth it to keep my bad habits at bay.
Comments 1
This sort of build-it, scrap-it, test-drive-it cycle is very common when you’re unfamiliar with the technologies you’re working with. Normally you’d time-box these development spikes so you don’t wander off too far without adding value to the code – I tend to set my limits at about 2 days for a spike, but you’ll probably have a different value that’ll work better for you.
Abdel wrote about prototyping which looks at some of this stuff: http://kords.wordpress.com/
Posted 15 Apr 2009 at 3:55 pm ¶Trackbacks & Pingbacks 1
[...] kind of goes against my earlier post about not keeping learning projects around for too long, since a play-around with RMagick turned into something that’s living on my deployment VM, [...]
Post a Comment