SlideShare a Scribd company logo
1 of 29
Download to read offline
GHERKIN
ubiquitous language for automated acceptance testing
What’s Gherkin?
• an ubiquitous language for

developers and stakeholders
• aimed for automated 

acceptance tests
• it adheres to BDD
What’s BDD?
Behavior Driven Development
1
2
3
Why Gherkin?
• write executable specifications
• enforce a collaborative approach
• force a specification format
• serve as living documentation
The language
• support for multiple languages
• small set of keywords: 

Feature, Background, Scenario, 

Given, When, Then, And, But, *, 

Scenario Outline, Examples
Feature
• provide summary documentation
• one feature per file
• avoid long descriptions
Feature
Feature: feature title
In order to <meet some goal>
As a <type of stakeholder>
I want <a feature>
Scenario
• describes how system should
behave under a particular
situation
• follows a common pattern: 

context, action, outcome
Scenario
Scenario: Successful withdrawal from an account
Given I have $100 in my account
When I request $20
Then my balance should be $80
context
outcome(s)
action(s)
Scenario
Scenario: Attempt withdrawal using blocked PIN
Given i have $100 in my account
But my PIN is blocked
When i withdraw $50
Then my request should be refuted
And i am forced to reset my PIN
context
outcome(s)
action(s)
Capturing values
• values passed to code as
arguments
• string wrapped by double quotes
• all of the numbers
Scenario: Request a new card
Given I’ve lost my “Visa”
When I request a new card at the “ACME” desk
And I specify a limit of $ 5000 bucks
Then I should be asked for my account details
And I should be provided with a brand new card
Capturing values
Scenario tips
• must make sense to the “others”
• must be executed independently
• must be deterministic
DRY strategies
• share common context
• avoid repeating scenarios
• group similar data
• strength focus on key examples
Scenario: Change PIN successfully
Given I have been issued a new card
And I insert the card, entering the correct PIN
When I choose “Change PIN” from the menu
And I change the PIN to 9876
Then the system should remember my PIN is now 9876
Scenario: Try to change PIN to the same as before
Given I have been issued a new card
And I insert the card, entering the correct PIN
When I choose "Change PIN” from the menu
And I try to change the PIN to the original number
Then I should see a warning message
Background
Background: Insert a newly issued card and sign in
Given I have been issued a new card
And I insert the card, entering the correct PIN
And I choose “Change PIN” from the menu
Scenario: Change PIN successfully
When I change the PIN to 9876
Then the system should remember my PIN is now 9876
Scenario: Try to change PIN to the same as before
When I try to change the PIN to the original number
Then I should see a warning message
Background
Background
• only one per feature file
• short is better
• avoid setting complicated state
• stick with givens
Given a User “Michael Jackson” born on “August 29, 1958”
And a User “Elvis” born on “January 8, 1935”
And a User “John Lennon” born on “October 9, 1940”
Data tables
Given these Users:
| name | date of birth |
| Michael Jackson | August 29, 1958 |
| Elvis | January 8, 1935 |
| John Lennon | October 9, 1940 |
Formatting
spaces are
ignored
Data tables
Scenario: Withdraw fixed amount of $50
Given i have $500 in my account
When i withdraw the fixed amount of $50
Then i should receive $50 cash
And the balance of my account should be $450
Scenario: Withdraw fixed amount of $100
Given i have $500 in my account
When i withdraw the fixed amount of $100
Then i should receive $100 cash
And the balance of my account should be $400
Scenario Outline
Scenario Outline: Withdraw fixed amount
Given i have <balance> in my account
When i withdraw the fixed amount of <withdrawal>
Then i should receive <received> cash
And the balance of my account should be <remaining>
Examples:
| balance | withdrawal | received | remaining |
| $500 | $50 | $50 | $450 |
| $500 | $100 | $100 | $400 |
As many cases
as you need
Scenario Outline
Scenario Outline: Withdraw fixed amount
Given i have <balance> in my account
When i withdraw the fixed amount of <withdrawal>
Then i should <outcome>
And the balance of my account should be <remaining>
Examples: Successful withdrawal
| balance | withdrawal | outcome | remaining |
| $500 | $50 | receive $50 cash | $450 |
Examples: Attempt to withdraw too much
| balance | withdrawal | outcome | remaining |
| $100 | $200 | see an error message | $100 |
Key examples
Best practices
• fix flickering scenarios
• guard from brittle features
• speed up slow features
• avoid bored stakeholders
Incidental details
Scenario: Check inbox
Given a User “Dave” with password “password”
And a User “Sue” with password “secret”
And an email to “Dave” from “Sue”
When i sign in as “Dave” with password “password”
Then i should see 1 email from “Sue” in my inbox
Scenario: Check inbox
Given i have received an email from “Sue”
When i sign in
Then i should see 1 email from “Sue” in my inbox
Incidental details
Imperative VS declarative
Scenario: Redirect user to requested page after logging in
Given a User “dave” exists with password “secret”
And i am not logged in
When i navigate to the home page
Then i am redirected to the login form
When i fill in “Username” with “dave”
And i fill in “Password” with “secret”
And i press “Login”
Then i should be on the home page
Scenario: Redirect user to requested page after logging in
Given i am an unauthenticated User
When i attempt to view some restricted content
Then i am shown a login form
When i authenticate with valid credentials
Then i should be shown the restricted content
Imperative VS declarative
Who’s write Gherkin?
Tester
Developer
Product
Owner
ubiquitous language for automated acceptance testing
Questions?

