How we increased efficiency in unit test automation
Jurian van de Laar & Sanda Aitonean-Contiu
Philips Heath Care
Automating unit tests has become a common practice in our industry, but how many of you are still suffering from the burden of maintaining tests?
In our organization, considerable effort was needed by developers to write and maintain automated unit tests, like synchronizing test specification, test code and production code. Additionally, it was difficult for testers to contribute, e.g. by reviewing test scripts that include too many implementation details. So we started to look for a solution to reduce developers’ effort and put testers into the driver’s seat instead, to specify the tests. This could bring the best out of the two worlds: testers using their professional testing skills to design good tests, preferably in natural language, while developers provide the keywords that testers need. Unfortunately, the usual keyword driven test frameworks may be useful at system level, but they lack the debugging facilities that developers need at unit level.
So, to explore another solution, we initiated a pilot to apply ‘Specification by Example’ for an existing unit, using the Gherkin DSL (domain-specific language) for modeling unit-level executable tests, and SpecFlow (a Cucumber family tool) to execute them.
In our presentation we will show our business case that predicts a significant reduction of maintenance costs. Also we will show some real life examples as well as the results of this pilot, explaining the benefits for both developers and testers. Today, we are implementing all tests for this unit in Gherkin.
Moreover, we will briefly share our ideas on how this automated unit test approach fits in a broader vision in which a DSL is used for validating the design in an even earlier phase.