Monday, September 08, 2008

Basic Structure for Writing Acceptance Criteria / Scenarios

Name: Basic Structure for Writing Acceptance Criteria / Scenarios
Type: Rules
Status: final
Version: 2008-09-08
Sources: Dan North's Behavior Driven Development (RSpec). I was introduced to this by Chris Matts.

Gist: Specify scenarios in a human (and machine) readable, yet compact way.

R1: Use the following sentence structure:
GIVEN <context>
WHEN <event>
THEN <expected behavior>

GIVEN the user has proper credentials
WHEN he selects an order for deletion
THEN the system accepts the selection

GIVEN the system is running under stress profile XY
WHEN interface A sends a service request
THEN the system responds to A in 3 seconds or less

R2: If you need to specifiy more complex conditions, use AND, OR, NOT
GIVEN <context 1>
OR <context 2>
WHEN <event 1>
AND <event 2>
THEN <behavior 1>
NOT <behavior 2>


Richard said...

Too spare.

For this to make any sense without other knowledge, a few examples might help a lot.

A glossary of special terms like context and event which offered one or two lines of meanings would be welcome.

Escalating this to a list of suggested updates to any wiki content gives me a crazy idea:
- use some tags to make requests for content improvement
>>examples? could request some
>>glossary? could request one
- Use tags to provide content
{context} is a named section of ...
{event} is a named time when ....

Rolf said...

Thanks Richard for your ideas on tag usage. They are not crazy, they are simply amazing. I'm going to update the post with an example...