Here are some guidelines for writing good acceptance criteria for user stories:
- Be specific and clear: The acceptance criteria should clearly define what the user story is supposed to accomplish. Avoid ambiguity and use specific, measurable terms.
- Be testable: The acceptance criteria should be testable, meaning that they can be verified through testing or inspection. Each criterion should be expressed in a way that allows it to be tested.
- Be independent: Each acceptance criterion should be independent of other criteria. This means that passing or failing one criterion should not affect the results of any other criterion.
- Be based on the user's perspective: Acceptance criteria should be written from the perspective of the user or customer. This helps ensure that the final product meets the needs of the people who will be using it.
- Use a consistent format: Using a consistent format for acceptance criteria can make it easier to understand and verify them. An example format could be : "Given [initial context], when [event occurs], the system [expected behavior]"
- Be concise: Keep acceptance criteria as concise as possible without losing their meaning. Avoid including irrelevant information or going into too much detail.
An example of a user story with acceptance criteria:
User Story: As a shopper, I want to be able to filter search results by price so that I can quickly find items within my budget.
Acceptance Criteria:
- The shopper is able to specify a price range using a minimum and maximum value.
- The search results are filtered to show only items within the specified price range.
- Items that are on sale or have discounts are also considered when filtering results.
- The shopper is given feedback when no items are found within the specified price range.