Acceptance Tests and
Gherkin
Presenter: Stephanie Vineyard
User Stories
• Simple, clear, short description of
customer valued functionality
• Representation rather than documentation
What’s A User Story?
Card Conversation Confirm
3 C’s of user stories
User Story Template
As a [type of user], I can [goal] so that
[value]
Title:
Notes:
Assumptions:
Estimate:
Constraints:
As a [type of user], I want [goal] so that
[value]
Title:
Notes:
Assumptions:
Estimate:
Constraints:
Priority:
Example
As a [type of user], I can [goal] so
that [value]
Title:
Notes:
Assumptions:
Estimate:
Constraints:
As a coffee shop visitor, I can checkout using my
credit card so that I can purchase a selected
beverage.
Checkout Using Credit Card
Notes: Support mc, visa, amex
25
Constraint: Must use Chase payment service
13 pts
Acceptance Criteria
As a [type of user], I can [goal] so
that [value]
Title:
Notes:
Assumptions:
Constraints:
Test with valid mc, visa, amex passes
Test with valid other cards fails
Test with expired card fails
Test with invalid cvv fails
Test with invalid zip fails
Checkout Using Credit Card
Requirements using
examples
The essence of building
a program is debugging
the specification.
Frederick Brooks (1987)
• Specification by Example
• Executable Specifications
• Scenarios
• Automated Acceptance Tests (AAT)
• Behavior Driven Development (BDD)
• Acceptance Test Driven Development
(ATDD)
• Gherkin Syntax
Common Terminology
Requirements using Examples
Elements of this Technique
Tooling
Documentation
Collaboration
18
Building in Quality
Plan Collaborate Deliver
Build the
right thing
Build the thing
right
Specify the right amount?
How it all relates
An Example of using an
example…
gher·kin
ˈgərkin/
noun
1. a small variety of cucumber, or a young green
cucumber used for pickling.
Gherkin
Business readable, domain specific language
• Given < situation >
• When < action >
• Then < expected result >
Gherkin syntax
25
Developing Examples
1. Feature 2. User Story 3. Collaborate 4. Scenarios 5. Examples
Background:
You are developing an
online ordering website
for a local company that
grows, harvests and sells
botanicals directly to
customers.
Feature:
Calculate customer order
Feature
1. Feature 2. User Story 3. Collaborate 4. Scenarios 5. Examples
Calculate Order Feature
Create a user story
User Story:
As a customer, I want to review shipping costs in
my shopping cart before checking out, so that I
can see if I will receive free shipping.
User Story
1. Feature 2. User Story 3. Collaborate 4. Scenarios 5. Examples
Collaborate
31
How do I
describe
what I
want?
How do I
validate
that this
work is
done?
How do I
code this
feature?
What are
the details
of this
feature?
1. Feature 2. User Story 3. Collaborate 4. Scenarios 5. Examples
Feature: Determine shipping rates
Scenario 1: Standard Shipping Rate
Scenario 2: Free Shipping Rate
Creating Acceptance Tests
32
1. Feature 2. User Story 3. Collaborate 4. Scenarios 5. Examples
Scenario: Standard
Shipping Rate
Given I am a customer
And my order amount is
$49.99
When I view my cart
Then I see that shipping
costs are $3.99
Scenarios
Scenario: Free Shipping
Rate
Given I am a customer
And my order amount is
$50.00
When I view my cart
Then I see that shipping
costs are $0.00
Scenario Outlines
Feature: Determine shipping rate
Scenario Outline: Standard shipping rate
• Given that I am a customer
• And my order amount is <order amount>
• When I view my cart
• Then I see that shipping costs are <shipping cost>
Examples:
| order amount | shipping cost
| $49.99 | $3.99
| $50.00 | $0.00
| $75.00 | $0.00
Create your acceptance
tests
• Imperative
– Descriptive
– Step-by-step instructions
– Heavier reliance on the user interface
• Declarative
– Informative
– Abstracts details
– Limits reference to specific user interface
behavior
Gherkin Styles
Feature: Validate user
Scenario: User with valid credentials returns to order
Imperative (Narrative)
Given I am an unauthenticated user
And I am on the login page
And I enter a valid name in the Name field
And I enter the corresponding password in the Password field
When I select the Login button
Then I should see the welcome page
Imperative Style
Implementation Detail – what if
decide to use Token-based
authentication or single sign-on?
UI Detail – what if the user interface
changes and you select name from
a drop-down list or select a radio
button?
Feature: Validate user
Scenario: User with valid credentials returns to order
Declarative (Informative)
Given I am an unauthenticated user
And I am on the login page
When I submit valid credentials
Then I should see the welcome page
Declarative Style
Feature: Validate user
Scenario: User with valid credentials returns to order
Side-by-side Comparison
Imperative (Narrative) Declarative (Informative)
Given I am an unauthenticated user
And I am on the login page
And I enter a valid name in the Name field
And I enter the corresponding password in
the Password field
When I select the Login button
Then I should see the welcome page
Given I am an unauthenticated user
And I am on the login page
When I submit valid credentials
Then I should see the welcome page
— If the user interface is constantly changing, it is better to
use imperative.
— Declarative is easier to maintain.
— Developers prefer the imperative style.
— If a stakeholder is concerned about the user’s
interaction experience, use imperative.
— Declarative specifies implementation details.
True or False?
Automated testing is an
Agile practice
• Frequent and immediate feedback on
software quality
• Courage and creativity
• Always delivering working software
Test automation
Path to automation
• Specification by Example by Gojko Adzic
http://www.amazon.com/Specification-Example-Successful-Deliver-
Software/dp/1617290084
• Writing Gherkin:
http://behat.readthedocs.org/en/v2.5/guides/1.gherkin.html
• The Cucumber Book by Matt Wynne
http://www.amazon.com/Cucumber-Book-Behaviour-Driven-
Development-
Programmers/dp/1934356808/ref=sr_1_1?s=books&ie=UTF8&qid=
1421707079&sr=1-1&keywords=cucumber
Resources

