The Secret Ninja Cucumber Scrolls

Feature files should be written collaboratively

Many beginners fail with specification by example by expecting the business analysts or business users to write feature files. You can see people often complaining how Cucumber doesn't work for them because their business analysts don't want to write feature files. This is a huge misunderstanding of the process and even if you can get them to write the files on their own, avoid doing that. Feature files should be a universally accepted definition of what done means for a particular story, from all the perspectives. That is why they need to be specified and written collaboratively. Everyone should contribute. A good feature file contains the following key examples:

  • A representative example illustrating each important aspect of business functionality. Business users, analysts or customers will typically define these.

  • An example illustrating each important technical edge case, such as technical boundary conditions. Developers will typically suggest such examples when they are concerned about functional gaps or inconsistencies. Business users, analysts or customers will define the correct expected behavior.

  • An example illustrating each particularly troublesome area of the expected implementation, such as cases that caused bugs in the past and boundary conditions that might not be explicitly illustrated by previous examples. Testers will typically suggest these and business users, analysts or customers will define the correct behavior.