More Related Content

What's hot

L4-L7 Application Services with Avi Networks
L4-L7 Application Services with Avi NetworksL4-L7 Application Services with Avi Networks
L4-L7 Application Services with Avi NetworksAvi Networks
 
Specification-By-Example with Gherkin
Specification-By-Example with GherkinSpecification-By-Example with Gherkin
Specification-By-Example with GherkinChristian Hassa
 
"Conref, conkeyref, conrefpush" - reuse strategies in DITA when migrating leg...
"Conref, conkeyref, conrefpush" - reuse strategies in DITA when migrating leg..."Conref, conkeyref, conrefpush" - reuse strategies in DITA when migrating leg...
"Conref, conkeyref, conrefpush" - reuse strategies in DITA when migrating leg...Adam Sanyo
 
The Role of the Agile Business Analyst
The Role of the Agile Business AnalystThe Role of the Agile Business Analyst
The Role of the Agile Business AnalystTechWell
 
Spring Data JDBC: Beyond the Obvious
Spring Data JDBC: Beyond the ObviousSpring Data JDBC: Beyond the Obvious
Spring Data JDBC: Beyond the ObviousVMware Tanzu
 
Microservice - Up to 500k CCU
Microservice - Up to 500k CCUMicroservice - Up to 500k CCU
Microservice - Up to 500k CCUViet Tran
 
Gitlab CI : Integration et Déploiement Continue
Gitlab CI : Integration et Déploiement ContinueGitlab CI : Integration et Déploiement Continue
Gitlab CI : Integration et Déploiement ContinueVincent Composieux
 
An Introduction to Apache Kafka
An Introduction to Apache KafkaAn Introduction to Apache Kafka
An Introduction to Apache KafkaAmir Sedighi
 
[오픈소스컨설팅] Docker를 활용한 Gitlab CI/CD 구성 테스트
[오픈소스컨설팅] Docker를 활용한 Gitlab CI/CD 구성 테스트[오픈소스컨설팅] Docker를 활용한 Gitlab CI/CD 구성 테스트
[오픈소스컨설팅] Docker를 활용한 Gitlab CI/CD 구성 테스트Ji-Woong Choi
 
Kafka: All an engineer needs to know
Kafka: All an engineer needs to knowKafka: All an engineer needs to know
Kafka: All an engineer needs to knowThao Huynh Quang
 
OpenStack DevStack Install - 2부 (Multi-nodes)
OpenStack DevStack Install - 2부 (Multi-nodes)OpenStack DevStack Install - 2부 (Multi-nodes)
OpenStack DevStack Install - 2부 (Multi-nodes)Ian Choi
 
The Rise of ZStandard: Apache Spark/Parquet/ORC/Avro
The Rise of ZStandard: Apache Spark/Parquet/ORC/AvroThe Rise of ZStandard: Apache Spark/Parquet/ORC/Avro
The Rise of ZStandard: Apache Spark/Parquet/ORC/AvroDatabricks
 
kotlinx.serialization
kotlinx.serializationkotlinx.serialization
kotlinx.serializationArawn Park
 
Kotlin and Domain-Driven Design: A perfect match - Kotlin Meetup Munich
Kotlin and Domain-Driven Design: A perfect match - Kotlin Meetup MunichKotlin and Domain-Driven Design: A perfect match - Kotlin Meetup Munich
Kotlin and Domain-Driven Design: A perfect match - Kotlin Meetup MunichFlorian Benz
 
User Story Mapping Workshop (Design Skills 2016)
User Story Mapping Workshop (Design Skills 2016)User Story Mapping Workshop (Design Skills 2016)
User Story Mapping Workshop (Design Skills 2016)Bartosz Mozyrko
 
IoT Sensor Analytics with Python, Jupyter, TensorFlow, Keras, Apache Kafka, K...
IoT Sensor Analytics with Python, Jupyter, TensorFlow, Keras, Apache Kafka, K...IoT Sensor Analytics with Python, Jupyter, TensorFlow, Keras, Apache Kafka, K...
IoT Sensor Analytics with Python, Jupyter, TensorFlow, Keras, Apache Kafka, K...Kai Wähner
 
Krnet2018 kakao container cloud dkos
Krnet2018 kakao container cloud dkosKrnet2018 kakao container cloud dkos
Krnet2018 kakao container cloud dkosWon-Chon Jung
 

What's hot (20)

