- Published on
How to Write Testable User Story Acceptance Criteria
- Authors
- Name
- Scottie Crump
- @linkedin/scottiecrump/
Intro
To ensure that your user stories are being adequately tested, it is essential to write clear and concise acceptance criteria. Acceptance criteria will help you and your team understand what needs to be tested and how the story should be considered complete. This blog post will discuss how to write testable user story acceptance criteria. We will also provide a few tips on making sure that your stories are ready for testing!
Why Are User Story Acceptance Criteria Critical?
User story acceptance criteria are the conditions that must be met for a user story to be considered "done." Acceptance criteria are critical because they help ensure that your team is on the same page regarding what needs to be accomplished. In addition, acceptance criteria should be testable - this means that they should clearly describe how the team can verify the story as complete in observable and/or measurable terms. As a result, you can create more effective tests and avoid any confusion or ambiguity during the testing process.
For example, if your acceptance criteria state that a certain button must be visible on the page, you will know to look for that button when you are testing.
How Can You Make Sure Your Stories Are Ready for Testing?
Here are a few tips to make sure your user stories are ready for testing:
-
Make sure all acceptance criteria have been met - this seems like a no-brainer, but it's essential to double-check!
-
Make sure the story is small and manageable - if a story is too large, it won't be easy to test. For example, if a story includes multiple features, it may be better to break it down into smaller stories.
-
Make sure the story is well-written and easy to understand - this will help to avoid any confusion during the testing process.
-
Ask yourself if the story is testable - if you're not sure, have a conversation with your team for help.
-
Create a test plan - this will help you organize and plan your tests and make sure that all of the necessary criteria are covered.
Tips for Writing Testable Acceptance Criteria
Now that we've gone over some of the basics, let's take a look at some tips for writing good, testable acceptance criteria:
-
Be clear and concise. For example, if you are testing the visibility of a button, simply state that "the button must be visible."
-
Be specific. For example, instead of saying "the page must load quickly," you could say "the page must load in less than five seconds."
-
Use simple language.
-
Focus on the result. For example, rather than stating "the system must save the user's input," you could say "the system must allow the user to save their input."
-
Avoid specifying implementation details. For example, rather than saying "the button must be a certain color," you could say "the button must be visible."
-
Make sure the criteria are observable and measurable. For example, rather than saying "the user must be able to find the information they need," you could say "the user must be able to find the information they need within three clicks."
-
Write one criterion per line. This will help to keep your criteria clear and concise.
-
Avoid technical jargon. This ensures that everyone on the team including non-technical team members understand what is being tested.
Writing good acceptance criteria can be challenging, but following these tips should help you get started. It's also a good idea to have a look at some sample acceptance criteria to get an idea of what they should entail.
Examples of good acceptance criteria
Let's say we are working on a user story for a login feature. An example of good, testable acceptance criteria for this story might be:
-
Given that the user is on the login page when they enter their username and password, then they should be able to successfully log in.
-
Given that the user is on the login page, when they submit their username and password, then they should be redirected to the home page.
-
Given that the user is on the login page, when they enter an invalid username or password, then an error message should be displayed.
Examples of bad acceptance criteria
On the other hand, here are some examples of bad acceptance criteria:
-
The login feature should work
-
Users should be able to log in
-
Page should look like the mockup
While these statements are true, they are not specific or measurable, vague, and therefore would be difficult to test. In addition, they do not provide enough detail to ensure that the team is on the same page.
Conclusion
In conclusion, user story acceptance criteria are critical because they help ensure that your team is on the same page regarding what needs to be accomplished. Having clear and testable acceptance criteria will also help you create more effective tests and avoid any confusion or ambiguity during the testing process. Tips for writing good, testable acceptance criteria include being clear and concise, specific, and avoiding technical jargon. In addition, it is also important to make sure that the criteria are observable and measurable. To get a clearer idea of what acceptance criteria should look like, take a few minutes and Google search samples of acceptable conditions.
I hope this article helped explain how to write testable user story acceptance criteria. Thanks for reading!