SlideShare a Scribd company logo
1 of 12
Download to read offline
Getting the Language
Right with Cucumber
Richard Lawrence, Agile For All
Varieties of
Language in
Cucumber
Scenarios
Tautological
Scenario: Search for a Book
When I search for a book
Then I should see the correct results
Scenario: Search for a book
Given the following Authors:
| id | name |
| 1 | Charles Dickens |
| 2 | John Steinbeck |
| 3 | Fyodor Dostoyevsky |
And the following Titles:
| id | title | author_id |
| 1 | A Tale of Two Cities | 1 |
| 2 | Crime and Punishment | 3 |
| 3 | East of Eden | 2 |
And I'm on "http://www.bookstore.biz/"
When I fill in "Dickens" in "//input[name()='q']"
And I click "#searchButton"
Then there should be 1 "div.book div.title" element
And the page should contain "A Tale of Two Cities"
Super Technical
Scenario: Search for a book
Given the following catalog:
| Title | Author |
| A Tale of Two Cities | Charles Dickens |
| Crime and Punishment | Fyodor Dostoyevsky |
| East of Eden | John Steinbeck |
And I'm on the bookstore home page
When I fill in "Dickens" in the search field
And I click "Search"
Then I should see only "A Tale of Two Cities" in the results
Scripty, with Implementation Details
Scenario: Search for a book
Given the following catalog:
| Title | Author |
| A Tale of Two Cities | Charles Dickens |
| Crime and Punishment | Fyodor Dostoyevsky |
| East of Eden | John Steinbeck |
When I search for "Dickens"
Then I should see only "A Tale of Two Cities" in the results
Example in Domain Language
Example in Domain Language
with Excess Detail
Scenario: Search for a book
Given the following catalog:
| Title | Author | Publisher | ISBN |
| A Tale of Two Cities | Charles Dickens | Qualitas Classics | 1897093594 |
| Crime and Punishment | Fyodor Dostoyevsky | Simon & Brown | 1936041030 |
| East of Eden | John Steinbeck | Penguin | 0142000655 |
When I search for "Dickens"
Then I should see only the following in the results:
| Title | Author | Format | Price |
| A Tale of Two Cities | Charles Dickens | Paperback | $14.90 |
Different Kinds of Scenarios
TautologicalDom
ain
LanguageExam
ple
Dom
ain
LanguageExam
ple
w/ExcessiveDetail
Im
plem
entation
Language
(ProbablyScripty)Super
Technical
Sweet Spot
Identify
different kinds
of scenarios
Exercise
Different Kinds of Scenarios
TautologicalDom
ain
LanguageExam
ple
Dom
ain
LanguageExam
ple
w/ExcessiveDetail
Im
plem
entation
Language
(ProbablyScripty)Super
Technical
Sweet Spot
Questions?
Email: richard.lawrence@agileforall.com
Twitter: @rslawrence
Blog: richardlawrence.info

More Related Content

More from Skills Matter

Russ miles-cloudfoundry-deep-dive
Russ miles-cloudfoundry-deep-diveRuss miles-cloudfoundry-deep-dive
Russ miles-cloudfoundry-deep-dive
Skills Matter
 
I went to_a_communications_workshop_and_they_t
I went to_a_communications_workshop_and_they_tI went to_a_communications_workshop_and_they_t
I went to_a_communications_workshop_and_they_t
Skills Matter
 
Bootstrapping a-devops-matter
Bootstrapping a-devops-matterBootstrapping a-devops-matter
Bootstrapping a-devops-matter
Skills Matter
 
Personal kanban-workshop
Personal kanban-workshopPersonal kanban-workshop
Personal kanban-workshop
Skills Matter
 
Agilex retrospectives
Agilex retrospectivesAgilex retrospectives
Agilex retrospectives
Skills Matter
 

More from Skills Matter (20)

Patterns for slick database applications
Patterns for slick database applicationsPatterns for slick database applications
Patterns for slick database applications
 
Progressive f# tutorials nyc dmitry mozorov & jack pappas on code quotations ...
Progressive f# tutorials nyc dmitry mozorov & jack pappas on code quotations ...Progressive f# tutorials nyc dmitry mozorov & jack pappas on code quotations ...
Progressive f# tutorials nyc dmitry mozorov & jack pappas on code quotations ...
 
Cukeup nyc ian dees on elixir, erlang, and cucumberl
Cukeup nyc ian dees on elixir, erlang, and cucumberlCukeup nyc ian dees on elixir, erlang, and cucumberl
Cukeup nyc ian dees on elixir, erlang, and cucumberl
 
Cukeup nyc peter bell on getting started with cucumber.js
Cukeup nyc peter bell on getting started with cucumber.jsCukeup nyc peter bell on getting started with cucumber.js
Cukeup nyc peter bell on getting started with cucumber.js
 
Agile testing & bdd e xchange nyc 2013 jeffrey davidson & lav pathak & sam ho...
Agile testing & bdd e xchange nyc 2013 jeffrey davidson & lav pathak & sam ho...Agile testing & bdd e xchange nyc 2013 jeffrey davidson & lav pathak & sam ho...
Agile testing & bdd e xchange nyc 2013 jeffrey davidson & lav pathak & sam ho...
 
Progressive f# tutorials nyc rachel reese & phil trelford on try f# from zero...
Progressive f# tutorials nyc rachel reese & phil trelford on try f# from zero...Progressive f# tutorials nyc rachel reese & phil trelford on try f# from zero...
Progressive f# tutorials nyc rachel reese & phil trelford on try f# from zero...
 
Dmitry mozorov on code quotations code as-data for f#
Dmitry mozorov on code quotations code as-data for f#Dmitry mozorov on code quotations code as-data for f#
Dmitry mozorov on code quotations code as-data for f#
 
A poet's guide_to_acceptance_testing
A poet's guide_to_acceptance_testingA poet's guide_to_acceptance_testing
A poet's guide_to_acceptance_testing
 
Russ miles-cloudfoundry-deep-dive
Russ miles-cloudfoundry-deep-diveRuss miles-cloudfoundry-deep-dive
Russ miles-cloudfoundry-deep-dive
 
Serendipity-neo4j
Serendipity-neo4jSerendipity-neo4j
Serendipity-neo4j
 
Simon Peyton Jones: Managing parallelism
Simon Peyton Jones: Managing parallelismSimon Peyton Jones: Managing parallelism
Simon Peyton Jones: Managing parallelism
 
Plug 20110217
Plug   20110217Plug   20110217
Plug 20110217
 
Lug presentation
Lug presentationLug presentation
Lug presentation
 
I went to_a_communications_workshop_and_they_t
I went to_a_communications_workshop_and_they_tI went to_a_communications_workshop_and_they_t
I went to_a_communications_workshop_and_they_t
 
Plug saiku
Plug   saikuPlug   saiku
Plug saiku
 
Huguk lily
Huguk lilyHuguk lily
Huguk lily
 
Bootstrapping a-devops-matter
Bootstrapping a-devops-matterBootstrapping a-devops-matter
Bootstrapping a-devops-matter
 
Personal kanban-workshop
Personal kanban-workshopPersonal kanban-workshop
Personal kanban-workshop
 
Agilex retrospectives
Agilex retrospectivesAgilex retrospectives
Agilex retrospectives
 
Skills matter marcm
Skills matter   marcmSkills matter   marcm
Skills matter marcm
 

Recently uploaded

Recently uploaded (20)

PLAI - Acceleration Program for Generative A.I. Startups
PLAI - Acceleration Program for Generative A.I. StartupsPLAI - Acceleration Program for Generative A.I. Startups
PLAI - Acceleration Program for Generative A.I. Startups
 