More Related Content

PDF
How to improve our acceptance tests - Pyccuracy VS Splinter
PDF
End to End Testing: Bug Squashing for API Developers
PDF
Real-time hypermedia APIs: Exploring the fundamentals of how we build network...
PDF
BDD in Action – principles, practices and real-world application
PPTX
BDD testing with cucumber
PPT
Behavior Driven Development (BDD) and Agile Testing
PPTX
Behavior Driven Development
PDF
Behavior Driven Development with Cucumber
How to improve our acceptance tests - Pyccuracy VS Splinter
End to End Testing: Bug Squashing for API Developers
Real-time hypermedia APIs: Exploring the fundamentals of how we build network...
BDD in Action – principles, practices and real-world application
BDD testing with cucumber
Behavior Driven Development (BDD) and Agile Testing
Behavior Driven Development
Behavior Driven Development with Cucumber

Similar to 1501 meetup (20)

PPTX
Modeling Requirements Using Examples
PDF
Behavior Driven Development
PPT
Use case-diagrams
PPTX
The Art of Storytelling
PDF
Growing software from examples
PPTX
Priortization Technique.pptx
PDF
Qual vs Quant: Using Better Data to Build Better Products
PDF
User stories writing - Codemotion 2013
PDF
User Stories Writing - Codemotion 2013
PPTX
Final_Presentation_Furniture_Shop -.pptx
PDF
Beyond Given/When/Then - why diving into Cucumber is the wrong approach to ad...
PDF
The Art of Storytelling
PPTX
How to Write Great User Stories Today.pptx
PDF
User Story Splitting
PDF
BDD - Collaborate like you mean it!
PDF
Selling the Carrot, or: how to convert by balancing value, cost and perception
PPTX
User stories in application development.pptx
PDF
Vertical slicing patterns
PDF
Qual vs. Quant: Using data to Build Better Products
PPTX
Online shopping e commerce website for cloth retail.pptx
Modeling Requirements Using Examples
Behavior Driven Development
Use case-diagrams
The Art of Storytelling
Growing software from examples
Priortization Technique.pptx
Qual vs Quant: Using Better Data to Build Better Products
User stories writing - Codemotion 2013
User Stories Writing - Codemotion 2013
Final_Presentation_Furniture_Shop -.pptx
Beyond Given/When/Then - why diving into Cucumber is the wrong approach to ad...
The Art of Storytelling
How to Write Great User Stories Today.pptx
User Story Splitting
BDD - Collaborate like you mean it!
Selling the Carrot, or: how to convert by balancing value, cost and perception
User stories in application development.pptx
Vertical slicing patterns
Qual vs. Quant: Using data to Build Better Products
Online shopping e commerce website for cloth retail.pptx
Ad

