Overcoming Gherkin Anti-patterns for Manageable, Durable, and Valuable Test Code
Gherkin holds the promise of being an easy to implement and easy to understand tool for getting teams to be Test Driven. And it should be. But in our experience working with and coaching many teams, we have found significant differences between theory and practice. Too often, Gherkin scenarios result in test code that is difficult to understand, difficult to maintain, and not valuable. We will go over the following anti-patterns and discuss strategies to overcome them:
- Scenarios that focus on UI implementation rather than expected behavior
- Scenarios that are too long and too complex
- Misunderstanding of the Gherkin keywords
- Not treating test code with the same level of rigor and discipline you would the rest of your code
Finally, we will discuss a method for determining the relative priorities of writing certain types of tests to determine if they deliver their expected value. After this session, you will be able to go back to your teams with some practical lessons for refactoring your test code so that it is manageable, durable, and valuable.