L4-L7 Application Services with Avi Networks
L4-L7 Application Services with Avi NetworksL4-L7 Application Services with Avi Networks
L4-L7 Application Services with Avi Networks
 
Specification-By-Example with Gherkin
Specification-By-Example with GherkinSpecification-By-Example with Gherkin
Specification-By-Example with Gherkin
 
"Conref, conkeyref, conrefpush" - reuse strategies in DITA when migrating leg...
"Conref, conkeyref, conrefpush" - reuse strategies in DITA when migrating leg..."Conref, conkeyref, conrefpush" - reuse strategies in DITA when migrating leg...
"Conref, conkeyref, conrefpush" - reuse strategies in DITA when migrating leg...
 
The Role of the Agile Business Analyst
The Role of the Agile Business AnalystThe Role of the Agile Business Analyst
The Role of the Agile Business Analyst
 
Spring Data JDBC: Beyond the Obvious
Spring Data JDBC: Beyond the ObviousSpring Data JDBC: Beyond the Obvious
Spring Data JDBC: Beyond the Obvious
 
Microservice - Up to 500k CCU
Microservice - Up to 500k CCUMicroservice - Up to 500k CCU
Microservice - Up to 500k CCU
 
Gitlab CI : Integration et Déploiement Continue
Gitlab CI : Integration et Déploiement ContinueGitlab CI : Integration et Déploiement Continue
Gitlab CI : Integration et Déploiement Continue
 
An Introduction to Apache Kafka
An Introduction to Apache KafkaAn Introduction to Apache Kafka
An Introduction to Apache Kafka
 
[오픈소스컨설팅] Docker를 활용한 Gitlab CI/CD 구성 테스트
[오픈소스컨설팅] Docker를 활용한 Gitlab CI/CD 구성 테스트[오픈소스컨설팅] Docker를 활용한 Gitlab CI/CD 구성 테스트
[오픈소스컨설팅] Docker를 활용한 Gitlab CI/CD 구성 테스트
 
Kafka: All an engineer needs to know
Kafka: All an engineer needs to knowKafka: All an engineer needs to know
Kafka: All an engineer needs to know
 
OpenStack DevStack Install - 2부 (Multi-nodes)
OpenStack DevStack Install - 2부 (Multi-nodes)OpenStack DevStack Install - 2부 (Multi-nodes)
OpenStack DevStack Install - 2부 (Multi-nodes)
 
The Rise of ZStandard: Apache Spark/Parquet/ORC/Avro
The Rise of ZStandard: Apache Spark/Parquet/ORC/AvroThe Rise of ZStandard: Apache Spark/Parquet/ORC/Avro
The Rise of ZStandard: Apache Spark/Parquet/ORC/Avro
 
kotlinx.serialization
kotlinx.serializationkotlinx.serialization
kotlinx.serialization
 
Kotlin and Domain-Driven Design: A perfect match - Kotlin Meetup Munich
Kotlin and Domain-Driven Design: A perfect match - Kotlin Meetup MunichKotlin and Domain-Driven Design: A perfect match - Kotlin Meetup Munich
Kotlin and Domain-Driven Design: A perfect match - Kotlin Meetup Munich
 
User Story Mapping Workshop (Design Skills 2016)
User Story Mapping Workshop (Design Skills 2016)User Story Mapping Workshop (Design Skills 2016)
User Story Mapping Workshop (Design Skills 2016)
 
AtoM's Command Line Tasks - An Introduction
AtoM's Command Line Tasks - An IntroductionAtoM's Command Line Tasks - An Introduction
AtoM's Command Line Tasks - An Introduction
 
IoT Sensor Analytics with Python, Jupyter, TensorFlow, Keras, Apache Kafka, K...
IoT Sensor Analytics with Python, Jupyter, TensorFlow, Keras, Apache Kafka, K...IoT Sensor Analytics with Python, Jupyter, TensorFlow, Keras, Apache Kafka, K...
IoT Sensor Analytics with Python, Jupyter, TensorFlow, Keras, Apache Kafka, K...
 
Krnet2018 kakao container cloud dkos
Krnet2018 kakao container cloud dkosKrnet2018 kakao container cloud dkos
Krnet2018 kakao container cloud dkos
 
Apache Kafka at LinkedIn
Apache Kafka at LinkedInApache Kafka at LinkedIn
Apache Kafka at LinkedIn
 
Neutron packet logging framework
Neutron packet logging frameworkNeutron packet logging framework
Neutron packet logging framework
 

Viewers also liked

A New Dojo: The Art of Story Splitting
A New Dojo: The Art of Story SplittingA New Dojo: The Art of Story Splitting
A New Dojo: The Art of Story SplittingDr. Alexander Schwartz
 
BDD - beyond: Given, When and Then
BDD - beyond: Given, When and ThenBDD - beyond: Given, When and Then
BDD - beyond: Given, When and ThenRiverGlide
 
