<< Pair Programming or Mandatory Code Reviews? | Home | Macbook Pro Battery Issues - Get Yours Replaced up to Two Years WIthout Apple Care >>

JP Solves My BDD Woes

posted @ Thursday, November 29, 2007 4:00 PM

Mr. Boodhoo to the rescue once again.  I recently posted about how I really liked the Behavior Driven Development approach to building an application test-first, but I was struggling with the naming conventions I was coming up with when trying to organize and group my tests and fixtures using the same BDD contexts. 

Apparently after a recent pairing session with Scott Bellware, JP came up with a solution that is both elegant and ridiculously simple.   It seems distilling challenges into elegant and simple solutions is something JP does 20-30 times a day, leaving observers with big red hand prints on their foreheads, mumbling "why couldn't I think of that?"  That's what makes him the Michael Jordan of .NET.  The irony behind the "Nothin' But .NET" name for the training he offers is not lost on me!  And let's not forget Scott, who I think JP has credited as inspiring the whole BDD approach and test naming style he has adopted.  Maybe that makes Scott the Dennis Rodman of .NET?  I leave that to the fans to debate.

To summarize, he names his Classes (and corresponding files) as <SystemUnderTest>Specs, and then creates separate classes inside that specs class for each context.  My stumbling point was that I was naming my classes by context, and couldn't think of a clean way to group by SystemUnderTest, and was ending up with horrible class names.

Read his full post to see how this style breaks down into a very useful specification for your system, and helps you stay focused in and clear with TDD.

Comments

  1. Steve

    Posted on: 11/29/2007 5:27 PM

    # re: JP Solves My BDD Woes

    you have a seriously disturbing man crush on JP :)

  2. Brian Donahue

    Posted on: 11/29/2007 6:34 PM

    # re: JP Solves My BDD Woes

    I think I'm handling it pretty well, actually. I've resisted the urge to move to Calgary and I don't have any framed pictures of him hanging.

  3. Steve

    Posted on: 11/29/2007 8:33 PM

    # re: JP Solves My BDD Woes

    I've heard "admitting that one cannot control one's addiction or compulsion" [1] is the first step to recovery.

    On a more serious note I read JP's post on the train ride home and liked the ideas he presented for organizing his tests. We've experimented with a bunch of different ways of organizing our tests with varying degrees of success. While I don't think we're doing real BDD yet we have been moving in that direction.

    [1] http://en.wikipedia.org/wiki/Twelve-step_program

  4. Scott Bellware

    Posted on: 4/26/2008 5:18 PM

    # re: JP Solves My BDD Woes

    For the sake of historical accuracy, I'm the Michael Jordan. I introduced the idea JP wholly formed.

  5. Brian Donahue

    Posted on: 5/20/2008 3:11 PM

    # re: JP Solves My BDD Woes

    Hi Scott,

    Didn't notice any new comments 'til now. I'm sure you know the MJ comment was tongue in cheek, but I could have been more clear that I was referring to how I've seen JP, during live coding sessions, respond to questions, challenges, new user stories, etc and create elegant solutions on the fly with relative ease. Wasn't trying to claim he invented the jump shot :)

Your comment:



 (will not be displayed)


  Please add 8 and 5 and type the answer here: