Acceptance Criteria
What is Acceptance Criteria?
Unlike broad requirements, Acceptance Criteria are highly specific, unambiguous, and testable. They articulate the "what" – what the system should do – rather than the "how" – how it should be implemented. This distinction is vital in Agile, where development teams are empowered to determine the best technical solution to meet the defined criteria.
The concept of Acceptance Criteria evolved from traditional requirements engineering, adapting to the iterative and collaborative nature of Agile methodologies. As Agile frameworks like Scrum and Kanban gained prominence, the need for lightweight, yet precise, ways to define "done" for small increments of work became apparent. Acceptance Criteria, often paired with User Stories, emerged as a powerful tool to achieve this clarity without resorting to lengthy, rigid documentation.
Purpose of Acceptance Criteria
The primary purposes of Acceptance Criteria include:
- Ensuring Shared Understanding: They create a common language and understanding among the product owner, development team, and testers regarding the scope and expected functionality of a feature.
- Defining Scope and Boundaries: AC clearly delineate what is included and, by implication, what is not included in a particular user story or feature, preventing scope creep and misunderstandings.
- Facilitating Testing: Each criterion should be testable, providing a direct basis for quality assurance activities and the creation of test cases. This supports both manual and automated testing efforts.
- Reducing Ambiguity: By specifying concrete conditions, AC minimize assumptions and subjective interpretations, leading to more predictable outcomes.
- Enabling "Definition of Done": For a User Story to be considered "done," all its associated Acceptance Criteria must be met. This contributes directly to the overall Definition of Done for the increment.
- Managing Expectations: Stakeholders can review and agree upon the criteria, ensuring their expectations align with what the development team will deliver.
Importance in the Agile Knowledge Graph
Acceptance Criteria are deeply integrated into the Agile knowledge graph, particularly within Product Management and Agile Engineering Practices. They are a critical component of effective Product Backlog Refinement, where Product Owners collaborate with the development team to elaborate on User Stories and define their AC. They help break down larger items like Epics and Features into manageable, testable units.
Furthermore, AC are foundational for practices like Behavior-Driven Development (BDD) and Test-Driven Development (TDD), where tests are written based on these criteria before the actual code. This tight coupling ensures that development is always guided by the desired behavior and acceptance conditions, leading to higher quality software that truly meets user needs.
How It Works
Workflow for Acceptance Criteria
-
Identification and Elaboration:
- Acceptance Criteria are typically identified and elaborated during Product Backlog Refinement sessions. The Product Owner brings a User Story or feature to the team.
- Through discussion, the Product Owner, developers, and testers collaborate to understand the desired functionality from various perspectives. This often involves asking "what if" questions and exploring edge cases.
- The goal is to clarify the user story's intent and identify all conditions that must be true for the story to be considered complete and valuable.
-
Formulation:
- Once identified, the criteria are written down in a clear, concise, and unambiguous manner.
- A common and highly effective format is the Gherkin syntax, often used in Behavior-Driven Development (BDD):
Given [a context] When [an event occurs] Then [an outcome is expected]This structure encourages thinking about the system's behavior from a user's perspective and makes criteria directly executable as automated tests.
- Alternatively, a simple bulleted list of "The system shall..." or "The user can..." statements can be used, as long as they remain specific and testable.
-
Review and Agreement:
- The formulated Acceptance Criteria are reviewed by the entire cross-functional team (Product Owner, developers, testers).
- This review ensures everyone has a shared understanding and agrees on what "done" means for that specific item. Any ambiguities or disagreements are resolved at this stage.
- The criteria are considered part of the User Story and are often stored alongside it in the Product Backlog.
-
Development Guidance:
- During the sprint or iteration, developers use the Acceptance Criteria as a guide for implementation. They know exactly what functionality needs to be built and what conditions it must satisfy.
- For teams practicing Test-Driven Development (TDD), the Acceptance Criteria directly inform the creation of unit and integration tests *before* the code is written.
-
Testing and Verification:
- Quality Assurance (QA) engineers or testers use the Acceptance Criteria to design and execute test cases. Each criterion typically corresponds to one or more test scenarios.
- Automated tests can be built directly from Gherkin-formatted criteria, allowing for continuous verification.
- The tests confirm that the implemented solution behaves as expected under the specified conditions.
-
Acceptance and Validation:
- Once the development team believes the User Story is complete and all internal tests pass, the Product Owner (or designated stakeholder) performs a final review.
- The Product Owner uses the Acceptance Criteria to validate that the delivered functionality meets the agreed-upon conditions. If all criteria are met, the story is accepted and considered "done." If not, it is returned for further work.
This iterative cycle ensures that Acceptance Criteria are living documents, evolving as understanding deepens, but always serving as the ultimate arbiter of completeness and correctness for a given piece of work.
Key Concepts
User Stories
Acceptance Criteria are most commonly associated with User Stories. A User Story describes a desired feature from the perspective of an end-user, and the AC define the specific conditions that must be met for that story to be considered complete and valuable to the user.
Definition of Done (DoD)
While Acceptance Criteria are specific to a single User Story, the Definition of Done is a broader, shared understanding of what it means for *any* increment of work to be complete and releasable. Meeting all Acceptance Criteria for a story is typically a prerequisite for that story to meet the overall DoD.
Behavior-Driven Development (BDD)
BDD is an Agile practice that encourages collaboration among developers, QA, and non-technical stakeholders. Acceptance Criteria, especially when written in the Gherkin "Given/When/Then" format, serve as the executable specifications for BDD, driving both development and automated testing.
Testability
A fundamental characteristic of good Acceptance Criteria is testability. Each criterion should be verifiable, meaning it can be objectively proven true or false through testing. This ensures that the criteria can be used effectively by QA to validate the implemented functionality.
Shared Understanding
The collaborative process of defining Acceptance Criteria fosters a shared understanding of the requirements across the entire team. This reduces misinterpretations, minimizes rework, and ensures everyone is aligned on the expected outcome of the development effort.
Product Backlog Refinement
This ongoing activity involves the Product Owner and Development Team detailing items in the Product Backlog. Defining Acceptance Criteria is a key part of refinement, ensuring that items are clear, understood, and ready for development in an upcoming sprint.
INVEST Criteria
While INVEST applies to User Stories, Acceptance Criteria help ensure a story meets the "Testable" and "Small" aspects. Well-defined AC make a story easier to test and help break down larger stories into smaller, more manageable ones.
Practical Considerations
Benefits of Acceptance Criteria
- Enhanced Clarity and Precision: They eliminate ambiguity, ensuring everyone understands the exact requirements.
- Improved Quality: By providing clear testable conditions, AC lead to more thorough testing and higher quality deliverables.
- Reduced Rework: Clear expectations upfront minimize the chances of building the wrong thing, saving time and resources.
- Better Collaboration: The process of defining AC fosters communication and alignment between product owners, developers, and testers.
- Empowered Teams: Development teams gain autonomy to choose the best technical solution, knowing precisely what outcome is expected.
- Support for Automation: Well-written AC, especially in Gherkin, can be directly translated into automated tests, accelerating feedback cycles.
- Clear "Done" Definition: They provide objective criteria for accepting a user story, making the acceptance process transparent.
Limitations of Acceptance Criteria
- Can Become Overly Prescriptive: If written too rigidly or in too much detail, AC can stifle developer creativity and become mini-specifications, defeating the Agile spirit.
- Requires Effort and Skill: Crafting good, testable AC takes practice, collaboration, and a deep understanding of the desired functionality.
- Not Suitable for Exploratory Work: For highly experimental or discovery-focused tasks, defining exhaustive AC upfront might be counterproductive.
- Maintenance Overhead: As requirements evolve, AC must be updated, which can add to documentation overhead if not managed efficiently.
- Focus on Functional Aspects: AC primarily address functional requirements; non-functional requirements (performance, security) might need separate consideration or specific AC.
Common Mistakes with Acceptance Criteria
- Vague or Ambiguous Language: Using subjective terms like "fast," "easy to use," or "user-friendly" without quantifiable metrics.
- Too Many Criteria: Overloading a single user story with an excessive number of AC can make the story too large and difficult to complete within an iteration.
- Not Testable: Criteria that cannot be objectively verified (e.g., "The user will like the new design").
- Focusing on "How" Instead of "What": Describing implementation details rather than the desired outcome or behavior.
- Written in Isolation: Product Owners writing AC without collaboration from the development and QA teams, leading to misunderstandings or impractical criteria.
- Written Too Late: Defining AC just before development begins, missing the opportunity for early clarification and shared understanding.
- Not Reviewed or Agreed Upon: Lack of consensus on AC can lead to disputes during acceptance.
Real-world Examples
Consider a user story: "As a registered user, I want to log in to my account so I can access my personalized dashboard."
Good Acceptance Criteria:
-
Scenario: Successful Login
- Given I am on the login page
- When I enter valid username "testuser" and valid password "password123"
- And I click the "Login" button
- Then I should be redirected to my personalized dashboard
- And I should see a "Welcome, testuser!" message
-
Scenario: Invalid Credentials
- Given I am on the login page
- When I enter invalid username "wronguser" and/or invalid password "wrongpass"
- And I click the "Login" button
- Then I should remain on the login page
- And I should see an error message "Invalid username or password."
-
Scenario: Empty Fields
- Given I am on the login page
- When I click the "Login" button without entering any credentials
- Then I should remain on the login page
- And I should see "Username is required" and "Password is required" error messages
Best Practices for Acceptance Criteria
- Collaborate Extensively: Involve the Product Owner, developers, and testers in defining AC.
- Keep Them Concise and Clear: Use simple, direct language. Avoid jargon where possible.
- Make Them Testable: Each criterion should be verifiable with a clear pass/fail outcome.
- Focus on Outcomes and Behavior: Describe what the system *does* or what the user *experiences*, not *how* it's implemented.
- Use Gherkin (Given/When/Then): This format naturally encourages testable, behavioral descriptions and supports BDD.
- Define Edge Cases: Include criteria for error conditions, invalid inputs, and boundary scenarios.
- Review and Refine Regularly: AC are part of the Product Backlog and should be reviewed and updated during Backlog Refinement as understanding evolves.
- Link to Automated Tests: Where possible, connect AC directly to automated test cases for continuous validation.
- Keep User Stories Small: If a user story has too many AC, it might be an indicator that the story needs to be split into smaller, more manageable stories.
Frequently Asked Questions
- What is the difference between Acceptance Criteria and Definition of Done?
- Acceptance Criteria are specific to a single user story or feature, defining its unique conditions for acceptance. The Definition of Done (DoD) is a broader, shared set of criteria that applies to *all* product backlog items, ensuring a consistent level of quality and completeness across the entire increment.
- Who is responsible for writing Acceptance Criteria?
- The Product Owner is primarily responsible for defining the "what" and "why" of a user story, including its Acceptance Criteria. However, it's a collaborative effort, with the development team and testers providing input and challenging assumptions to ensure clarity and testability.
- How many Acceptance Criteria should a User Story have?
- There's no fixed number. A good user story should have just enough Acceptance Criteria to clearly define its scope and expected behavior, typically ranging from 3 to 7. If a story has too many, it might be too large and should be split.
- Can Acceptance Criteria change?
- Yes, in an Agile environment, requirements can evolve. Acceptance Criteria can be refined or updated during Backlog Refinement or even during a sprint if new information emerges, but any changes should be discussed and agreed upon by the team and Product Owner.
- Are Acceptance Criteria only for User Stories?
- While most commonly associated with User Stories, Acceptance Criteria can be applied to any deliverable that requires clear conditions for completion, such as Features, Epics, or even technical tasks, to ensure shared understanding and quality.
- What is the Gherkin format?
- Gherkin is a plain-language syntax used to describe software behavior in a structured way, often for Behavior-Driven Development (BDD). It uses keywords like "Given," "When," and "Then" to define scenarios, making Acceptance Criteria readable by both technical and non-technical stakeholders, and directly executable as automated tests.
Explore Related Topics
References & Further Reading
- The Agile Manifesto. (2001). https://agilemanifesto.org/
- Schwaber, K., & Sutherland, J. (2020). The Scrum Guide. https://scrumguides.org/scrum-guide.html
- Cohn, M. (2004). User Stories Applied: For Agile Software Development. Addison-Wesley.
- North, D. (2006). Behavior-Driven Development. https://dannorth.net/introducing-bdd/
- Wake, B. (2003). INVEST in Good Stories, and SMART Tasks. https://xp123.com/articles/invest-in-good-stories-and-smart-tasks/