Scrum Bangalore 13th meet up 13 june 2015 - behaviour driven development - vi...
Scrum Bangalore 13th meet up 13 june 2015 - behaviour driven development - vi...Scrum Bangalore 13th meet up 13 june 2015 - behaviour driven development - vi...
Scrum Bangalore 13th meet up 13 june 2015 - behaviour driven development - vi...Scrum Bangalore
 
Tutorial: Implementing Specification-By-Example with Gherkin
Tutorial: Implementing Specification-By-Example with GherkinTutorial: Implementing Specification-By-Example with Gherkin
Tutorial: Implementing Specification-By-Example with GherkinChristian Hassa
 
Specification by example and agile acceptance testing
Specification by example and agile acceptance testingSpecification by example and agile acceptance testing
Specification by example and agile acceptance testinggojkoadzic
 
Behaviour driven development aka bdd
Behaviour driven development aka bddBehaviour driven development aka bdd
Behaviour driven development aka bddPrince Gupta
 
The Art of Gherkin Scripting - Matt Eakin
The Art of Gherkin Scripting - Matt EakinThe Art of Gherkin Scripting - Matt Eakin
The Art of Gherkin Scripting - Matt EakinQA or the Highway
 
Introduction to Bdd and cucumber
Introduction to Bdd and cucumberIntroduction to Bdd and cucumber
Introduction to Bdd and cucumberNibu Baby
 
Specification by Example
Specification by ExampleSpecification by Example
Specification by ExampleDeclan Whelan
 
An Overview of User Acceptance Testing (UAT)
An Overview of User Acceptance Testing (UAT)An Overview of User Acceptance Testing (UAT)
An Overview of User Acceptance Testing (UAT)Usersnap
 

Viewers also liked (10)

A New Dojo: The Art of Story Splitting
A New Dojo: The Art of Story SplittingA New Dojo: The Art of Story Splitting
A New Dojo: The Art of Story Splitting
 
BDD - beyond: Given, When and Then
BDD - beyond: Given, When and ThenBDD - beyond: Given, When and Then
BDD - beyond: Given, When and Then
 
Scrum Bangalore 13th meet up 13 june 2015 - behaviour driven development - vi...
Scrum Bangalore 13th meet up 13 june 2015 - behaviour driven development - vi...Scrum Bangalore 13th meet up 13 june 2015 - behaviour driven development - vi...
Scrum Bangalore 13th meet up 13 june 2015 - behaviour driven development - vi...
 
Tutorial: Implementing Specification-By-Example with Gherkin
Tutorial: Implementing Specification-By-Example with GherkinTutorial: Implementing Specification-By-Example with Gherkin
Tutorial: Implementing Specification-By-Example with Gherkin
 
Specification by example and agile acceptance testing
Specification by example and agile acceptance testingSpecification by example and agile acceptance testing
Specification by example and agile acceptance testing
 
Behaviour driven development aka bdd
Behaviour driven development aka bddBehaviour driven development aka bdd
Behaviour driven development aka bdd
 
The Art of Gherkin Scripting - Matt Eakin
The Art of Gherkin Scripting - Matt EakinThe Art of Gherkin Scripting - Matt Eakin
The Art of Gherkin Scripting - Matt Eakin
 
Introduction to Bdd and cucumber
Introduction to Bdd and cucumberIntroduction to Bdd and cucumber
Introduction to Bdd and cucumber
 
Specification by Example
Specification by ExampleSpecification by Example
Specification by Example
 
An Overview of User Acceptance Testing (UAT)
An Overview of User Acceptance Testing (UAT)An Overview of User Acceptance Testing (UAT)
An Overview of User Acceptance Testing (UAT)
 

Similar to Gherkin - crash course

Perfecting the pitch with note slides
Perfecting the pitch with note slidesPerfecting the pitch with note slides
Perfecting the pitch with note slidesKen Berkun
 
Personal Finance for Engineers (Yelp 2014)
Personal Finance for Engineers (Yelp 2014)Personal Finance for Engineers (Yelp 2014)
Personal Finance for Engineers (Yelp 2014)Adam Nash
 
Armstrong crowdfunding presentation public version
Armstrong crowdfunding presentation   public versionArmstrong crowdfunding presentation   public version
Armstrong crowdfunding presentation public versionCraig Armstrong
 
Personal Finance for Engineers
Personal Finance for EngineersPersonal Finance for Engineers
Personal Finance for EngineersAdam Nash
 
Pete Craig's Presentation
Pete Craig's PresentationPete Craig's Presentation
Pete Craig's Presentationpetewcraig
 
Growing software from examples
Growing software from examplesGrowing software from examples
Growing software from examplesSeb Rose
 
Story Driven Development With Cucumber
Story Driven Development With CucumberStory Driven Development With Cucumber
Story Driven Development With CucumberSean Cribbs
 
