Mastering Business Analysis & Jira for Modern TeamsLesson 15 of 32
Lesson 15 of 32

Writing Acceptance Criteria with Given-When-Then (Gherkin BDD Syntax)

Overview & Learning Objectives

Acceptance Criteria define the exact boundary conditions that a software feature must satisfy to be accepted by the Product Owner and marked as "Done". Rather than writing vague bullet points, modern Agile teams author acceptance criteria using Behavior-Driven Development (BDD) Gherkin syntax: Given [precondition context], When [action performed by user], Then [expected observable system outcome]. This syntax bridges business requirements directly into automated test frameworks like Cucumber and Behave.

  • Master the Gherkin BDD structure: Feature, Scenario, Given (context), When (action), Then (outcome), and And/But (chaining).
  • Distinguish between Happy Path scenarios, Boundary edge cases, and Negative error handling scenarios.
  • Run a working Python test simulation executing Gherkin-style assertions.
Example

Real-World Example: The Teacher’s Exact Grading Checklist for a Gold Star

PRACTICAL CONTEXT
  • Scenario: The teacher's exact scoring rubric checklist required to earn a Gold Star on an essay.
  • Gherkin Syntax: Given [Initial Context], When [User Action Occurs], Then [Expected Outcome Happens].
  • Analyst Value: Eliminates subjective interpretations between software developers, testers, and business clients.
Corporate / Tech Term Classroom / Everyday Metaphor What It Actually Means
GIVEN (The Starting Scene) Given I have $20 in my pocket and I am at the candy store The precondition and system state before the action.
WHEN (The Action) When I hand $5 to the cashier for chocolate bars The exact button press or tap the user performs.
THEN (The Expected Result) Then the cashier gives me the chocolate and $15 in change The verifiable outcome and message on the screen.
Core Principle: Given-When-Then turns vague wishes into clear yes/no tests that a computer or robot can test automatically!
Process

Visual Infographic: The Gherkin Given-When-Then Formula

BDD INFOGRAPHIC
Stage 1
GIVEN (Context)

User is on the login screen with a registered email.

Stage 2
WHEN (Action)

User enters correct password and taps "Log In".

Stage 3
THEN (Outcome)

User is redirected to home dashboard within 1 second.

Industry Standard & Framework

Standard: Cucumber Gherkin BDD Standard: Gherkin is a plain-English, readable specification language that serves as both human-readable documentation and automated acceptance tests.

Real-World Business Application: Zepto Instant UPI Refund Gherkin Specification

The BA writes Gherkin acceptance criteria for customer refund eligibility checks, which the QA squad directly imports into their automated testing framework.

Scenario TypeGherkin Scenario TitleBusiness Intent
Scenario 1 (Happy Path)Instant auto-refund for claims under ₹500 with photo proofVerifies zero-friction automated refund approval for low-risk loyal users.
Scenario 2 (Edge / Threshold)Refund claim exceeding ₹1,000 thresholdRoutes claim to manual human ops review queue instead of instant bank transfer.
Scenario 3 (Negative / Error)Customer attempts refund 3 hours after deliveryEnforces strict 2-hour SLA window with localized error modal.
Scenario 4 (Security / Idempotency)Customer double-taps submit refund button within 200msIdempotency key prevents duplicate payout; executes single payout only.

Step-by-Step UI Tutorial & Visual Workflow Guide

Below is the practical, non-technical walkthrough showing how Business Analysts design, review, and execute this capability inside real-world tools like Jira, Confluence, and enterprise software portals.

Visual Acceptance Criteria Framework: Given-When-Then (Gherkin BDD Syntax)

EXECUTION PHASES
1 Test Context
SCENARIO NAME

Scenario: Successful instant refund for damaged perishable items under INR 1,000 threshold.

2 Current Context
GIVEN (Initial Precondition)

GIVEN the customer ordered organic strawberries delivered within the last 60 minutes AND the customer has a clean account history.

3 Event Occurs
WHEN (User Action / Trigger)

WHEN the customer selects "Damaged Produce", uploads a clear photo, and taps "Request Instant Refund".

4 Result Verified
THEN (Expected System Outcome)

THEN the system auto-approves the INR 180 refund AND transfers the amount to original UPI VPA within 180 seconds.

5 Audit & Communication
AND (Secondary Side Effects)

AND sends an SMS confirmation to the customer AND logs a damaged inventory write-off in the dark store ledger.

Jira Software Story Description Editor

Step-by-Step: Formatting Gherkin Acceptance Criteria in Jira

Step 1
Step 1: Open Story Ticket in Jira

Scroll to the "Description" field -> Select "Code Block" or format using Markdown blockquotes.

Step 2
Step 2: Write Happy Path Scenario First

Draft Scenario 1 covering the ideal user journey where inputs are valid and system completes successfully.

Step 3
Step 3: Write Negative & Boundary Scenarios

Draft Scenario 2: What happens if photo is missing? Scenario 3: What happens if claim exceeds INR 1,000 cap?

Step 4
Step 4: Verify with QA Automation Engineers

QA engineers can copy your Gherkin syntax directly into Cucumber / Playwright to run automated test suites.

Visual Gherkin BDD Scenario Card: Instant Spoilage Refund

GHERKIN SPECIFICATION
itemwhenaudience
GIVENA customer has received an order containing perishable grocery items within 2 hoursInitial State
WHENThe customer submits a refund claim with a photo and the item cost is <= INR 1,000User Action
THENThe refund is automatically approved without requiring human customer support triageSystem Outcome
ANDThe refund transaction ID is displayed on the screen and dispatched via SMS notificationSide Effect

Implementation Guidelines for Business Analysts

  • Write Gherkin acceptance criteria in declarative business language, not imperative UI clicks: focus on user behavior and intent, not buttons.
  • Use "Scenario Outline" with an "Examples:" data table when you have the same workflow that needs testing across multiple parameter variations.

Practical Hands-On Exercises

  1. Draft a Gherkin BDD scenario for a user entering an incorrect OTP during login.