1. Understand the User's Request:
* Topic: Designing effective acceptance criteria (AC).
* Key Constraint: Must align with both functional (FRs) and non-functional requirements (NFRs).
* Goal: Provide a guide or framework for doing this effectively.
-
Deconstruct the Concepts:
- Acceptance Criteria (AC): The conditions a software product must satisfy to be accepted by a user, customer, or other system. They define the boundaries of a user story.
- Functional Requirements (FRs): What the system does (e.g., user logs in, system calculates tax, user sends an email). Focus on inputs, behavior, and outputs.
- Non-Functional Requirements (NFRs): How the system performs (e.g., performance, security, scalability, usability). Quality attributes.
-
Identify the Core Challenge:
- Usually, teams are good at writing AC for FRs (e.g., "Given I am on the login page...").
- Teams often struggle to write AC for NFRs because they are often global/cross-cutting and abstract (e.g., "The system must be fast"). AC needs to be specific and testable.
-
Formulate a Strategy/Structure for the Answer:
- Introduction: Define AC, FR, and NFR briefly. State the importance of bridging them.
- Principles of Good AC: Remind the user of the basics (SMART, INVEST).
- Part 1: Designing AC for Functional Requirements: Standard approach (Gherkin/Given-When-Then).
- Part 2: Designing AC for Non-Functional Requirements: This is the meat of the answer. How to make vague qualities testable.
- Categories: Performance, Security, Usability, Compatibility.
- Examples.
- Part 3: The Integration Strategy: How to mix them? (Include NFRs in every story vs. separate constraints).
- Template/Format: Provide a concrete structure.
- Common Pitfalls: What to avoid.
-
Drafting Content - Section by Section:
-
Intro: Set the stage. AC defines "Done."
-
Basics: Mention Gherkin syntax (Given/When/Then) as the industry standard for clarity. Mention the "Three Amigos" meeting (Dev, QA, PO) for collaboration.
-
Functional AC: Keep it simple. Input -> Action -> Output.
- Example: Login success, error message display.
-
Non-Functional AC (The Tricky Part):
- Problem: NFRs are often global (e.g., "App must load in 2s").
- Solution: Operationalize them. Turn "Fast" into "Page load < 200ms."
- Specific NFR Categories:
- Performance: Response time, throughput.
- Security: Authentication, authorization, encryption.
- Reliability: Uptime, error recovery.
- Scalability: Load handling.
- Crucial distinction: Do we put NFR ACs on every ticket? Usually no. We either have specific "Enabler" stories or define a "Definition of Done" (DoD) that covers global NFRs. Self-Correction: I should mention the DoD connection. If an NFR applies to everything (e.g., accessibility), put it in the DoD. If it's specific to a feature (e.g., high-res image upload needs specific size limits), put it in the AC.
-
Integrating FR and NFR:
- Scenario: A search bar.
- FR: Returns results.
- NFR: Returns them in < 500ms.
- Strategy: Write the AC as a combination. "Verify the search results load within 500ms for up to 1000 concurrent users."
-
The "How-To" Steps:
- Define specific metrics (SLAs/SLOs).
- Use the "Given/When/Then" format for NFRs too.
- Use the Definition of Done (DoD) for global NFRs.
-
Refining and Polishing:
- Tone: Professional, instructional, actionable.
- Formatting: Use bolding, bullet points, and code blocks for examples to make it readable.
-
Review against Constraints:
- Did I cover FRs? Yes.
- Did I cover NFRs? Yes.
- Did I explain alignment? Yes, by showing how to make NFRs testable and integrated.
-
Final Polish (Self-Correction during drafting):
- Make sure to emphasize that NFRs need to be measurable. "User-friendly" is bad AC. " SUS score of 70+" is good AC.
- Differentiate between "System-wide" NFRs and "Feature-specific" NFRs. This is a common point of confusion.
-
Output Generation: (Proceeding to generate the response based on these structured thoughts.)
Designing effective Acceptance Criteria (AC) requires shifting your mindset from "Does this feature work?" to "Does this feature meet the specific behavioral and quality standards required?"
To align both Functional (what the system does) and Non-Functional (how the system performs) requirements, you must treat them as inseparable components of the same definition of "Done."
Here is a framework for designing AC that captures both dimensions effectively.
1. The Foundation: Make NFRs Measurable
The biggest mistake teams make with Non-Functional Requirements (NFRs) is writing them as vague wishlists (e.g., "The page must load fast"). Effective AC requires binary pass/fail states.
Before writing AC for a specific user story, quantify the NFRs.
- Bad: "The system must be secure."
- Good: "All API endpoints must reject unauthenticated requests with a 401 status."
- Bad: "The search must be quick."
- Good: "Search results must render within 2 seconds under a load of 500 concurrent users."
2. The Structure: Use the "Given-When-Then" (Gherkin) Format
The standard Behavior-Driven Development (BDD) format is the best way to align FRs and NFRs because it forces you to define a Context (Given), an Action (When), and a specific Outcome (Then).
You can embed NFRs directly into the "Then" statement or add specific scenarios just for quality attributes.
Example: A "Login" Feature
Functional AC (The "Happy Path"):
- Given a registered user is on the login page,
- When they enter a valid username and password,
- Then the system redirects them to the dashboard.
Integrated NFR AC (Performance & Security):
To align these, you add constraints to the functional outcome:
- Given a registered user enters valid credentials,
- When they submit the form,
- Then the dashboard loads in under 1.5 seconds (Performance),
- And the session token is stored in an HttpOnly cookie (Security).
3. The Strategy: Three Layers of Alignment
When writing AC for a User Story, check these three layers to ensure alignment:
Layer A: The Functional Behavior (The "What")
This is standard logic. Does the button click? Does the calculation save?
- AC Example: "Verify that the user receives a confirmation email after purchase."
Layer B: The Boundary Conditions (The "Edge Cases")
This is where Functional and Non-Functional often blur. How does the function handle stress or bad data?
- AC Example: "Verify that if the email server is down, the system retries 3 times and logs an error without crashing the purchase page (Reliability/Resilience)."
Layer C: The Cross-Functional Constraints (The Global "How")
Some NFRs apply to every story (e.g., Accessibility, Security). Instead of writing them every time, reference a "Global Acceptance Criteria" document or a "Definition of Done."
- AC Example: "Verify the login form meets WCAG 2.1 AA accessibility standards (tab navigation, screen reader labels)."
4. Practical Examples by Category
Here is how to translate common NFRs into Acceptance Criteria alongside Functional requirements:
| Requirement Type | Functional AC (The Behavior) | Integrated Non-Functional AC (The Quality Constraint) |
|---|
| Performance | User uploads a 5MB image. | The image preview displays within 3 seconds on a standard 4G connection. |
| Security | User views their profile. | The URL does not expose the numerical User ID (use UUIDs or encrypted IDs) to prevent IDOR attacks. |
| Usability | User encounters a validation error. | The error message is displayed in red text and read aloud by screen readers (Accessibility). |
| Reliability | User submits a payment. | If the payment gateway times out, the system creates a "Pending" state rather than failing silently. |
| Compatibility | User opens the dashboard. | The dashboard layout is preserved on viewport widths between 320px and 1920px (Responsive Design). |
5. The "Definition of Done" vs. "Acceptance Criteria"
To align effectively, you must distinguish between the two.
- Acceptance Criteria are specific to the Story. (e.g., "This specific API call must return JSON.")
- Definition of Done (DoD) applies to all work. (e.g., "Code must have 80% test coverage," "All P1 security scans must pass.")
Strategy: If an NFR is specific to a feature (e.g., "The video player must buffer for max 2 seconds"), put it in the AC. If an NFR is a general hygiene factor (e.g., "Code must pass the linter"), keep it in the DoD.
6. Checklist for Reviewing Your AC
Before handing AC to developers, ask these three questions to ensure alignment:
- Is it Testable? Can a QA engineer write a test script for this NFR? (e.g., "User-friendly" is not testable; "Max 2 clicks to reach settings" is).
- Is the Context Defined? Does the performance AC specify the environment? (e.g., "Load time < 2s on a staging environment replicating production data").
- Is the Failure State Defined? If the NFR isn't met (e.g., API is slow), what should the functional behavior be? (e.g., "Show a retry button" vs. "App crash").
Summary
To align Functional and Non-Functional requirements:
- Quantify the NFR (remove adjectives like "fast" or "secure").
- Embed the NFR into the functional scenario (Given/When/Then).
- Separate global quality standards into the Definition of Done.