DISQUS

Chris Pratt: An Introduction to Behavior Driven Development

  • Hans-Eric Grönlund · 2 years ago
    This is the first time I hear about Behavior-driven development, but to me it sounds exactly like TDD - at least in the way I use TDD. I'm looking forward to your next post; comparing rSync with xUnit will probably help me chisel out the differences.
    Great post!
  • Dev · 2 years ago
    To me sounds like functional testing :)
  • Peter Thomas · 2 years ago
    I agree, with the first comment, I was expecting an "aha" moment (after which I would jump on to the BDD bandwagon :) - but what you have described sounds exactly like the unit tests I write.

    I would like to see something in real code, ideally compared side by side with a TDD approach - in order to be convinced that this is just not yet another "snake oil" concept.
  • Chris Pratt · 2 years ago
    Thank you all for your comments. Sometimes what you write makes sense to you, but you come to find out that it doesn't necessarily make sense to others. This seems to be the case here.

    Dave Astels, the front-runner advocate of BDD, explains the difference between TDD and BDD thus: "BDD is what you're doing if you're doing TDD really well."

    I think I made too much out of the differences between the two methodologies, but they are really quite similar. The chief and primary difference between BDD and TDD is that of semantics.

    The goal in both methodologies is to test behavior rather than state. By that, I mean that we want our tests to be implementation independent. All my test should care about is that the functionality is there, not how that functionality works.

    And that is where the chief problem with TDD comes. Because of its test-based nomenclature, it's more tempting for people to test the bits and pieces of the application rather than the central functionality. BDD is a reformulation of TDD, using more behavior-specific nomenclature, based on the Sapir-Whorf theory that language influences behavior.

    In other words, all BDD does is remove the word 'test' from the playing field, so that it's easier to focus on the true purpose of TDD: specifying behavior.