Behavior Driven Development [10] - Software Testing Techniques (CIS640)
Behavior Driven Development [10] - Software Testing Techniques (CIS640)Behavior Driven Development [10] - Software Testing Techniques (CIS640)
Behavior Driven Development [10] - Software Testing Techniques (CIS640)Venkatesh Prasad Ranganath
 
Automated UI test on mobile - with Cucumber/Calabash
Automated UI test on mobile - with Cucumber/CalabashAutomated UI test on mobile - with Cucumber/Calabash
Automated UI test on mobile - with Cucumber/CalabashNiels Frydenholm
 
Behavior-Driven Development for UX Teams
Behavior-Driven Development for UX TeamsBehavior-Driven Development for UX Teams
Behavior-Driven Development for UX TeamsJonathan Abbett
 

Similar to Gherkin - crash course (12)

Perfecting the pitch with note slides
Perfecting the pitch with note slidesPerfecting the pitch with note slides
Perfecting the pitch with note slides
 
Personal Finance for Engineers (Yelp 2014)
Personal Finance for Engineers (Yelp 2014)Personal Finance for Engineers (Yelp 2014)
Personal Finance for Engineers (Yelp 2014)
 
Armstrong crowdfunding presentation public version
Armstrong crowdfunding presentation   public versionArmstrong crowdfunding presentation   public version
Armstrong crowdfunding presentation public version
 
Personal Finance for Engineers
Personal Finance for EngineersPersonal Finance for Engineers
Personal Finance for Engineers
 
Pete Craig's Presentation
Pete Craig's PresentationPete Craig's Presentation
Pete Craig's Presentation
 
Growing software from examples
Growing software from examplesGrowing software from examples
Growing software from examples
 
Story Driven Development With Cucumber
Story Driven Development With CucumberStory Driven Development With Cucumber
Story Driven Development With Cucumber
 
Message passing
Message passingMessage passing
Message passing
 
Behavior Driven Development [10] - Software Testing Techniques (CIS640)
Behavior Driven Development [10] - Software Testing Techniques (CIS640)Behavior Driven Development [10] - Software Testing Techniques (CIS640)
Behavior Driven Development [10] - Software Testing Techniques (CIS640)
 
Automated UI test on mobile - with Cucumber/Calabash
Automated UI test on mobile - with Cucumber/CalabashAutomated UI test on mobile - with Cucumber/Calabash
Automated UI test on mobile - with Cucumber/Calabash
 
Behavior-Driven Development for UX Teams
Behavior-Driven Development for UX TeamsBehavior-Driven Development for UX Teams
Behavior-Driven Development for UX Teams
 
General Worldcat Ill Revised
General Worldcat Ill RevisedGeneral Worldcat Ill Revised
General Worldcat Ill Revised
 

More from Michele Costa (13)

SIOOT
SIOOTSIOOT
SIOOT
 
SIOOT
SIOOTSIOOT
SIOOT
 
Ozonopatia
OzonopatiaOzonopatia
Ozonopatia
 
SIOOT
SIOOTSIOOT
SIOOT
 
SIOOT
SIOOTSIOOT
SIOOT
 
SIOOT
SIOOTSIOOT
SIOOT
 
SIOOT
SIOOTSIOOT
SIOOT
 
SIOOT
SIOOTSIOOT
SIOOT
 
SIOOT
SIOOTSIOOT
SIOOT
 
SIOOT
SIOOTSIOOT
SIOOT
 
SIOOT
SIOOTSIOOT
SIOOT
 
Il trattamento del Papilloma virus della mucosa Geniena mediante ossigeno-ozo...
Il trattamento del Papilloma virus della mucosa Geniena mediante ossigeno-ozo...Il trattamento del Papilloma virus della mucosa Geniena mediante ossigeno-ozo...
Il trattamento del Papilloma virus della mucosa Geniena mediante ossigeno-ozo...
 
Tariffario ANDI
Tariffario ANDITariffario ANDI
Tariffario ANDI
 

Recently uploaded

Keeping your build tool updated in a multi repository world
Keeping your build tool updated in a multi repository worldKeeping your build tool updated in a multi repository world
Keeping your build tool updated in a multi repository worldRoberto Pérez Alcolea
 
Effectively Troubleshoot 9 Types of OutOfMemoryError
Effectively Troubleshoot 9 Types of OutOfMemoryErrorEffectively Troubleshoot 9 Types of OutOfMemoryError
Effectively Troubleshoot 9 Types of OutOfMemoryErrorTier1 app
 
Amazon Bedrock in Action - presentation of the Bedrock's capabilities
Amazon Bedrock in Action - presentation of the Bedrock's capabilitiesAmazon Bedrock in Action - presentation of the Bedrock's capabilities
Amazon Bedrock in Action - presentation of the Bedrock's capabilitiesKrzysztofKkol1
 
Exploring Selenium_Appium Frameworks for Seamless Integration with HeadSpin.pdf
Exploring Selenium_Appium Frameworks for Seamless Integration with HeadSpin.pdfExploring Selenium_Appium Frameworks for Seamless Integration with HeadSpin.pdf
Exploring Selenium_Appium Frameworks for Seamless Integration with HeadSpin.pdfkalichargn70th171
 
