SlideShare uma empresa Scribd logo
1 de 58
Baixar para ler offline
@sebrose h)p://smartbear.com
Seb Rose
SmartBear
seb.rose@smartbear.com
10 things you need to know about
BDD, Cucumber and SpecFlow
@sebrose h)p://smartbear.com
1. BDD is part of a family
@sebrose h)p://smartbear.comh)p://lizkeogh.com/2011/06/27/atdd-vs-bdd-and-a-po)ed-history-of-some-related-stuff/
@sebrose h)p://smartbear.comh)p://lizkeogh.com/2011/06/27/atdd-vs-bdd-and-a-po)ed-history-of-some-related-stuff/
What’s the
difference
between TDD,
ATDD, BDD
and SbE?
@sebrose h)p://smartbear.comh)p://lizkeogh.com/2011/06/27/atdd-vs-bdd-and-a-po)ed-history-of-some-related-stuff/
What’s the
difference
between TDD,
ATDD, BDD
and SbE?
They’re
called
different
things
@sebrose h)p://smartbear.com
2. CollaboraAon IS essenAal
https://cucumber.io/docs/bdd/
@sebrose h)p://smartbear.com
Ideas
User Stories
Discovery
using
Examples
Automated Tests
Code
@sebrose h)p://smartbear.com
Example mapping
http://www.les-traducteurs-agiles.org/2017/03/21/presentation-cartographie-des-exemples.html
https://www.youtube.com/watch?v=VwvrGfWmG_U
@sebrose h)p://smartbear.com
h)ps://cemarking.net/wp-content/uploads/2014/01/User-Manual_featured.jpg
3. Prefer living documentaAon
@sebrose h)p://cucumber.io
Feature: Team Scoring
Teams start with zero score.
Correct answer gets points depending on 

how difficult it is.
Scenario: Score starts at 0
Given I register a team
Then my score is 0
Scenario: Correct easy answer scores 10
Given I register a team
And I start playing a game
When I submit a correct easy answer
Then my score is 10
@sebrose h)p://cucumber.io
Feature: Team Scoring
Teams start with zero score.
Correct answer gets points depending on 

how difficult it is.
Scenario: Score starts at 0
Given I register a team
Then my score is 0
Scenario: Correct easy answer scores 10
Given I register a team
And I start playing a game
When I submit a correct easy answer
Then my score is 10
Given I register a team
Then my score is 0
@sebrose h)p://cucumber.io
Feature: Team Scoring
Teams start with zero score.
Correct answer gets points depending on 

