UPDATE (2012-01-22): I realized this morning that the credit I gave to Sam
Livingston-Gray below may not have
adequately shown how instrumental he was in getting this project off the ground;
especially since much of his work was done in the private repository from which
this was extracted. So, thanks, Sam. This might not have gone anywhere if you
hadn’t worked to put the idea in practice in our application and helped everyone
on our team learn how to use the approach. I made a few minor changes below to
reflect this a bit better.
We’ve been using Cucumber for acceptance testing at
Renewable Funding since back when it was still part of
the RSpec project (indeed, since before we were even
Renewable Funding). While we’ve always liked the ability to have plain-language
feature documentation that we could automatically test against, after years of
adding to and maintaining a fairly large set of Cucumber scenarios, the cost of
that maintenance was starting to really slow us down. The test suite began to
grow fragile, and it seemed like every time one of our UX designers changed
anything about the application’s interface, the development team would spend a
bunch of time just babysitting Cucumber tests to get them passing again.
Last year, as I was reading Jez Humble’s excellent Continuous
Delivery book,
I was inspired when I came across the section titled “The Application Driver
Layer” (p. 198). This section describes an approach to acceptance testing where
the specification and the test implementation are isolated from the details of
the application’s user interface by inserting a layer between the two that uses
good old OOP to abstract the user interface components. Martin Fowler describes
it as the Window Driver pattern on his website.
I started a proof-of-concept implementation of this pattern last summer, then my
coworker, Sam Livingston-Gray and I
started pulling it into a new project at work. After Sam and the rest of the
Renewable Funding team helped improve on my original attempt while putting it to
use for the last six or so months, we extracted a library to make it easier for
other Ruby developers to implement this pattern in their testing. I’m happy to
introduce Kookaburra to the world.