Recently uploaded (20)

PDF
STKI Israel Market Study 2025 version august
PDF
sustainability-14-14877-v2.pddhzftheheeeee
PDF
OpenACC and Open Hackathons Monthly Highlights July 2025
PDF
NewMind AI Weekly Chronicles – August ’25 Week III
DOCX
search engine optimization ppt fir known well about this
PDF
Credit Without Borders: AI and Financial Inclusion in Bangladesh
PDF
A contest of sentiment analysis: k-nearest neighbor versus neural network
PDF
Hindi spoken digit analysis for native and non-native speakers
PPTX
Final SEM Unit 1 for mit wpu at pune .pptx
PPTX
AI IN MARKETING- PRESENTED BY ANWAR KABIR 1st June 2025.pptx
PDF
ENT215_Completing-a-large-scale-migration-and-modernization-with-AWS.pdf
PDF
Enhancing emotion recognition model for a student engagement use case through...
PDF
sbt 2.0: go big (Scala Days 2025 edition)
PDF
1 - Historical Antecedents, Social Consideration.pdf
PDF
Getting started with AI Agents and Multi-Agent Systems
PDF
Hybrid horned lizard optimization algorithm-aquila optimizer for DC motor
PDF
A comparative study of natural language inference in Swahili using monolingua...
PPTX
Modernising the Digital Integration Hub
PDF
A Late Bloomer's Guide to GenAI: Ethics, Bias, and Effective Prompting - Boha...
PPTX
Benefits of Physical activity for teenagers.pptx
STKI Israel Market Study 2025 version august
sustainability-14-14877-v2.pddhzftheheeeee
OpenACC and Open Hackathons Monthly Highlights July 2025
NewMind AI Weekly Chronicles – August ’25 Week III
search engine optimization ppt fir known well about this
Credit Without Borders: AI and Financial Inclusion in Bangladesh
A contest of sentiment analysis: k-nearest neighbor versus neural network
Hindi spoken digit analysis for native and non-native speakers
Final SEM Unit 1 for mit wpu at pune .pptx
AI IN MARKETING- PRESENTED BY ANWAR KABIR 1st June 2025.pptx
ENT215_Completing-a-large-scale-migration-and-modernization-with-AWS.pdf
Enhancing emotion recognition model for a student engagement use case through...
sbt 2.0: go big (Scala Days 2025 edition)
1 - Historical Antecedents, Social Consideration.pdf
Getting started with AI Agents and Multi-Agent Systems
Hybrid horned lizard optimization algorithm-aquila optimizer for DC motor
A comparative study of natural language inference in Swahili using monolingua...
Modernising the Digital Integration Hub
A Late Bloomer's Guide to GenAI: Ethics, Bias, and Effective Prompting - Boha...
Benefits of Physical activity for teenagers.pptx
Ad

