Chapter 6

Making Scenarios More Expressive

Chapter 3, “Formalizing Examples into Scenarios,” covered how to use Cucumber’s Gherkin language to express examples of your app’s behavior. In this chapter, we look at how to go beyond the basics to create scenarios that are fluent, expressive, and a pleasure to read and write. We’ll see some common ways scenarios go wrong and how to fix them.

Feedback About Scenarios

As is often the case with teams new to Cucumber, the library team did reasonably well when working on their first feature or two, but they began to struggle with the expressiveness of their scenarios as they moved to a new area of their domain and involved new team members in writing scenarios. From their initial time with Jonah, they ...

Get Behavior-Driven Development with Cucumber: Better Collaboration for Better Software now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.