Large Language Models for Test Case Evolution and Repair
Large Language Models for Test Case Evolution and RepairLarge Language Models for Test Case Evolution and Repair
Large Language Models for Test Case Evolution and RepairLionel Briand
 
Global Identity Enrolment and Verification Pro Solution - Cizo Technology Ser...
Global Identity Enrolment and Verification Pro Solution - Cizo Technology Ser...Global Identity Enrolment and Verification Pro Solution - Cizo Technology Ser...
Global Identity Enrolment and Verification Pro Solution - Cizo Technology Ser...Cizo Technology Services
 
Post Quantum Cryptography – The Impact on Identity
Post Quantum Cryptography – The Impact on IdentityPost Quantum Cryptography – The Impact on Identity
Post Quantum Cryptography – The Impact on Identityteam-WIBU
 
SpotFlow: Tracking Method Calls and States at Runtime
SpotFlow: Tracking Method Calls and States at RuntimeSpotFlow: Tracking Method Calls and States at Runtime
SpotFlow: Tracking Method Calls and States at Runtimeandrehoraa
 
Patterns for automating API delivery. API conference
Patterns for automating API delivery. API conferencePatterns for automating API delivery. API conference
Patterns for automating API delivery. API conferencessuser9e7c64
 
Sending Calendar Invites on SES and Calendarsnack.pdf
Sending Calendar Invites on SES and Calendarsnack.pdfSending Calendar Invites on SES and Calendarsnack.pdf
Sending Calendar Invites on SES and Calendarsnack.pdf31events.com
 
What’s New in VictoriaMetrics: Q1 2024 Updates
What’s New in VictoriaMetrics: Q1 2024 UpdatesWhat’s New in VictoriaMetrics: Q1 2024 Updates
What’s New in VictoriaMetrics: Q1 2024 UpdatesVictoriaMetrics
 
Powering Real-Time Decisions with Continuous Data Streams
Powering Real-Time Decisions with Continuous Data StreamsPowering Real-Time Decisions with Continuous Data Streams
Powering Real-Time Decisions with Continuous Data StreamsSafe Software
 
Introduction to Firebase Workshop Slides
Introduction to Firebase Workshop SlidesIntroduction to Firebase Workshop Slides
Introduction to Firebase Workshop Slidesvaideheekore1
 
Not a Kubernetes fan? The state of PaaS in 2024
Not a Kubernetes fan? The state of PaaS in 2024Not a Kubernetes fan? The state of PaaS in 2024
Not a Kubernetes fan? The state of PaaS in 2024Anthony Dahanne
 
Enhancing Supply Chain Visibility with Cargo Cloud Solutions.pdf
Enhancing Supply Chain Visibility with Cargo Cloud Solutions.pdfEnhancing Supply Chain Visibility with Cargo Cloud Solutions.pdf
Enhancing Supply Chain Visibility with Cargo Cloud Solutions.pdfRTS corp
 
VK Business Profile - provides IT solutions and Web Development
VK Business Profile - provides IT solutions and Web DevelopmentVK Business Profile - provides IT solutions and Web Development
VK Business Profile - provides IT solutions and Web Developmentvyaparkranti
 
eSoftTools IMAP Backup Software and migration tools
eSoftTools IMAP Backup Software and migration toolseSoftTools IMAP Backup Software and migration tools
eSoftTools IMAP Backup Software and migration toolsosttopstonverter
 
Odoo 14 - eLearning Module In Odoo 14 Enterprise
Odoo 14 - eLearning Module In Odoo 14 EnterpriseOdoo 14 - eLearning Module In Odoo 14 Enterprise
Odoo 14 - eLearning Module In Odoo 14 Enterprisepreethippts
 
Leveraging AI for Mobile App Testing on Real Devices | Applitools + Kobiton
Leveraging AI for Mobile App Testing on Real Devices | Applitools + KobitonLeveraging AI for Mobile App Testing on Real Devices | Applitools + Kobiton
Leveraging AI for Mobile App Testing on Real Devices | Applitools + KobitonApplitools
 
Osi security architecture in network.pptx
Osi security architecture in network.pptxOsi security architecture in network.pptx
Osi security architecture in network.pptxVinzoCenzo
 

Recently uploaded (20)

Keeping your build tool updated in a multi repository world
Keeping your build tool updated in a multi repository worldKeeping your build tool updated in a multi repository world
Keeping your build tool updated in a multi repository world
 
Effectively Troubleshoot 9 Types of OutOfMemoryError
Effectively Troubleshoot 9 Types of OutOfMemoryErrorEffectively Troubleshoot 9 Types of OutOfMemoryError
Effectively Troubleshoot 9 Types of OutOfMemoryError
 
