Learning the Powers of TDD and much more

As Some of you may already know was lucky enough to win a place at Roy Osherove’s TDD Master class. I had a fantastic time and although the learning curve I experienced was steep the topic could not have been taught in a better manner. I had jotted down a brief overview of each day’s events and thought I do a brief run through.

Day One:
Day one found us getting to grips with Nunit and the concept of unit testing, naming conventions and refactoring. I discovered I was pretty bad at refactoring and I wish I’d realised how helpful it really is sooner it’s incredible just how much time it saves when trying to maintain the code. Day one also exposed me to my first proper experience of pair programming. This proved invaluable to me, where before I would find myself hesitating about making a decision on how to code something all it took was a little push in the right direction and I was able to commit to the code. Don’t get me wrong it wasn’t always right but then I’d be shown a better way.

Day Two:
First on the agenda for day two was a pair swap, getting to work with different pairs exposes you to the different ways in which people work, I believe even if you’re at the top of your game you can learn something from everyone, I my case I can learn a lot from everyone! Next we began with the mornings Kata, this went a lot quicker than the previous day but didn’t even reach point 4 in the criteria with in 45 minutes let alone in 30 minutes!

We explored Nunit further and were introduced to the idea of mocks and stubs. We explored manual mocking and NMocks (not something I ever really want to explore again but I am glad I’m aware of it and makes me appreciate the other mocking frameworks a whole lot more!)

Revelation of the day was the idea of ‘Mouselessness’. It is in fact liberating and if you are using ReSharper (or other similar products) and maximising the usage of short cut keys and snippets you are so much more productive. I was thinking about doing a post with my shortcut keys and asking everyone to post theirs, what do you think?

Day Three:
Day three and a new partner brings a new go at the kata. This we are much faster..well I say that but we had a “Warm up” for half an hour and then were told to start a new project all over again, this time we were much better, much quicker and even reach the beginnings of point 4! Roy insisted I focus on my refactoring on day three it’s something I found hard to force myself to do, you know when you get into coding, your tests are running and you [think] you’re flying…then you look at your code and “That’s the ugliest code I’ve ever seen”. Bah…must be more strict with myself. Aside from that we when through Extract and Override for testing static methods and we explored TypeMock (leagues above NMocks and SO much easier to get your head round). Day three also made me realise that using a framework wasn’t ALWAYS necessary and you should assess your needs as maybe manual mocking is more suitable at times, I often find it more readable yet less maintainable.

Day Four:
Day fours kata and with a new pair we were getting serious! Much quicker this time muscle memory is kicking in right up until point 4 where thinking slows us down but we get more of the way through than last time. Roy also told us to try completing the Kata on our own so that we had experienced what it was like to be back at work minus a pair. We spent the rest of day four going through mocking with Rhino Mocks and Moq, the benefits and downfalls and what to watch out for.

Day Five:
The final day and final pairing, kata was the fastest yet and had we had five more minutes I’m sure we would have met the criteria. So I’ve taken it back to work and am determined to meet the criteria sub 30 minutes. The rest of day five was spent doing test code reviews and looking at legacy code. Roy explained to us that even if we didn’t know what the code was really doing we could look at a test and look for the “warning” signs of a bad test. We went through a number of projects highlighting issues and providing reasoning for selecting those as issues. At the end of the day we had a round up and went through some more specific questions people had.

Overall the course was extremely enjoyable, informative and interesting, I would highly recommend it too anyone interesting in learning TDD. If you need more infomation you can find it here.

If there is anything you would like me to expand on let me know and I can make it one of my future posts

Filed under: Technical, , , , , ,

3 Responses

  1. Bill Says:

    Hey Sara,

    Thanks for taking the time to go into all this detail. Good stuff! I have Roy's book and saw several sessions he did at NDC2009. I'm sure this was awesome live! I was wondering about the Kata that you did each morning. Could you talk about that a little more as to what kind of things you were doing? Really curious.

    thanks!
    Bill

    Posted on September 29th, 2009 at 18:57

  2. Bill Says:

    Sara,

    Just after posting my comment I see your blog on Going 'KATAtonic' . DUH! :) Wow – you answered my question before I even asked it. LOL! Thanks Again!
    Bill

    Posted on September 29th, 2009 at 19:01

  3. Developer Dame Says:

    haha Any time ;) I guessed people would ask about the Kata so I had it already :)

    IF there's anything else I can go into let me know.

    I'm thinking about doing a very basic explaination about mocks and stubs, more to get affirmation in my own mind, but it could help others what do you think?

    Posted on September 29th, 2009 at 21:52

Leave a Reply