acts_as_conference 2008 : BDD With RSpec
Brian LeGros | February 10th, 2008 | conferencesAfter lunch we came back to Bryan Liles presentation on BDD which he retitled from “BDD with RSpec” to “BDD for Normal People”. Bryan is definitely a kindred spirit of mine, if only in his sense of humor. He was a great presenter and put a great face on the his own approach to TDD and BDD. What I liked about the presentation was his ability to bring practicality into the mix and give his audience direction and a place to start on their test driven journey. In any case, on to the topic at hand.
Brian started out describing his own journey into testing and some of the struggles involved. He pointed out that as most of us begin to integrate testing, many of us are adopting different approaches but still writing poor tests to cover poor quality code. Brian identified that tools can help us in our journey by introducing more clear test names and concepts such as context, but we still have to apply these tools more effectively. He gave the following steps as a basic guide to BDD:
- Get comfortable with the concepts in TDD.
- Make it your mission to practice TDD all of the time (even when it hurts).
- Think of your application as objects expressing behaviors.
- Create examples of those behaviors [and use them as the basis for your tests].
He expressed that TDD is painful and there is an upfront cost, but that upfront cost is migitated by the quality of the tests you produce and the less trouble you have as the software grows.
On the practical side of things, Brian, although praising what RSpec has done for testing in Ruby, suggested looking into alternatives that work a little better under the hood. He suggested sticking with Test::Unit, shoulda, and RSpec StoryRunner as he’s had the most success with this combination. Additionally, in the questions segment, Brian said he doesn’t have much faith in code coverage tools and only uses them to show a relative change in coverage to confirm that coverage has gone up or down.
Overall, I’ve got a lot of new topics to read on, and I’m sure Dan and Tyler will be happy to see me giving TDD/BDD another shot. Great work Brian!
NOTE: I forgot to mention the most important note from the entire presentation … TDD == BDD, it’s just a matter of perspective. Thanks to Dan for reminding me of this.
