So there was listening to Andrew Woodward explain how useful test driven development was and all I could hear is, "blah blah blah . . . Stacy, you're going to have to write a lot of code . . . blah blah blah . . . that is only ever going to be sued for testing . . . blah blah blah". Then he said something that hit very near and dear to my heart, "It's like when you snuck that first sip of your dad's beer. You probably didn't like it at first, but then you have this epiphany moment where you’re like, ‘god bless this drink! This has to be the best stuff ever!’ that can happen for you with TDD” after that he had my full attention because I totally get that! I’ve seen Andrew appreciate beer so, I know he knows what he’s talking about. That comparison grabbed me so intensely that I decided that I’m going to keep knocking back TDD until I get it. A few hours afterwards I was chatting with some pals Chris O’Brien and Gary Yeoman and I had an epiphany of when to use it. Well at least I have my idea of when to use it.

My .02 conclusion:
• Whenever you’re going to go back to code you haven’t been in a while.
• A team situation where a unified testing methodology would prove useful.

I usually write test harnesses for code that I’ve written and they usually change and after I’ve finished using them I don’t know how the heck to use them so I can’t imagine anyone else does. So this is kind of neat, but it’s not very often that I have to go back to code. Recently I’ve been more of a break fix kind of guy, Microsoft sends it out broken and I fix it. If it’s not that then my project is, “Hey I got this idea. Can you do this real quick because I want to demo it this afternoon?”
“Sure”

So currently I don’t feel like I have a project where I have the luxury to apply TDD, so I had to find something. I put this TDD hammer in the back of my head looking for a TDD nail. I saw Andrew’s presentation where he did some a web part with a magic 8 ball. That was too much too fast for me. I really just want something simple. He also had a hello world, but I guess I just needed a project of my own. So talking with a friend of mine, who lives 250 miles from me but I only ever see him when we travel over 2000 miles. In one of his books he included some tiny url like functionality. Domain.com/go/someNumber and I asked him how he did that with the whole intention of ripping off his code to use in my site. Turns out he didn’t have any code for it. Just creates a folder and puts a default.aspx page with a big ole fat Response.Redirect in there. So I thought ok I’ll build an http module that’ll read from a SharePoint list. I tried to do TDD on it and failed miserably. Frustratedly I went ahead and created a second web project and resorted to my typical test harness. At this point I’m really mad with myself. ‘Cause I really like beer and if TDD is that good then I really gotta get there, to that one epiphany moment, where I say, “God bless this technique!”
So I pinged Andrew, and offered to hire him to teach me this TDD of which he speaks. He said that he’d help me for nothing since I was building a codeplex project. What a cool guy! This project, in combination with his blog at www.21apps.com is the learning experience of using TDD to build a pretty simple sub system.




Last edited Apr 23, 2009 at 8:33 PM by stacyDraper, version 1

Comments

No comments yet.