The UX of Automation by AJ King, Senior UX Researcher, Ocado
The UX of Automation by AJ King, Senior UX Researcher, OcadoThe UX of Automation by AJ King, Senior UX Researcher, Ocado
The UX of Automation by AJ King, Senior UX Researcher, Ocado
 
FDO for Camera, Sensor and Networking Device – Commercial Solutions from VinC...
FDO for Camera, Sensor and Networking Device – Commercial Solutions from VinC...FDO for Camera, Sensor and Networking Device – Commercial Solutions from VinC...
FDO for Camera, Sensor and Networking Device – Commercial Solutions from VinC...
 
Custom Approval Process: A New Perspective, Pavel Hrbacek & Anindya Halder
Custom Approval Process: A New Perspective, Pavel Hrbacek & Anindya HalderCustom Approval Process: A New Perspective, Pavel Hrbacek & Anindya Halder
Custom Approval Process: A New Perspective, Pavel Hrbacek & Anindya Halder
 
How we scaled to 80K users by doing nothing!.pdf
How we scaled to 80K users by doing nothing!.pdfHow we scaled to 80K users by doing nothing!.pdf
How we scaled to 80K users by doing nothing!.pdf
 
A Business-Centric Approach to Design System Strategy
A Business-Centric Approach to Design System StrategyA Business-Centric Approach to Design System Strategy
A Business-Centric Approach to Design System Strategy
 
Speed Wins: From Kafka to APIs in Minutes
Speed Wins: From Kafka to APIs in MinutesSpeed Wins: From Kafka to APIs in Minutes
Speed Wins: From Kafka to APIs in Minutes
 
IESVE for Early Stage Design and Planning
IESVE for Early Stage Design and PlanningIESVE for Early Stage Design and Planning
IESVE for Early Stage Design and Planning
 
10 Differences between Sales Cloud and CPQ, Blanka Doktorová
10 Differences between Sales Cloud and CPQ, Blanka Doktorová10 Differences between Sales Cloud and CPQ, Blanka Doktorová
10 Differences between Sales Cloud and CPQ, Blanka Doktorová
 
Linux Foundation Edge _ Overview of FDO Software Components _ Randy at Intel.pdf
Linux Foundation Edge _ Overview of FDO Software Components _ Randy at Intel.pdfLinux Foundation Edge _ Overview of FDO Software Components _ Randy at Intel.pdf
Linux Foundation Edge _ Overview of FDO Software Components _ Randy at Intel.pdf
 
Google I/O Extended 2024 Warsaw
Google I/O Extended 2024 WarsawGoogle I/O Extended 2024 Warsaw
Google I/O Extended 2024 Warsaw
 
TEST BANK For, Information Technology Project Management 9th Edition Kathy Sc...
TEST BANK For, Information Technology Project Management 9th Edition Kathy Sc...TEST BANK For, Information Technology Project Management 9th Edition Kathy Sc...
TEST BANK For, Information Technology Project Management 9th Edition Kathy Sc...
 
ECS 2024 Teams Premium - Pretty Secure
ECS 2024   Teams Premium - Pretty SecureECS 2024   Teams Premium - Pretty Secure
ECS 2024 Teams Premium - Pretty Secure
 
AI presentation and introduction - Retrieval Augmented Generation RAG 101
AI presentation and introduction - Retrieval Augmented Generation RAG 101AI presentation and introduction - Retrieval Augmented Generation RAG 101
AI presentation and introduction - Retrieval Augmented Generation RAG 101
 
Integrating Telephony Systems with Salesforce: Insights and Considerations, B...
Integrating Telephony Systems with Salesforce: Insights and Considerations, B...Integrating Telephony Systems with Salesforce: Insights and Considerations, B...
Integrating Telephony Systems with Salesforce: Insights and Considerations, B...
 
How Red Hat Uses FDO in Device Lifecycle _ Costin and Vitaliy at Red Hat.pdf
How Red Hat Uses FDO in Device Lifecycle _ Costin and Vitaliy at Red Hat.pdfHow Red Hat Uses FDO in Device Lifecycle _ Costin and Vitaliy at Red Hat.pdf
How Red Hat Uses FDO in Device Lifecycle _ Costin and Vitaliy at Red Hat.pdf
 