how difficult it is.
Scenario: Score starts at 0
Given I register a team
Then my score is 0
Scenario: Correct easy answer scores 10
Given I register a team
And I start playing a game
When I submit a correct easy answer
Then my score is 10
Given I register a team
Then my score is 0
Given I register a team
And I start playing a game
When I submit a correct easy answer
Then my score is 10
@sebrose h)p://cucumber.io
@sebrose h)p://cucumber.io
Other forms of documentaAon are also
necessary!
@sebrose h)p://smartbear.com
4. Keep your scenarios BRIEF
https://cucumber.io/blog/keep-your-scenarios-brief/
B
R
I
E
F
@sebrose h)p://smartbear.com
4. Keep your scenarios BRIEF
https://cucumber.io/blog/keep-your-scenarios-brief/
Business readableB
R
I
E
F
@sebrose h)p://smartbear.com
4. Keep your scenarios BRIEF
https://cucumber.io/blog/keep-your-scenarios-brief/
Business readable
Real data
B
R
I
E
F
@sebrose h)p://smartbear.com
4. Keep your scenarios BRIEF
https://cucumber.io/blog/keep-your-scenarios-brief/
Business readable
Real data
Intention revealing
B
R
I
E
F
@sebrose h)p://smartbear.com
4. Keep your scenarios BRIEF
https://cucumber.io/blog/keep-your-scenarios-brief/
Business readable
Real data
Intention revealing
Essential
B
R
I
E
F
@sebrose h)p://smartbear.com
4. Keep your scenarios BRIEF
https://cucumber.io/blog/keep-your-scenarios-brief/
Business readable
Real data
Intention revealing
Essential
Focused
B
R
I
E
F
@sebrose h)p://smartbear.com
5. Tools are NOT essenAal
@sebrose h)p://cucumber.io
h)ps://cucumber.pro/blog/2014/03/03/the-worlds-most-misunderstood-collaboraVon-tool.html
When you do BDD … regression tests fall out at the
other end.
They are a by-product of those acVviVes.
TesVng isn't the acVvity itself.
Aslak Hellesøy
@sebrose h)p://smartbear.com
6. Cucumber is simple
@sebrose h)p://cucumber.io
Core concepts
@sebrose h)p://cucumber.io
Features
Core concepts
@sebrose h)p://cucumber.io
Features
-Scenarios
Core concepts
@sebrose h)p://cucumber.io
Features
-Scenarios
-Steps
Core concepts
@sebrose h)p://cucumber.io
Features
-Scenarios
-Steps
-Gherkin
Core concepts
@sebrose h)p://cucumber.io
Features
-Scenarios
-Steps
-Gherkin
Glue code
Core concepts
@sebrose h)p://cucumber.io
Features
-Scenarios
-Steps
-Gherkin
Glue code
-Step definiVons
Core concepts
@sebrose h)p://cucumber.io
Features
-Scenarios
-Steps
-Gherkin
Glue code
-Step definiVons
-Java / C#
Core concepts
@sebrose h)p://cucumber.io
Features
-Scenarios
-Steps
-Gherkin
Glue code
-Step definiVons
-Java / C#
Core concepts
@sebrose h)p://cucumber.io
Features
-Scenarios
-Steps
-Gherkin
Glue code
-Step definiVons
-Java / C#
ApplicaVon
Core concepts
@sebrose h)p://cucumber.io
Features
-Scenarios
-Steps
-Gherkin
Glue code
-Step definiVons
-Java / C#
ApplicaVon
Core concepts
@sebrose h)p://cucumber.io
Features
-Scenarios
-Steps
-Gherkin
Glue code
-Step definiVons
-Java / C#
ApplicaVon
Each scenario is an example
Core concepts
@sebrose h)p://cucumber.io
Feature: Team Scoring
Teams start with zero score.
Correct answer gets points depending on 

how difficult it is.
Scenario: Score starts at 0
Given I register a team
Then my score is 0
Scenario: Correct easy answer scores 10
Given I register a team
And I start playing a game
When I submit a correct easy answer
Then my score is 10
@sebrose h)p://smartbear.com
7. Cucumber and Specflow aren’t exactly the
same
@sebrose h)p://cucumber.io
Given/When/Then namespaces
Global namespace
- Given/When/Then interchangeable
Separate namespaces
- Given/When/Then distinct
- And/But bind to preceding namespace
- [StepDefinition] for compatibility
@sebrose h)p://smartbear.com
8. Don’t forget the testers
@sebrose h)p://smartbear.com
8. Don’t forget the testers
@sebrose h)p://smartbear.comh)p://www.slideshare.net/ehendrickson/the-thinking-tester-evolved
@sebrose h)p://smartbear.com
@sebrose h)p://smartbear.com
http://1.bp.blogspot.com/_YzKCMr-tcMM/TFLIGeqTJfI/AAAAAAAAARQ/AhNW62KX5EA/s1600/cartoon6.jpg
9. BDD is not just for testers
@sebrose h)p://smartbear.com
Features
-Scenarios
-Steps
-Gherkin
Glue code
-Step definiVons
-Java / C#
ApplicaVon
@sebrose h)p://smartbear.com
Features
-Scenarios
-Steps
-Gherkin
Glue code
-Step definiVons
-Java / C#
ApplicaVon
Support
Code
@sebrose h)p://smartbear.com
Ubiquitous
Language
@sebrose h)p://smartbear.com
10. Deliberate pracAce
@sebrose h)p://smartbear.com
102 things you should know
@sebrose h)p://smartbear.com
01 BDD demands collaboraVon
102 things you should know
@sebrose h)p://smartbear.com
01 BDD demands collaboraVon
10 AutomaVon is not mandatory
102 things you should know
@sebrose h)p://smartbear.com
Seb Rose
Twi)er: @sebrose
Blog: cucumber.io/blog
claysnow.co.uk
E-mail: seb.rose@smartbear.com
bddbooks.com
Acceptance
criteria
User Story
Examples
Feature: Team Scoring
Teams start with zero score.
Correct answer gets points depending on 

