Another kind of “BDD”: Bullet Driven Development
QA is boring. Let’s write our tests with bullets!
Cucumber is great but …
I’ve used Cucumber for test automation for a lot of my career, and honestly I’ve been pretty happy. It’s a great way to pull one’s thinking out of the granular code level, and starting thinking about domain or enterprise level problems. I don’t think I’ve ever reached the BDD holy grail of Product writes it, Dev implements it, and QA verifies it, all from the same spec, but … well hell, who actually drinks from a grail these days anyhow.
Meanwhile, working on my own apps, I find myself wanting to implement a TDD / Test Driven Development approach. Apparently though, when it’s my time we’re talking about …
Well, I don’t want to write all that long-winded Gherkin. I want an obvious set of tests conceived and detailed asap, then implemented easily. Or, if while coding I have a blast of r̶a̶n̶d̶o̶m̶ ̶p̶a̶r̶a̶n̶o̶i̶d̶ ̶f̶u̶s̶s̶i̶n̶g̶ brilliant test ideas, I want to record my test cases quickly in rough notes, and I’ll implement them later on.
“Futo” is Japanese for “envelope”
The idea goes something like,
What if we were brainstorming our future app at a restaurant on the back of a napkin or envelope ?
The Killer App
* loads successfully
* does some things
* calculates some stuff
* charges happy customers
* profit !
“Chizu” is Japanese for “Map”
Implementation, inspired by Cucumber’s
step_definitions layer, looks like this:
On "loads successfully" do
On "does some things" do
On "profit !" do
expect(earnings).to be > costs
A pretty simple concept, and it’s working so far on a little Rails project I’ve got cooking. I love not having to think about Gherkin. Just make a bullet point and write what you feel. The rest can solve itself.
For the curious
The initial code is on Github and RubyGems, an early prototype so far (works though). Some developer friends are planning to try it out with a React Native project over the summer and fall as well, so I’m hoping to have lots of a̶n̶n̶o̶y̶i̶n̶g̶ ̶b̶u̶g̶s̶ great progress over the summer and fall 2020.
See you in the Matrix :)