Here's how to structure a requirement as a user story with acceptance criteria, using a common format:
User Story Template
"As a [type of user], I want [action/feature] so that [benefit/value]."
Acceptance Criteria Template
- Given [initial condition], when [action is performed], then [expected outcome].
- Repeat for edge cases, negative scenarios, and alternate paths.
Example: Password Reset Feature
User Story
As a user who forgot their password, I want to reset my password via email so that I can regain access to my account.
Acceptance Criteria
-
Given the user clicks "Forgot Password" on the login page,
when they enter their registered email address,
then a password reset link is sent to their inbox within 1 minute.
-
Given the user receives the reset email,
when they click the link and enter a new password,
then the system updates the password and displays a success message.
-
Given the reset link has expired (e.g., after 1 hour),
when the user tries to use it,
then an error message appears and a new reset link must be requested.
-
Given the user enters an invalid email address,
when they submit the reset request,
then the system displays an error: "Email not found."
-
Given the user submits a new password that doesn’t meet complexity rules (e.g., no special characters),
when they attempt to save the password,
then the system displays an error: "Password must include at least one special character."
Tips for Writing Effective Stories & Criteria
- Focus on user needs: Always tie the story to the user’s goal.
- Keep criteria testable: Avoid vague terms like "fast" or "user-friendly." Use specifics (e.g., "within 1 minute").
- Cover edge cases: Include negative scenarios (invalid input, expired tokens, etc.).
- Collaborate: Involve stakeholders (PO, QA, Dev) to refine criteria.
- Prioritize clarity: Avoid technical jargon unless the audience understands it.
Alternative Format for Acceptance Criteria
If Gherkin syntax feels too rigid, use bullet points:
- The system must send a password reset email within 1 minute of request.
- Reset links must expire after 1 hour.
- New passwords must meet complexity rules (min. 12 characters, 1 special character, 1 number).
This format ensures developers know what to build and testers know how to validate it. Let me know if you’d like to refine a specific example!