how difficult it is.
Scenario: Score starts at 0
Given I register a team
Then my score is 0
Scenario: Correct easy answer scores 10
Given I register a team
When I submit a correct easy answer
Then my score is 10
Scenario: Correct hard answer scores 50
Given I register a team
When I submit a correct hard answer
Then my score is 50
Acceptance
criteria
User Story
Examples
Feature: Team Scoring
Teams start with zero score.
Correct answer gets points depending on 

how difficult it is.
Scenario: Score starts at 0
Given I register a team
Then my score is 0
Scenario: Correct easy answer scores 10
Given I register a team
When I submit a correct easy answer
Then my score is 10
Scenario: Correct hard answer scores 50
Given I register a team
When I submit a correct hard answer
Then my score is 50
Acceptance
criteria
User Story
Feature: Team Scoring
Teams start with zero score.
Correct answer gets points depending on 

how difficult it is.
Scenario: Score starts at 0
Given I register a team
Then my score is 0
Scenario: Correct easy answer scores 10
Given I register a team
When I submit a correct easy answer
Then my score is 10
Scenario: Correct hard answer scores 50
Given I register a team
When I submit a correct hard answer
Then my score is 50
Acceptance
criteria
User Story
Feature: Team Scoring
Teams start with zero score.
Correct answer gets points depending on 

how difficult it is.
Scenario: Score starts at 0
Given I register a team
Then my score is 0
Scenario: Correct easy answer scores 10
Given I register a team
When I submit a correct easy answer
Then my score is 10
Scenario: Correct hard answer scores 50
Given I register a team
When I submit a correct hard answer
Then my score is 50
User Story
Feature: Team Scoring
Teams start with zero score.
Correct answer gets points depending on 

how difficult it is.
Scenario: Score starts at 0
Given I register a team
Then my score is 0
Scenario: Correct easy answer scores 10
Given I register a team
When I submit a correct easy answer
Then my score is 10
Scenario: Correct hard answer scores 50
Given I register a team
When I submit a correct hard answer
Then my score is 50
User Story
Feature: Team Scoring
Teams start with zero score.
Correct answer gets points depending on 

how difficult it is.
Scenario: Score starts at 0
Given I register a team
Then my score is 0
Scenario: Correct easy answer scores 10
Given I register a team
When I submit a correct easy answer
Then my score is 10
Scenario: Correct hard answer scores 50
Given I register a team
When I submit a correct hard answer
Then my score is 50
Feature: Team Scoring
Teams start with zero score.
Correct answer gets points depending on 

how difficult it is.
Scenario: Score starts at 0
Given I register a team
Then my score is 0
Scenario: Correct easy answer scores 10
Given I register a team
When I submit a correct easy answer
Then my score is 10
Scenario: Correct hard answer scores 50
Given I register a team
When I submit a correct hard answer
Then my score is 50

Mais conteúdo relacionado

Mais de Seb Rose

Software contracts or: how I learned to stop worrying and love releasing. Agi...
Software contracts or: how I learned to stop worrying and love releasing. Agi...Software contracts or: how I learned to stop worrying and love releasing. Agi...
Software contracts or: how I learned to stop worrying and love releasing. Agi...
Seb Rose
 

Mais de Seb Rose (20)

Example mapping (with builds) - ProductWorld 2022
Example mapping (with builds)  - ProductWorld 2022Example mapping (with builds)  - ProductWorld 2022
Example mapping (with builds) - ProductWorld 2022
 