The Value of Certifying Products for FDO _ Paul at FIDO Alliance.pdf
The Value of Certifying Products for FDO _ Paul at FIDO Alliance.pdfThe Value of Certifying Products for FDO _ Paul at FIDO Alliance.pdf
The Value of Certifying Products for FDO _ Paul at FIDO Alliance.pdf
 
Secure Zero Touch enabled Edge compute with Dell NativeEdge via FDO _ Brad at...
Secure Zero Touch enabled Edge compute with Dell NativeEdge via FDO _ Brad at...Secure Zero Touch enabled Edge compute with Dell NativeEdge via FDO _ Brad at...
Secure Zero Touch enabled Edge compute with Dell NativeEdge via FDO _ Brad at...
 
Enterprise Knowledge Graphs - Data Summit 2024
Enterprise Knowledge Graphs - Data Summit 2024Enterprise Knowledge Graphs - Data Summit 2024
Enterprise Knowledge Graphs - Data Summit 2024
 
Optimizing NoSQL Performance Through Observability
Optimizing NoSQL Performance Through ObservabilityOptimizing NoSQL Performance Through Observability
Optimizing NoSQL Performance Through Observability
 

Cukeup nyc richard lawrence on getting the language right

  • 1. Getting the Language Right with Cucumber Richard Lawrence, Agile For All
  • 2.
  • 4. Tautological Scenario: Search for a Book When I search for a book Then I should see the correct results
  • 5. Scenario: Search for a book Given the following Authors: | id | name | | 1 | Charles Dickens | | 2 | John Steinbeck | | 3 | Fyodor Dostoyevsky | And the following Titles: | id | title | author_id | | 1 | A Tale of Two Cities | 1 | | 2 | Crime and Punishment | 3 | | 3 | East of Eden | 2 | And I'm on "http://www.bookstore.biz/" When I fill in "Dickens" in "//input[name()='q']" And I click "#searchButton" Then there should be 1 "div.book div.title" element And the page should contain "A Tale of Two Cities" Super Technical
  • 6. Scenario: Search for a book Given the following catalog: | Title | Author | | A Tale of Two Cities | Charles Dickens | | Crime and Punishment | Fyodor Dostoyevsky | | East of Eden | John Steinbeck | And I'm on the bookstore home page When I fill in "Dickens" in the search field And I click "Search" Then I should see only "A Tale of Two Cities" in the results Scripty, with Implementation Details
  • 7. Scenario: Search for a book Given the following catalog: | Title | Author | | A Tale of Two Cities | Charles Dickens | | Crime and Punishment | Fyodor Dostoyevsky | | East of Eden | John Steinbeck | When I search for "Dickens" Then I should see only "A Tale of Two Cities" in the results Example in Domain Language
  • 8. Example in Domain Language with Excess Detail Scenario: Search for a book Given the following catalog: | Title | Author | Publisher | ISBN | | A Tale of Two Cities | Charles Dickens | Qualitas Classics | 1897093594 | | Crime and Punishment | Fyodor Dostoyevsky | Simon & Brown | 1936041030 | | East of Eden | John Steinbeck | Penguin | 0142000655 | When I search for "Dickens" Then I should see only the following in the results: | Title | Author | Format | Price | | A Tale of Two Cities | Charles Dickens | Paperback | $14.90 |
  • 9. Different Kinds of Scenarios TautologicalDom ain LanguageExam ple Dom ain LanguageExam ple w/ExcessiveDetail Im plem entation Language (ProbablyScripty)Super Technical Sweet Spot
  • 11. Different Kinds of Scenarios TautologicalDom ain LanguageExam ple Dom ain LanguageExam ple w/ExcessiveDetail Im plem entation Language (ProbablyScripty)Super Technical Sweet Spot