Amazon Bedrock in Action - presentation of the Bedrock's capabilities
Amazon Bedrock in Action - presentation of the Bedrock's capabilitiesAmazon Bedrock in Action - presentation of the Bedrock's capabilities
Amazon Bedrock in Action - presentation of the Bedrock's capabilities
 
Exploring Selenium_Appium Frameworks for Seamless Integration with HeadSpin.pdf
Exploring Selenium_Appium Frameworks for Seamless Integration with HeadSpin.pdfExploring Selenium_Appium Frameworks for Seamless Integration with HeadSpin.pdf
Exploring Selenium_Appium Frameworks for Seamless Integration with HeadSpin.pdf
 
Large Language Models for Test Case Evolution and Repair
Large Language Models for Test Case Evolution and RepairLarge Language Models for Test Case Evolution and Repair
Large Language Models for Test Case Evolution and Repair
 
Global Identity Enrolment and Verification Pro Solution - Cizo Technology Ser...
Global Identity Enrolment and Verification Pro Solution - Cizo Technology Ser...Global Identity Enrolment and Verification Pro Solution - Cizo Technology Ser...
Global Identity Enrolment and Verification Pro Solution - Cizo Technology Ser...
 
Post Quantum Cryptography – The Impact on Identity
Post Quantum Cryptography – The Impact on IdentityPost Quantum Cryptography – The Impact on Identity
Post Quantum Cryptography – The Impact on Identity
 
SpotFlow: Tracking Method Calls and States at Runtime
SpotFlow: Tracking Method Calls and States at RuntimeSpotFlow: Tracking Method Calls and States at Runtime
SpotFlow: Tracking Method Calls and States at Runtime
 
Patterns for automating API delivery. API conference
Patterns for automating API delivery. API conferencePatterns for automating API delivery. API conference
Patterns for automating API delivery. API conference
 
Sending Calendar Invites on SES and Calendarsnack.pdf
Sending Calendar Invites on SES and Calendarsnack.pdfSending Calendar Invites on SES and Calendarsnack.pdf
Sending Calendar Invites on SES and Calendarsnack.pdf
 
What’s New in VictoriaMetrics: Q1 2024 Updates
What’s New in VictoriaMetrics: Q1 2024 UpdatesWhat’s New in VictoriaMetrics: Q1 2024 Updates
What’s New in VictoriaMetrics: Q1 2024 Updates
 
Powering Real-Time Decisions with Continuous Data Streams
Powering Real-Time Decisions with Continuous Data StreamsPowering Real-Time Decisions with Continuous Data Streams
Powering Real-Time Decisions with Continuous Data Streams
 
Introduction to Firebase Workshop Slides
Introduction to Firebase Workshop SlidesIntroduction to Firebase Workshop Slides
Introduction to Firebase Workshop Slides
 
Not a Kubernetes fan? The state of PaaS in 2024
Not a Kubernetes fan? The state of PaaS in 2024Not a Kubernetes fan? The state of PaaS in 2024
Not a Kubernetes fan? The state of PaaS in 2024
 
Enhancing Supply Chain Visibility with Cargo Cloud Solutions.pdf
Enhancing Supply Chain Visibility with Cargo Cloud Solutions.pdfEnhancing Supply Chain Visibility with Cargo Cloud Solutions.pdf
Enhancing Supply Chain Visibility with Cargo Cloud Solutions.pdf
 
VK Business Profile - provides IT solutions and Web Development
VK Business Profile - provides IT solutions and Web DevelopmentVK Business Profile - provides IT solutions and Web Development
VK Business Profile - provides IT solutions and Web Development
 
eSoftTools IMAP Backup Software and migration tools
eSoftTools IMAP Backup Software and migration toolseSoftTools IMAP Backup Software and migration tools
eSoftTools IMAP Backup Software and migration tools
 
Odoo 14 - eLearning Module In Odoo 14 Enterprise
Odoo 14 - eLearning Module In Odoo 14 EnterpriseOdoo 14 - eLearning Module In Odoo 14 Enterprise
Odoo 14 - eLearning Module In Odoo 14 Enterprise
 
Leveraging AI for Mobile App Testing on Real Devices | Applitools + Kobiton
Leveraging AI for Mobile App Testing on Real Devices | Applitools + KobitonLeveraging AI for Mobile App Testing on Real Devices | Applitools + Kobiton
Leveraging AI for Mobile App Testing on Real Devices | Applitools + Kobiton
 
Osi security architecture in network.pptx
Osi security architecture in network.pptxOsi security architecture in network.pptx
Osi security architecture in network.pptx
 