Example mapping - ProductWorld 2022
Example mapping - ProductWorld 2022Example mapping - ProductWorld 2022
Example mapping - ProductWorld 2022
 
No code, low code, machine code QA ATL 2021
No code, low code, machine code   QA ATL 2021No code, low code, machine code   QA ATL 2021
No code, low code, machine code QA ATL 2021
 
No code, low code, machine code QA ATL 2021
No code, low code, machine code   QA ATL 2021No code, low code, machine code   QA ATL 2021
No code, low code, machine code QA ATL 2021
 
No code, low code, machine code - Unicom 2021
No code, low code, machine code -  Unicom 2021No code, low code, machine code -  Unicom 2021
No code, low code, machine code - Unicom 2021
 
BDD: from soup to nuts - The Future of Work Scotland 2021
BDD: from soup to nuts  - The Future of Work Scotland 2021BDD: from soup to nuts  - The Future of Work Scotland 2021
BDD: from soup to nuts - The Future of Work Scotland 2021
 
Contrasting test automation and BDD - 2020
Contrasting test automation and BDD - 2020Contrasting test automation and BDD - 2020
Contrasting test automation and BDD - 2020
 
Are BDD and test automation the same thing? Automation Guild 2021
Are BDD and test automation the same thing?   Automation Guild 2021Are BDD and test automation the same thing?   Automation Guild 2021
Are BDD and test automation the same thing? Automation Guild 2021
 
"Our BDDs are broken!" Lean Agile Exchange 2020
"Our BDDs are broken!"   Lean Agile Exchange 2020"Our BDDs are broken!"   Lean Agile Exchange 2020
"Our BDDs are broken!" Lean Agile Exchange 2020
 
User stories: from good intentions to bad advice - Agile Scotland 2019
User stories: from good intentions to bad advice - Agile Scotland 2019User stories: from good intentions to bad advice - Agile Scotland 2019
User stories: from good intentions to bad advice - Agile Scotland 2019
 
User stories: from good intentions to bad advice - Lean Agile Scotland 2019
User stories: from good intentions to bad advice - Lean Agile Scotland 2019User stories: from good intentions to bad advice - Lean Agile Scotland 2019
User stories: from good intentions to bad advice - Lean Agile Scotland 2019
 
Software contracts or: how I learned to stop worrying and love releasing. Agi...
Software contracts or: how I learned to stop worrying and love releasing. Agi...Software contracts or: how I learned to stop worrying and love releasing. Agi...
Software contracts or: how I learned to stop worrying and love releasing. Agi...
 
What is a user story anyway - lightning talk 2018
What is a user story anyway - lightning talk 2018What is a user story anyway - lightning talk 2018
What is a user story anyway - lightning talk 2018
 
Contract testing and Pact
Contract testing and PactContract testing and Pact
Contract testing and Pact
 
How long is a piece of string?
How long is a piece of string?How long is a piece of string?
How long is a piece of string?
 
Introduction to BDD - SQUID 2018
Introduction to BDD - SQUID 2018Introduction to BDD - SQUID 2018
Introduction to BDD - SQUID 2018
 
Introduction to BDD - shortened
Introduction to BDD - shortenedIntroduction to BDD - shortened
Introduction to BDD - shortened
 
Using BDD as a communication tool between the business and technology
Using BDD as a communication tool between the business and technologyUsing BDD as a communication tool between the business and technology
Using BDD as a communication tool between the business and technology
 
Introduction to bdd
Introduction to bddIntroduction to bdd
Introduction to bdd
 
Planning poker in a nutshell
Planning poker in a nutshellPlanning poker in a nutshell
Planning poker in a nutshell
 

Último

CNv6 Instructor Chapter 6 Quality of Service
CNv6 Instructor Chapter 6 Quality of ServiceCNv6 Instructor Chapter 6 Quality of Service
CNv6 Instructor Chapter 6 Quality of Service
giselly40
 

Último (20)

Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024
Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024
Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024
 
🐬 The future of MySQL is Postgres 🐘
🐬  The future of MySQL is Postgres   🐘🐬  The future of MySQL is Postgres   🐘
🐬 The future of MySQL is Postgres 🐘
 