1501 meetup

  • 3. • Simple, clear, short description of customer valued functionality • Representation rather than documentation What’s A User Story?
  • 4. Card Conversation Confirm 3 C’s of user stories
  • 5. User Story Template As a [type of user], I can [goal] so that [value] Title: Notes: Assumptions: Estimate: Constraints: As a [type of user], I want [goal] so that [value] Title: Notes: Assumptions: Estimate: Constraints: Priority:
  • 6. Example As a [type of user], I can [goal] so that [value] Title: Notes: Assumptions: Estimate: Constraints: As a coffee shop visitor, I can checkout using my credit card so that I can purchase a selected beverage. Checkout Using Credit Card Notes: Support mc, visa, amex 25 Constraint: Must use Chase payment service 13 pts
  • 7. Acceptance Criteria As a [type of user], I can [goal] so that [value] Title: Notes: Assumptions: Constraints: Test with valid mc, visa, amex passes Test with valid other cards fails Test with expired card fails Test with invalid cvv fails Test with invalid zip fails Checkout Using Credit Card
  • 9. The essence of building a program is debugging the specification. Frederick Brooks (1987)
  • 10. • Specification by Example • Executable Specifications • Scenarios • Automated Acceptance Tests (AAT) • Behavior Driven Development (BDD) • Acceptance Test Driven Development (ATDD) • Gherkin Syntax Common Terminology Requirements using Examples
  • 11. Elements of this Technique Tooling Documentation Collaboration 18
  • 12. Building in Quality Plan Collaborate Deliver Build the right thing Build the thing right
  • 13. Specify the right amount?
  • 14. How it all relates
  • 15. An Example of using an example…
  • 16. gher·kin ˈgərkin/ noun 1. a small variety of cucumber, or a young green cucumber used for pickling. Gherkin Business readable, domain specific language
  • 17. • Given < situation > • When < action > • Then < expected result > Gherkin syntax 25
  • 18. Developing Examples 1. Feature 2. User Story 3. Collaborate 4. Scenarios 5. Examples
  • 19. Background: You are developing an online ordering website for a local company that grows, harvests and sells botanicals directly to customers. Feature: Calculate customer order Feature 1. Feature 2. User Story 3. Collaborate 4. Scenarios 5. Examples
  • 21. Create a user story
  • 22. User Story: As a customer, I want to review shipping costs in my shopping cart before checking out, so that I can see if I will receive free shipping. User Story 1. Feature 2. User Story 3. Collaborate 4. Scenarios 5. Examples
  • 23. Collaborate 31 How do I describe what I want? How do I validate that this work is done? How do I code this feature? What are the details of this feature? 1. Feature 2. User Story 3. Collaborate 4. Scenarios 5. Examples
  • 24. Feature: Determine shipping rates Scenario 1: Standard Shipping Rate Scenario 2: Free Shipping Rate Creating Acceptance Tests 32 1. Feature 2. User Story 3. Collaborate 4. Scenarios 5. Examples
  • 25. Scenario: Standard Shipping Rate Given I am a customer And my order amount is $49.99 When I view my cart Then I see that shipping costs are $3.99 Scenarios Scenario: Free Shipping Rate Given I am a customer And my order amount is $50.00 When I view my cart Then I see that shipping costs are $0.00
  • 26. Scenario Outlines Feature: Determine shipping rate Scenario Outline: Standard shipping rate • Given that I am a customer • And my order amount is <order amount> • When I view my cart • Then I see that shipping costs are <shipping cost> Examples: | order amount | shipping cost | $49.99 | $3.99 | $50.00 | $0.00 | $75.00 | $0.00
  • 28. • Imperative – Descriptive – Step-by-step instructions – Heavier reliance on the user interface • Declarative – Informative – Abstracts details – Limits reference to specific user interface behavior Gherkin Styles
  • 29. Feature: Validate user Scenario: User with valid credentials returns to order Imperative (Narrative) Given I am an unauthenticated user And I am on the login page And I enter a valid name in the Name field And I enter the corresponding password in the Password field When I select the Login button Then I should see the welcome page Imperative Style Implementation Detail – what if decide to use Token-based authentication or single sign-on? UI Detail – what if the user interface changes and you select name from a drop-down list or select a radio button?
  • 30. Feature: Validate user Scenario: User with valid credentials returns to order Declarative (Informative) Given I am an unauthenticated user And I am on the login page When I submit valid credentials Then I should see the welcome page Declarative Style
  • 31. Feature: Validate user Scenario: User with valid credentials returns to order Side-by-side Comparison Imperative (Narrative) Declarative (Informative) Given I am an unauthenticated user And I am on the login page And I enter a valid name in the Name field And I enter the corresponding password in the Password field When I select the Login button Then I should see the welcome page Given I am an unauthenticated user And I am on the login page When I submit valid credentials Then I should see the welcome page
  • 32. — If the user interface is constantly changing, it is better to use imperative. — Declarative is easier to maintain. — Developers prefer the imperative style. — If a stakeholder is concerned about the user’s interaction experience, use imperative. — Declarative specifies implementation details. True or False?
  • 33. Automated testing is an Agile practice
  • 34. • Frequent and immediate feedback on software quality • Courage and creativity • Always delivering working software Test automation
  • 36. • Specification by Example by Gojko Adzic http://www.amazon.com/Specification-Example-Successful-Deliver- Software/dp/1617290084 • Writing Gherkin: http://behat.readthedocs.org/en/v2.5/guides/1.gherkin.html • The Cucumber Book by Matt Wynne http://www.amazon.com/Cucumber-Book-Behaviour-Driven- Development- Programmers/dp/1934356808/ref=sr_1_1?s=books&ie=UTF8&qid= 1421707079&sr=1-1&keywords=cucumber Resources

