Acceptance criteria
Clear conditions that define when a piece of work is done.
Acceptance criteria state the observable behavior that must work, written before the work starts. They reduce misunderstandings and make testing straightforward. Written from the user's side, they keep the focus on outcomes instead of implementation details.
Why it matters for a product engineer
Acceptance criteria say what must be true when the work is done, and they are written before it starts. They turn “I thought you meant…” into a list that everyone has read. Written as examples, they become tests, so the definition of done is also the proof of done.
How to do it
- Write them before the work starts, with the people who will use, build and test it.
- Describe behaviour a user can see, not the implementation.
- Use concrete examples: given the state before, when the action happens, then the result you expect.
- Cover the main case, the edge cases, and what must not change.
- Make each one pass or fail, with no room for opinion.
- Turn them into automated tests where you can.
Common mistakes
- Criteria that describe the code, not the behaviour.
- Vague words: “fast”, “easy”, “intuitive”.
- Criteria written after the work, to match what was built.
- Only the main case.
Example
An agent’s audit of RelievApp wrote a check for every new or edited scene: one gesture, no way to fail, the control on the subject, at most two texts and none over the subject, every input answered, a true time label, and readable at 390 px in both looks. A reviewer, or a test, can check each item. (RelievApp in In practice)
An acceptance criterion written as given, when, then
Scenario: User requests a sell before close of trading Given I have 100 shares of MSFT stock And I have 150 shares of APPL stock And the time is before close of trading1 When I ask to sell 20 shares of MSFT stock2 Then I should have 80 shares of MSFT stock3 And I should have 150 shares of APPL stock4 And a sell order for 20 shares of MSFT stock should have been executed5
- 1GivenThe state before.
- 2WhenThe one action.
- 3ThenThe change you expect.
- 4UnchangedWhat must stay the same.
- 5Side effectWhat else must happen.
Each line can become a step in a test. The line about what stays the same is the one people forget.
ReportedMartin Fowler, Given when then
Sources: Given when then (Martin Fowler) ↗
Resources
1- articleStart here
Given when then ↗
Martin Fowler · 3 minThe simple structure for writing acceptance criteria as examples that can become tests.