I Am Not Myself

Bills.Pay(Developer.Skills).ShouldBeTrue()

TDD Kata Calculator Demonstration

While at Alliance, a couple team members and I got the bug to do Code Katas. We picked up on Roy Osherove’s TDD Kata and started doing it as a team every morning time boxing ourselves to half an hour.

The three of us would hit a conference room and throw an IDE up on the wall with a projector. One person would write tests, another would implement and the third would be the “Business” representative by reading the requirements and making judgment calls on any questions we had. Every morning we switched positions.

This worked out really well, one person would do something interesting one day and the others would pick up on it and start doing it as  well. For example, when creating a list of delimiters we all started out using a List<char>() because we couldn’t remember how to add a element to an array and didn’t want to take the time out of our thirty minutes to look it up. But then John, started using a string to hold our delimiters simply appending any extra ones on that were need. He then performed the split by using “delimiters.ToCharArray()”.

Terry, sick of writing the same setup code for the unit tests for each test, implemented a extension method that wrapped it up nicely so that all our tests were a single clear line.

This was a great way to practice TDD and to learn from my peers. I’ve moved on now from Alliance, but I am going to miss those guys. Hopefully, I’ll be able to get something similar going at the new gig. And, eventually recruit Terry and John… Just kidding, Craig. 8)

This video is just me, but it represents all the things we came up with to improve the design of our earlier solutions. It is also a great demonstration of using ReSharper and xUnit. Be sure to watch it in full screen, so that you can actually see what is going on. Next time, I’ll try some thing bigger. Anyone have tips?

And before you ask, yes you can have my crazy color scheme. 8) Oh I used Camtasia Studio 6 to produce the video. Great tool easy to use. Wish I had $300 to buy a license. 8) Well I’ll try to produce as many as I can in my 30 days.

6 responses to “TDD Kata Calculator Demonstration

  1. Emily Bache April 19, 2011 at 5:53 am

    Hi Bobby,

    I found this screencast via Roy Osherove’s blog. I’m teaching a short course in TDD and I’d like my students to look at some screencasts as an example of what TDD looks like in practice. I like this screencast because it uses C#, (a language they are familiar with), and it solves a straightforward Kata in a logical way, with consistent small steps and frequent refactoring.

    Would it be ok with you if I asked my students to study this screencast? I’ll ask them not to bother you with questions, and since there are only 20 people in my class it shouldn’t overload your server. I’d just like to ask that you don’t take this screencast down from the web in the near future 🙂

    Regards,
    Emily

  2. jwwishart April 27, 2011 at 4:58 pm

    Instead of Camtasia you might like to try this CamStudio. It’s free. Thanks for the video!

  3. David A R Kemp May 24, 2011 at 3:30 am

    What do you use to replace the spaces in the string with underscores? seems really neat.

    • Bobby Johnson May 24, 2011 at 6:05 am

      It was a visual studio macro that I got from J.P. Boodhoo’s website. I currently use AutoHotKey and a script that you can find on J.P.’s site as well.

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

%d bloggers like this: