What is a user story, and what are acceptance criteria?

BeginnerConceptAgile & planning
Answer

In one line: A user story is a short description of a feature from the user's point of view; acceptance criteria are the specific conditions that must be true for the story to count as done.

User story format:

As a [type of user], I want [some goal], so that [reason / benefit].

Example:

As a developer, I want my pull request to show test results automatically, so that I know whether my change is safe to merge.

Acceptance criteria for that story:

  • When a pull request is opened or updated, the CI pipeline runs automatically.
  • Unit tests and linting results appear as a status check on the PR.
  • The PR cannot be merged if the checks fail.
  • The pipeline finishes in under 10 minutes for a typical change.

Acceptance criteria are often written in the Given / When / Then format:

  • Given a PR with a failing unit test, when the pipeline runs, then the PR shows a red check and the merge button is blocked.

What makes a good story (INVEST):

  • Independent, Negotiable, Valuable, Estimable, Small, Testable.

DevOps-related stories are stories too: "As an on-call engineer, I want an alert when disk usage goes above 85%, so that I can fix it before the service fails." Writing infra work as stories makes its value clear to the Product Owner.

Tip for interviews: show you can write acceptance criteria that are testable. Vague criteria like "the pipeline should be fast" lead to arguments; "under 10 minutes" doesn't.

All DevOps Fundamentals questions

More on Agile & planning