Gherkin - crash course

  • 1. GHERKIN ubiquitous language for automated acceptance testing
  • 2. What’s Gherkin? • an ubiquitous language for
 developers and stakeholders • aimed for automated 
 acceptance tests • it adheres to BDD
  • 3. What’s BDD? Behavior Driven Development 1 2 3
  • 4. Why Gherkin? • write executable specifications • enforce a collaborative approach • force a specification format • serve as living documentation
  • 5. The language • support for multiple languages • small set of keywords: 
 Feature, Background, Scenario, 
 Given, When, Then, And, But, *, 
 Scenario Outline, Examples
  • 6. Feature • provide summary documentation • one feature per file • avoid long descriptions
  • 7. Feature Feature: feature title In order to <meet some goal> As a <type of stakeholder> I want <a feature>
  • 8. Scenario • describes how system should behave under a particular situation • follows a common pattern: 
 context, action, outcome
  • 9. Scenario Scenario: Successful withdrawal from an account Given I have $100 in my account When I request $20 Then my balance should be $80 context outcome(s) action(s)
  • 10. Scenario Scenario: Attempt withdrawal using blocked PIN Given i have $100 in my account But my PIN is blocked When i withdraw $50 Then my request should be refuted And i am forced to reset my PIN context outcome(s) action(s)
  • 11. Capturing values • values passed to code as arguments • string wrapped by double quotes • all of the numbers
  • 12. Scenario: Request a new card Given I’ve lost my “Visa” When I request a new card at the “ACME” desk And I specify a limit of $ 5000 bucks Then I should be asked for my account details And I should be provided with a brand new card Capturing values
  • 13. Scenario tips • must make sense to the “others” • must be executed independently • must be deterministic
  • 14. DRY strategies • share common context • avoid repeating scenarios • group similar data • strength focus on key examples
  • 15. Scenario: Change PIN successfully Given I have been issued a new card And I insert the card, entering the correct PIN When I choose “Change PIN” from the menu And I change the PIN to 9876 Then the system should remember my PIN is now 9876 Scenario: Try to change PIN to the same as before Given I have been issued a new card And I insert the card, entering the correct PIN When I choose "Change PIN” from the menu And I try to change the PIN to the original number Then I should see a warning message Background
  • 16. Background: Insert a newly issued card and sign in Given I have been issued a new card And I insert the card, entering the correct PIN And I choose “Change PIN” from the menu Scenario: Change PIN successfully When I change the PIN to 9876 Then the system should remember my PIN is now 9876 Scenario: Try to change PIN to the same as before When I try to change the PIN to the original number Then I should see a warning message Background
  • 17. Background • only one per feature file • short is better • avoid setting complicated state • stick with givens
  • 18. Given a User “Michael Jackson” born on “August 29, 1958” And a User “Elvis” born on “January 8, 1935” And a User “John Lennon” born on “October 9, 1940” Data tables
  • 19. Given these Users: | name | date of birth | | Michael Jackson | August 29, 1958 | | Elvis | January 8, 1935 | | John Lennon | October 9, 1940 | Formatting spaces are ignored Data tables
  • 20. Scenario: Withdraw fixed amount of $50 Given i have $500 in my account When i withdraw the fixed amount of $50 Then i should receive $50 cash And the balance of my account should be $450 Scenario: Withdraw fixed amount of $100 Given i have $500 in my account When i withdraw the fixed amount of $100 Then i should receive $100 cash And the balance of my account should be $400 Scenario Outline
  • 21. Scenario Outline: Withdraw fixed amount Given i have <balance> in my account When i withdraw the fixed amount of <withdrawal> Then i should receive <received> cash And the balance of my account should be <remaining> Examples: | balance | withdrawal | received | remaining | | $500 | $50 | $50 | $450 | | $500 | $100 | $100 | $400 | As many cases as you need Scenario Outline
  • 22. Scenario Outline: Withdraw fixed amount Given i have <balance> in my account When i withdraw the fixed amount of <withdrawal> Then i should <outcome> And the balance of my account should be <remaining> Examples: Successful withdrawal | balance | withdrawal | outcome | remaining | | $500 | $50 | receive $50 cash | $450 | Examples: Attempt to withdraw too much | balance | withdrawal | outcome | remaining | | $100 | $200 | see an error message | $100 | Key examples
  • 23. Best practices • fix flickering scenarios • guard from brittle features • speed up slow features • avoid bored stakeholders
  • 24. Incidental details Scenario: Check inbox Given a User “Dave” with password “password” And a User “Sue” with password “secret” And an email to “Dave” from “Sue” When i sign in as “Dave” with password “password” Then i should see 1 email from “Sue” in my inbox
  • 25. Scenario: Check inbox Given i have received an email from “Sue” When i sign in Then i should see 1 email from “Sue” in my inbox Incidental details
  • 26. Imperative VS declarative Scenario: Redirect user to requested page after logging in Given a User “dave” exists with password “secret” And i am not logged in When i navigate to the home page Then i am redirected to the login form When i fill in “Username” with “dave” And i fill in “Password” with “secret” And i press “Login” Then i should be on the home page
  • 27. Scenario: Redirect user to requested page after logging in Given i am an unauthenticated User When i attempt to view some restricted content Then i am shown a login form When i authenticate with valid credentials Then i should be shown the restricted content Imperative VS declarative
  • 29. ubiquitous language for automated acceptance testing Questions?