Scrabbling up the Learning Curve

A few months ago I was at the peak of my powers.

I was leading a team of ten C# developers building a huge project on Microsoft’s .NET platform. I had been working on the Windows platform for years, and there was rarely a question from the team I couldn’t answer quickly and confidently, drawing on a deep well of past experience.

When doing TDD it goes without saying that you write the spec or test before you write the implementation. When that implementation will involve an interaction with some dependency, you’ll need, as part of your spec, to precisely describe the way that interaction will happen in terms of mock object expectations, or some other sensing on a fake of the dependency.

In order to do this quickly and easily, you’ll need to

  • Understand the API for the dependency (or at least the subset you’ll use)
  • Know how to express the interaction with your dependency in a mocking framework.

As I start to learn ruby and the rails framework, I’m quickly realising how much harder it is to do TDD when you don’t have a clue what you’re doing! Or more precisely, you don’t know the system APIs well enough to confidently say how you’ll want to call them to get the behaviour you want, without a little prior experimentation. And even when you do, you may not know your local neighbourhood mocking framework well enough yet to ask him to do some more involved stuff, like validating arguments sent to mocked out methods.

When you hit that ‘how do I…’ barrier, it’s tempting, often even necessary, to break out of the TDD rhythm and do some ‘scratch coding’ as Michael Feathers would call it.

Just make sure you roll-back your working files before you write that first test, cowboy!

Published by Matt

I write software, and love learning how to do it even better.

Join the Conversation

1 Comment

  1. Hi, I was reading your post about a single sing-on (http://blogs.neudesic.com/blogs/michael_morozov/archive/2006/03/17/72.aspx), and I need help !!
    I have the same problem you had, you said: “My solution was to pass the referring URL in the querystring as I redirected back and forth”, can you clarify me this part?? I think I must change the code in the other end (bar.com) and pass the url in the querystring, because I always receive the same ulr in Request.UrlReferrer in Foo’s site.

    I hope you can help me. If so, please email me in aldo_martin@hotmail.com

    Aldo

Leave a comment

Your email address will not be published. Required fields are marked *