This post is part of the Pride & Paradev series.
Should your acceptance criteria be specified as Given/When/Then or checklists?
- You should specify your acceptance criteria as Given/When/Then
- You should specify your acceptance criteria as checklists
You should specify your acceptance criteria as Given/When/Then
Given/When/Then is almost a ubiquitous way to specify user scenarios:
Given some precondition When I do some action Then I expect some result
If you write your acceptance criteria in this format, it not only provides a consistent structure, but if your automated acceptance tests are also specified in the Given/When/Then format then it makes translation from acceptance criteria to acceptance tests painless.
Your acceptance criteria are less likely to be nebulous as thought has gone into making them follow this consistent format with a precondition, action and expectation.
You should specify your acceptance criteria as checklists
Having acceptance criteria specified against a user story in checklist format makes the acceptance criteria clear and concise as there is nothing more than is needed. Given/When/Then scenarios can be verbose and hard to read on a user story card.
It also means these are easy to individually mark as complete by programmers as they implement the functionality (in a tool such as Trello).
But the biggest benefit is that acceptance criteria can’t be transferred directly from the user story to an automated acceptance test. This is important because acceptance test features shouldn’t replicate user stories: a user story is a change to a system, a feature is a collection of things that it does. So having a feature for every user story is a disaster, which is more likely to happen if your acceptance criteria are in the Given/When/Then format.
Having your acceptance criteria in checklist form also means there’s some human thought about how to implement an acceptance test for these. It might be that one acceptance test scenario covers three acceptance criteria checklist items, which is how it should be done, not simply a one to one mapping which can happen when using Given/When/Then format for both acceptance criteria and tests.