For the 7th Codejo I was my usual organised self and had @phpcodemonkey remind me about 5 days before the event to send out the invites and get something sorted. Whoops! I suggested we did a BDD session focussing on the Checkout Kata.
Well this went down a storm. After a sleepless night (due to ferrets), @seanhandley offered to help me with the advertised rspec and cucumber, which I gratefully accepted. However then I thought about all of my arguments against using BDD frameworks, recapped on these blog posts:
And decided to spend the first hour doing what BDD does best, having a conversation. Being grilled by Sean en route really helped.
I explained my journey into understanding BDD, gave examples of how not to do it, got the group to question me as a client (or corner shop owner) and after an hour of intense conversation, ideas and questions, we moved onto a Randori.
We attempted the checkout kata using BDD approach without a framework in Ruby (we used Test::Unit). Started off with a test:
def test_buy_an_apple_as_a_checkout_assistant given_an_apple_costs_fifty_pence and_i_scan_it when_i_press_total then_the_total_is_fifty_pence end
What pleased me the most about creating this test was that every single person in the room said it was shit. This was brilliant. The hour long conversation and me explaining TDD had worked. No frameworks. No gimmicks. Just conversation and questioning the content, context and quality of this test.
Having attempted to give this talk/workshop a few times now I was incredibly pleased with the results for the very first time. People understood! We then applied our good TDD skills we’d leaned with good failing tests, simplest to green and then refactoring. When we fund a test too difficult to answer simply we threw it away and refactored until we could add it. All the while questioning the tests we were writing.
What was especially interesting was speaking to @phpcodemonkey. He has a background in mental health, certificates to show how great an active listener he is, and he left it all (after a good few years and an impressive career) to start a software company. He recognised a lot of techniques from his previous career and could really see the potential in having a language that he, clients and developers could use as documentation, a focus and a conversation point.
I really enjoyed that! ^_^ Thanks to all of you who missed the football and came along.