What if I worked with a story to being with?
I’ve been working on a pet project, just to see if my idea was possible at all. Central to the idea was sharing of content between users, and I wanted to see if I could build a model to make it work on Google AppEngine.
Now I started out with some spec-style unit tests to make sure that it was feasible. Then when I started to see some progress started to bone out a walking skeleton for the application, a thin red line.
However somewhere along they way I drifted off testing the primary entity of the application and instead the focus was around one of its neighboring entities. The reason was that the other entity is central to controlling the sharing but its not the entity shared. Once my walking skeleton was complete I noticed that I had indeed created a model that solved the wrong problem.
Now all was not lost, I changed the tests that had drifted off in the wrong direction and a few hours of intense thought later I had conceived a model that solved to correct problem. I had my spec-style unit tests in python covering my refactoring and most of the skeleton still worked after I refactored.
To rethink my model I went back and wrote down what I wanted to achieve in a story format. The tests I rewrote became more like Given When Then than the spec style that was a result of the initial unit-testing.
So now I can’t help but wonder, what if I had had a cucumber acceptance test to begin with?
I’d be forced to consider what I wanted to solve on the correct level of abstraction, and I might not have drifted away from the original idea.