Read my latest article: Was away on vacation (posted Sun, 11 May 2008 22:33:00 GMT)

Is BDD kinkier than TDD? 12

Posted by Robby Russell Thu, 08 Feb 2007 19:20:00 GMT

If you’re in need of a compelling reason to switch from Test-Driven Development to Behavior-Driven Development... consider this.

“BDD sounds kinkier.” -Michael K. Loukides, Book Editor for O’Reilly

...on that bombshell... I am going to suggest that this be used as the official BDD logo.

There you have it. Deep down… the biggest reason that I switched from Test::Unit to RSpec... was the sex appeal. ;-)

What was your reason?

Subscribe to my RSS feed Enjoying the content? Be sure to subscribe to my RSS feed.
Comments

Leave a response

  1. Avatar
    Tim Case Thu, 08 Feb 2007 20:55:43 GMT

    BDD helped save my marriage…

  2. Avatar
    John Thu, 08 Feb 2007 21:16:48 GMT

    TDD has lead me to testing dysfunctional syndrome.

  3. Avatar
    Douglas Fri, 09 Feb 2007 00:19:56 GMT

    I reviewed the BDD site and I don’t understand what the major difference is behind it. Could someone please explain what the difference is?

  4. Avatar
    Stephen Waits Fri, 09 Feb 2007 05:42:17 GMT

    Douglas, lots of people feel the need to invent their own stuff, even if it’s the same thing. The BDD folks spend more time trying to justify its difference from TDD than they do actually explaining BDD itself. It’s nothing.

  5. Avatar
    Robby Russell Fri, 09 Feb 2007 07:01:04 GMT

    Stephen,

    Thanks for the providing (yet another) great comment on my blog. :-p

    Douglas,

    One important difference between TDD and BDD is that BDD is (in my opinion) a far better communication tool between stakeholders in a project. The same specifications that I create with a client can be added to our spec files and organized into different contexts. When working with method names that are in simple… plain text… the communication between developers is much easier to understand.

    It’s not uncommon for me to work out a specification with a client that looks like the following.

    A new subscriber should have their first invoice set to be emailed in thirty days.

    ...which translates to a RSpec file like so:

    
    context "A new Subscriber" do
    
      specify "should have their first invoice set to be emailed in thirty days" do
        # add stuff
      end
    
    end
    

    Specs are so much nicer to work with and I am hearing that a lot of people new to the TDD/BDD world are having a much easier time getting into the spec-first mode than test-first.

  6. Avatar
    dagny Fri, 09 Feb 2007 15:03:36 GMT

    kinkier?? And I used to argue when nongeeks say the internet is all porno, spam, and scams.

  7. Avatar
    Stephen Waits Fri, 09 Feb 2007 21:31:02 GMT

    Robby, you’re welcome. Count on me to keep it real. I think your blog’s great when it doesn’t go into magical mythical stuff. Keep up the good work.

  8. Avatar
    Robby Russell Fri, 09 Feb 2007 22:57:17 GMT

    Stephen,

    Define… “magical mythical stuff” for me. :-)

  9. Avatar
    Stoffe Sat, 10 Feb 2007 18:49:54 GMT

    I would have liked to see more in the docs on a recommended practice how to do this for whole projects, as is easily done with Test::Unit. I think that creating say a “spec” directory and putting specs there and then running “spec spec” or better, making such a rake task, would be the right thing here… but the docs don’t cover it.

  10. Avatar
    anonymous Sun, 11 Feb 2007 02:42:03 GMT

    I’d suggest a new name… “Behavior Driven Specification Mechanism”, or…

    wait for it…

    BDSM.

  11. Avatar
    Robby Russell Sun, 11 Feb 2007 19:03:30 GMT

    Stoffe,

    The RSpec for Rails plugin includes rake tasks for this.

    For example:
    
    rake spec:models
    rake spec:controllers
    

    ...and many more! :-)

  12. Avatar
    beppu Wed, 11 Apr 2007 13:18:38 GMT

    @Stephen:

    On a technical level, BDD and TDD aren’t that different.

    HOWEVER, The focus on behaviour in BDD changes the way you think. You get to put your API designer hat back on and think to yourself, “My code should look like this; calling this method should do that; etc. etc.”

    And you take those thoughts, and translate them directly into a specification. And with something like RSpec, the translation from thought to code goes very smoothly.

    It’s so readable and so beautiful relative to what we’ve had to work with so far.

Share your thoughts... (really...I want to hear them)

Comments