2024: Domino Containers - The Next Step. News from the Domino Container commu...
2024: Domino Containers - The Next Step. News from the Domino Container commu...2024: Domino Containers - The Next Step. News from the Domino Container commu...
2024: Domino Containers - The Next Step. News from the Domino Container commu...
 
How to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected WorkerHow to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected Worker
 
Powerful Google developer tools for immediate impact! (2023-24 C)
Powerful Google developer tools for immediate impact! (2023-24 C)Powerful Google developer tools for immediate impact! (2023-24 C)
Powerful Google developer tools for immediate impact! (2023-24 C)
 
08448380779 Call Girls In Greater Kailash - I Women Seeking Men
08448380779 Call Girls In Greater Kailash - I Women Seeking Men08448380779 Call Girls In Greater Kailash - I Women Seeking Men
08448380779 Call Girls In Greater Kailash - I Women Seeking Men
 
Tech Trends Report 2024 Future Today Institute.pdf
Tech Trends Report 2024 Future Today Institute.pdfTech Trends Report 2024 Future Today Institute.pdf
Tech Trends Report 2024 Future Today Institute.pdf
 
Exploring the Future Potential of AI-Enabled Smartphone Processors
Exploring the Future Potential of AI-Enabled Smartphone ProcessorsExploring the Future Potential of AI-Enabled Smartphone Processors
Exploring the Future Potential of AI-Enabled Smartphone Processors
 
Scaling API-first – The story of a global engineering organization
Scaling API-first – The story of a global engineering organizationScaling API-first – The story of a global engineering organization
Scaling API-first – The story of a global engineering organization
 
A Domino Admins Adventures (Engage 2024)
A Domino Admins Adventures (Engage 2024)A Domino Admins Adventures (Engage 2024)
A Domino Admins Adventures (Engage 2024)
 
Workshop - Best of Both Worlds_ Combine KG and Vector search for enhanced R...
Workshop - Best of Both Worlds_ Combine  KG and Vector search for  enhanced R...Workshop - Best of Both Worlds_ Combine  KG and Vector search for  enhanced R...
Workshop - Best of Both Worlds_ Combine KG and Vector search for enhanced R...
 
Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...
Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...
Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...
 
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
 
CNv6 Instructor Chapter 6 Quality of Service
CNv6 Instructor Chapter 6 Quality of ServiceCNv6 Instructor Chapter 6 Quality of Service
CNv6 Instructor Chapter 6 Quality of Service
 
From Event to Action: Accelerate Your Decision Making with Real-Time Automation
From Event to Action: Accelerate Your Decision Making with Real-Time AutomationFrom Event to Action: Accelerate Your Decision Making with Real-Time Automation
From Event to Action: Accelerate Your Decision Making with Real-Time Automation
 
How to convert PDF to text with Nanonets
How to convert PDF to text with NanonetsHow to convert PDF to text with Nanonets
How to convert PDF to text with Nanonets
 
Partners Life - Insurer Innovation Award 2024
Partners Life - Insurer Innovation Award 2024Partners Life - Insurer Innovation Award 2024
Partners Life - Insurer Innovation Award 2024
 
Finology Group – Insurtech Innovation Award 2024
Finology Group – Insurtech Innovation Award 2024Finology Group – Insurtech Innovation Award 2024
Finology Group – Insurtech Innovation Award 2024
 
08448380779 Call Girls In Friends Colony Women Seeking Men
08448380779 Call Girls In Friends Colony Women Seeking Men08448380779 Call Girls In Friends Colony Women Seeking Men
08448380779 Call Girls In Friends Colony Women Seeking Men
 
The 7 Things I Know About Cyber Security After 25 Years | April 2024
The 7 Things I Know About Cyber Security After 25 Years | April 2024The 7 Things I Know About Cyber Security After 25 Years | April 2024
The 7 Things I Know About Cyber Security After 25 Years | April 2024
 

10 things about bdd, cucumber and spec flow BDD Paris 2019