Editor's Notes

  • #3: ----- Meeting Notes (1/19/15 18:20) ----- Constellation exercises 1- user stories 2 - acceptance tests
  • #4: Do you have to use user stories? What is the advantage? notecard; concise Focus on value, output over tasks Can be moved or prioritized easily
  • #5: Written description used for planning Conversation to flesh out details Tests to determine completeness
  • #12: [Activity] Have the group work on white paper and rank in order of importnatce How isn’t on a user story
  • #13: What is required? Only use what it takes for team to accomplish Default to none and add as required What if part of contract, etc? Project documentation but not part of user story
  • #18: Specification by example (SBE) is a collaborative approach to defining requirements and business-oriented functional tests for software products based on capturing and illustrating requirements using realistic examples instead of abstract statements. Executable Specifications – are requirements which can be written as tests; primarily used in TDD Scenario - a postulated sequence or development of events. AAT – automated testing conducted to determine if the requirements of a specification or contract are met. BDD – a process based on TDD; combine TDD approach with domain knowledge. An idea about how software can be managed by both business and technical insight ATDD – a development methodology based on communication between the business customers, the developers, and the testers Gherkin Syntax – business readable, domain specific language
  • #20: Building the right thing – this is where BAs can provide the most value through requirements. Building the thing right – these are s/w development best practices, such as automated test, peer code reviews, etc. Variation of the graphic taken from: http://www.nataliehanson.com/2013/07/19/agile-implications-for-ux-research
  • #21: Makes abstract concepts more relatable Minimizes misinterpretation Highlights success, alternative and exception cases
  • #22: There is a growing body of evidence proving that optimism bias represents one of the biggest single causes of risk for megaproject overspend http://www.ted.com/talks/tali_sharot_the_optimism_bias
  • #26: Flexible: can be used manually or for a variety of development tools to automate User centric: focuses on actions and outcomes not design specific Light weight: does not require have documentation but focuses on building the thing right
  • #34: A user story comprises of one or more Scenarios, each of which represents a concrete example of the behavior of the system.
  • #38: [Activity] Group Discussion – Describe how you would make this user story testable. What would be the conditions of satisfaction? Ask for a class volunteer to serve as the Product Owner and address any questions about the business rules/features. Write out on flip chart.
  • #49: Lack of slide space – write out on flipchart how can also have examples with the “Better Example”. Show different sales tax amounts by state.
  • #52: Automation takes time and effort Separate software development project Balance level of effort to automate with value provided Prioritize test automation efforts Management support required Return on investment More efficient software delivery team Higher quality software