Peripatetic thinking
Last Monday night, Skye and I hosted the second Agile Vancouver tech talk. This month’s topic was test-driven development (TDD) vs. behaviour-driven development (BDD). The goal of the session was to give participants some hands-on experience with TDD and a bit of exposure to BDD. Participants were encouraged to bring laptops to the session if they had them or pair/partner up with others if they didn’t.
About 50 participants showed up for the session. Most people worked in Java using JUnit (with one pair using TestNG), another handful used C# (using NUnit) and one group worked in Perl and Python. I wrote my tests using JBehave and showed my solution on the projector to give beginners a bit of a jump start.
For the problem, I built some scenarios from my weekend’s trip to the grocery store. Participants were encouraged to write a solution for calculating the total of a shopping receipt from a list of items. I presented the following 10 scenarios:
We spent an hour working on coding up the scenarios, where most participants made it up to scenario #5. This was followed by 30 minutes of discussion where participants presented their code. The most interesting solution IMO was produced by the Perl group who wrote a simple Regex parser for the items and started implementing a wiki-style DSL for specifying test scenarios.
On the whole, I think that the session went quite well, and most participants enjoyed having the opportunity to sit down and directly try out TDD. I think that we will try to do more hands-on sessions for subsequent tech-talk gatherings, potentially building on what we worked on in this session.
If you attended Monday night’s session and would like to post your solution to the scenarios, please feel free to leave a comment on this post linking to your code. I intend to post my solution for these scenarios at some point soon.
80% technical, 20% social change. This blog is dedicated to finding ways to sustainably release software more frequently.
Leave a reply