SlideShare a Scribd company logo
1 of 23
Download to read offline
BDD Crash Course for Testers
Gaspar Nagy
coach • trainer • bdd addict • creator of specflow
@gasparnagy • gaspar@specsolutions.eu
QA Fest Kiev • 31/10/2015
Copyright © Gaspar Nagy
What is BDD?
Copyright © Gaspar Nagy
BDD?
BDD is a second-generation,
outside-in, pull-based, multiple-
stakeholder, multiple-scale, high-
automation, agile methodology.
It describes a cycle of interactions
with well-defined outputs, resulting
in the delivery of working, tested
software that matters.
Dan North, Agile Testing, Specifications and BDD Exchange 2009
Copyright © Gaspar Nagy
BDD
Behavior Driven
Development
TDD
Test Driven
Development
DDD
Domain Driven Design
ATDD
Acceptance Test
Driven Development
User Stories
Specification
by Example
Definition of
Done
Outside-In
Development
DSL
Domain Specific
Language
Copyright © Gaspar Nagy
FEAR
My Story
Agile
Engineering
(XP, TDD,
pairing)
Agile
Project
Mgmt.
(Scrum, Kanban)
Agile
Requirement
Analysis
(User Story,
Acceptance
Criteria)
Agile
Testing
(bug prevention,
exploratory
testing, context-
driven)
Bug Hunting → Bug Prevention
Copyright © Gaspar Nagy
Requirements vs. Tests
As formality increases, tests and
requirements become indistinguishable.
At the limit, tests and requirements are
equivalent.
Equivalence Hypothesis (Martin, Melnik)
Pic: Martin/Melnik: Requirements and Tests
Copyright © Gaspar Nagy
Specification-By-Example
Example Tests
Specifications
consist of
describe validate fulfillment
Source: Gojko Adzic – Bridging the Communication Gap
My Story
Agile
Engineering
(XP, TDD,
pairing)
Agile
Project
Mgmt.
(Scrum, Kanban)
Agile
Requirement
Analysis
(User Story,
Acceptance
Criteria)
Agile
Testing
(bug prevention,
exploratory
testing, context-
driven)
BDD
Copyright © Gaspar Nagy
BDD
BDD =
Product Ownership +
Collaboration +
Automation
on the product
of requirements
real
Team Foundation Server Version Control
TeamFoundation Server Workitems
SpecLog
Story Maps
Product
Backlog
Sprint
Backlog
Task Board
SpecFlow Scenarios
Test-
auto-
mation
Product
Living
Documen-
tation
Our Process
Source: TechTalk (www.techtalk.at)
Planning a story with acceptance
criteria
“Imagine this story is
already implemented:
How would you verify
it?”
“I would try to put a book
into the shopping cart …”
“I would try to remove a
book from the shopping
cart…”
“I’d check whether the shopping
cart is empty, when I enter the
shop …”
Shopping cart should be
empty when entering the
shop
Source: TechTalk (www.techtalk.at)
Gherkin Scenarios
Scenario: Books can be added to the shopping basket
Given the following books
|Author |Title |
|Martin Fowler |Analysis Patterns |
|Gojko Adzic |Bridging the Communication Gap |
And my shopping basket is empty
When I add the book “Analysis Patterns” to my shopping basket
Then my shopping basket should contain 1 copy of “Analysis Patterns”
Copyright © Gaspar Nagy
DEMO
SpecFlow in
Action
Copyright © Gaspar Nagy
Test automation is hard
Approach and Landing Tests
Source: https://en.Wikipedia.org/wiki/Approach_and_Landing_Tests
An example of using stubs…
Source: https://en.Wikipedia.org/wiki/Approach_and_Landing_Tests
Copyright © Gaspar Nagy
Test-first thinking in designing
complex applications helps a lot for
test automation efficiency
Copyright © Gaspar Nagy
Test-first is hard
• When we exploring new areas/technologies
• When we need to work with legacy systems
• When …
But this should not be an excuse but a source of
inspiration!
Copyright © Gaspar Nagy
Copyright © Gaspar Nagy
SpecFlow
Course
Kiev
9-11 November
Thank you!
See you at on scrummaster.com.ua's booth!
Gaspar Nagy
coach • trainer • bdd addict • creator of specflow
@gasparnagy • gaspar@specsolutions.eu

More Related Content

More from Gáspár Nagy

BDD Scenarios in a Testing & Traceability Strategy (Webinar 19/02/2021)
BDD Scenarios in a Testing & Traceability Strategy (Webinar 19/02/2021)BDD Scenarios in a Testing & Traceability Strategy (Webinar 19/02/2021)
BDD Scenarios in a Testing & Traceability Strategy (Webinar 19/02/2021)
Gáspár Nagy
 

More from Gáspár Nagy (13)

BDD Scenarios in a Testing Strategy
BDD Scenarios in a Testing StrategyBDD Scenarios in a Testing Strategy
BDD Scenarios in a Testing Strategy
 
Ramp up your testing solution, ExpoQA 2023
Ramp up your testing solution, ExpoQA 2023Ramp up your testing solution, ExpoQA 2023
Ramp up your testing solution, ExpoQA 2023
 
BDD Scenarios in a Testing & Traceability Strategy (Webinar 19/02/2021)
BDD Scenarios in a Testing & Traceability Strategy (Webinar 19/02/2021)BDD Scenarios in a Testing & Traceability Strategy (Webinar 19/02/2021)
BDD Scenarios in a Testing & Traceability Strategy (Webinar 19/02/2021)
 
Fighting against technical debt (CukenFest 2020)
Fighting against technical debt (CukenFest 2020)Fighting against technical debt (CukenFest 2020)
Fighting against technical debt (CukenFest 2020)
 
Süllyedünk! Ütközés a tesztelési jégheggyel (Teszt & Tea Meeup Budapest, 2018...
Süllyedünk! Ütközés a tesztelési jégheggyel (Teszt & Tea Meeup Budapest, 2018...Süllyedünk! Ütközés a tesztelési jégheggyel (Teszt & Tea Meeup Budapest, 2018...
Süllyedünk! Ütközés a tesztelési jégheggyel (Teszt & Tea Meeup Budapest, 2018...
 
Continuous Behavior - BDD in Continuous Delivery (CoDers Who Test, Gothenburg...
Continuous Behavior - BDD in Continuous Delivery (CoDers Who Test, Gothenburg...Continuous Behavior - BDD in Continuous Delivery (CoDers Who Test, Gothenburg...
Continuous Behavior - BDD in Continuous Delivery (CoDers Who Test, Gothenburg...
 
We are sinking: Hitting the testing iceberg (CukenFest London, 2018)
We are sinking: Hitting the testing iceberg (CukenFest London, 2018)We are sinking: Hitting the testing iceberg (CukenFest London, 2018)
We are sinking: Hitting the testing iceberg (CukenFest London, 2018)
 
Behavior Driven UI Automation (Agile Testing Days 2017, Potsdam)
Behavior Driven UI Automation (Agile Testing Days 2017, Potsdam)Behavior Driven UI Automation (Agile Testing Days 2017, Potsdam)
Behavior Driven UI Automation (Agile Testing Days 2017, Potsdam)
 
Testing is Difficult (Agile in the City Bristol 2017, Lightening talk)
Testing is Difficult (Agile in the City Bristol 2017, Lightening talk)Testing is Difficult (Agile in the City Bristol 2017, Lightening talk)
Testing is Difficult (Agile in the City Bristol 2017, Lightening talk)
 
Scaffolding a legacy app with BDD scenario (Agile in the City Bristol 2017)
Scaffolding a legacy app with BDD scenario (Agile in the City Bristol 2017)Scaffolding a legacy app with BDD scenario (Agile in the City Bristol 2017)
Scaffolding a legacy app with BDD scenario (Agile in the City Bristol 2017)
 
Behavior Driven Web UI Automation with Selenium and Cucumber/SpecFlow (Qualit...
Behavior Driven Web UI Automation with Selenium and Cucumber/SpecFlow (Qualit...Behavior Driven Web UI Automation with Selenium and Cucumber/SpecFlow (Qualit...
Behavior Driven Web UI Automation with Selenium and Cucumber/SpecFlow (Qualit...
 
A tesztelés szerepe folyamatos kihelyezést használó projektekben (Microsoft, ...
A tesztelés szerepe folyamatos kihelyezést használó projektekben (Microsoft, ...A tesztelés szerepe folyamatos kihelyezést használó projektekben (Microsoft, ...
A tesztelés szerepe folyamatos kihelyezést használó projektekben (Microsoft, ...
 
Scaffolding a legacy app with BDD scenarios using SpecFlow/Cucumber (BDD Lond...
Scaffolding a legacy app with BDD scenarios using SpecFlow/Cucumber (BDD Lond...Scaffolding a legacy app with BDD scenarios using SpecFlow/Cucumber (BDD Lond...
Scaffolding a legacy app with BDD scenarios using SpecFlow/Cucumber (BDD Lond...
 

Recently uploaded

Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers:  A Deep Dive into Serverless Spatial Data and FMECloud Frontiers:  A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FME
Safe Software
 

Recently uploaded (20)

MINDCTI Revenue Release Quarter One 2024
MINDCTI Revenue Release Quarter One 2024MINDCTI Revenue Release Quarter One 2024
MINDCTI Revenue Release Quarter One 2024
 
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemke
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemkeProductAnonymous-April2024-WinProductDiscovery-MelissaKlemke
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemke
 
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
 
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...
 
Connector Corner: Accelerate revenue generation using UiPath API-centric busi...
Connector Corner: Accelerate revenue generation using UiPath API-centric busi...Connector Corner: Accelerate revenue generation using UiPath API-centric busi...
Connector Corner: Accelerate revenue generation using UiPath API-centric busi...
 
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...
 
A Domino Admins Adventures (Engage 2024)
A Domino Admins Adventures (Engage 2024)A Domino Admins Adventures (Engage 2024)
A Domino Admins Adventures (Engage 2024)
 
TrustArc Webinar - Unlock the Power of AI-Driven Data Discovery
TrustArc Webinar - Unlock the Power of AI-Driven Data DiscoveryTrustArc Webinar - Unlock the Power of AI-Driven Data Discovery
TrustArc Webinar - Unlock the Power of AI-Driven Data Discovery
 
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
 
GenAI Risks & Security Meetup 01052024.pdf
GenAI Risks & Security Meetup 01052024.pdfGenAI Risks & Security Meetup 01052024.pdf
GenAI Risks & Security Meetup 01052024.pdf
 
Apidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, Adobe
Apidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, AdobeApidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, Adobe
Apidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, Adobe
 
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
 
Repurposing LNG terminals for Hydrogen Ammonia: Feasibility and Cost Saving
Repurposing LNG terminals for Hydrogen Ammonia: Feasibility and Cost SavingRepurposing LNG terminals for Hydrogen Ammonia: Feasibility and Cost Saving
Repurposing LNG terminals for Hydrogen Ammonia: Feasibility and Cost Saving
 
Artificial Intelligence Chap.5 : Uncertainty
Artificial Intelligence Chap.5 : UncertaintyArtificial Intelligence Chap.5 : Uncertainty
Artificial Intelligence Chap.5 : Uncertainty
 
Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers:  A Deep Dive into Serverless Spatial Data and FMECloud Frontiers:  A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FME
 
Top 5 Benefits OF Using Muvi Live Paywall For Live Streams
Top 5 Benefits OF Using Muvi Live Paywall For Live StreamsTop 5 Benefits OF Using Muvi Live Paywall For Live Streams
Top 5 Benefits OF Using Muvi Live Paywall For Live Streams
 
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...
 
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
 
Boost Fertility New Invention Ups Success Rates.pdf
Boost Fertility New Invention Ups Success Rates.pdfBoost Fertility New Invention Ups Success Rates.pdf
Boost Fertility New Invention Ups Success Rates.pdf
 
Axa Assurance Maroc - Insurer Innovation Award 2024
Axa Assurance Maroc - Insurer Innovation Award 2024Axa Assurance Maroc - Insurer Innovation Award 2024
Axa Assurance Maroc - Insurer Innovation Award 2024
 

BDD Crash Course for Testers (QA Fest Kiev, 31/10/2015)

  • 1. BDD Crash Course for Testers Gaspar Nagy coach • trainer • bdd addict • creator of specflow @gasparnagy • gaspar@specsolutions.eu QA Fest Kiev • 31/10/2015
  • 2. Copyright © Gaspar Nagy What is BDD?
  • 3. Copyright © Gaspar Nagy BDD? BDD is a second-generation, outside-in, pull-based, multiple- stakeholder, multiple-scale, high- automation, agile methodology. It describes a cycle of interactions with well-defined outputs, resulting in the delivery of working, tested software that matters. Dan North, Agile Testing, Specifications and BDD Exchange 2009
  • 4. Copyright © Gaspar Nagy BDD Behavior Driven Development TDD Test Driven Development DDD Domain Driven Design ATDD Acceptance Test Driven Development User Stories Specification by Example Definition of Done Outside-In Development DSL Domain Specific Language
  • 6. My Story Agile Engineering (XP, TDD, pairing) Agile Project Mgmt. (Scrum, Kanban) Agile Requirement Analysis (User Story, Acceptance Criteria) Agile Testing (bug prevention, exploratory testing, context- driven)
  • 7. Bug Hunting → Bug Prevention
  • 8. Copyright © Gaspar Nagy Requirements vs. Tests As formality increases, tests and requirements become indistinguishable. At the limit, tests and requirements are equivalent. Equivalence Hypothesis (Martin, Melnik) Pic: Martin/Melnik: Requirements and Tests
  • 9. Copyright © Gaspar Nagy Specification-By-Example Example Tests Specifications consist of describe validate fulfillment Source: Gojko Adzic – Bridging the Communication Gap
  • 10. My Story Agile Engineering (XP, TDD, pairing) Agile Project Mgmt. (Scrum, Kanban) Agile Requirement Analysis (User Story, Acceptance Criteria) Agile Testing (bug prevention, exploratory testing, context- driven) BDD
  • 11. Copyright © Gaspar Nagy BDD BDD = Product Ownership + Collaboration + Automation on the product of requirements real
  • 12. Team Foundation Server Version Control TeamFoundation Server Workitems SpecLog Story Maps Product Backlog Sprint Backlog Task Board SpecFlow Scenarios Test- auto- mation Product Living Documen- tation Our Process Source: TechTalk (www.techtalk.at)
  • 13. Planning a story with acceptance criteria “Imagine this story is already implemented: How would you verify it?” “I would try to put a book into the shopping cart …” “I would try to remove a book from the shopping cart…” “I’d check whether the shopping cart is empty, when I enter the shop …” Shopping cart should be empty when entering the shop Source: TechTalk (www.techtalk.at)
  • 14. Gherkin Scenarios Scenario: Books can be added to the shopping basket Given the following books |Author |Title | |Martin Fowler |Analysis Patterns | |Gojko Adzic |Bridging the Communication Gap | And my shopping basket is empty When I add the book “Analysis Patterns” to my shopping basket Then my shopping basket should contain 1 copy of “Analysis Patterns”
  • 15. Copyright © Gaspar Nagy DEMO SpecFlow in Action
  • 16. Copyright © Gaspar Nagy Test automation is hard
  • 17. Approach and Landing Tests Source: https://en.Wikipedia.org/wiki/Approach_and_Landing_Tests
  • 18. An example of using stubs… Source: https://en.Wikipedia.org/wiki/Approach_and_Landing_Tests
  • 19. Copyright © Gaspar Nagy Test-first thinking in designing complex applications helps a lot for test automation efficiency
  • 20. Copyright © Gaspar Nagy Test-first is hard • When we exploring new areas/technologies • When we need to work with legacy systems • When … But this should not be an excuse but a source of inspiration!
  • 22. Copyright © Gaspar Nagy SpecFlow Course Kiev 9-11 November
  • 23. Thank you! See you at on scrummaster.com.ua's booth! Gaspar Nagy coach • trainer • bdd addict • creator of specflow @gasparnagy • gaspar@specsolutions.eu

Editor's Notes

  1. Start Time: 5min Expectation: People have heard of BDD Goal: Summary for common understanding 2001: Dan North invented the term (test -> “should”) -> JBehave (Java) -> RSpec (Ruby) -> Cucumber (Ruby) second generation: not original, evolved from lots of other stuff
  2. Dan North: BDD is a second generation agile methodology. The most important ones probably: Specification by Example, ATDD, TDD, DDD DDD (here): focus on problem domain, not technology We have another talk about explaining all the relations, but that is not the goal of this talk. … Just one Concept we want to highlight: Specfication by Example
  3. Paper published for IEEE, Robert C. Marting and Grigori Melnik Möbius strip Traditionally this is not recognized because RE and Testing are set up as different disciplines But they are about the same: how the system is used Wouldn’t it make sense to leverage some synergies?
  4. 1977, space shuttle (first real trip 1981) Landing: most critical; launch: most expensive Boeing 747 Shuttle Carrier Aircraft (SCA) 1977-ben az Űrsikló program előkészületei folytak (az első valódi űrutazás 1981-ben történt). Az űrutazás egyik legkritikusabb pontja a leszállás a felszállás viszont az egyik legköltségesebb. Tekintve, hogy a fel és leszállások száma – jó esetben kiegyenlíti egymást, szükség volt egy olyan megoldásra, amivel a leszállás tesztelhető a felszállás költségei nélkül. Ehhez végül egy jelentősen átalakított Boeing 747-est (kettőt) használtak, amely képes volt a tetejére erősített űrsiklót a levegőbe emelni.
  5. Boings were used to carry space shuttles to road shows later Nincsenek adatok, ennek költségeiről, de bizonyára sok pénzbe került. (A csatlakozási pontot vicces felirattal látták el, amiben jelölik, hogy az ürrepülőt „fekete felével lefelé” kell rögzíteni. Tesztautomatizálás közben is hasonló problémákba ütközhetünk. Tesztelni kell egy folyamatot, de a tesztelhetőség miatt komoly infrastruktúrát kell felépíteni, aminek az egyedüli szerepe a tesztelhetőség lehetővé tétele vagy hatékonyságának növelése. Ezeket mi stub-oknak hívjuk. Az átalakított boingeket később arra is használták, hogy az űrrepülőket múzeumokba vagy légiparádékra szállítsák – talán a mi stubjaink is jók lesznek valamire még?
  6. Boings were used to carry space shuttles to road shows later Nincsenek adatok, ennek költségeiről, de bizonyára sok pénzbe került. (A csatlakozási pontot vicces felirattal látták el, amiben jelölik, hogy az ürrepülőt „fekete felével lefelé” kell rögzíteni. Tesztautomatizálás közben is hasonló problémákba ütközhetünk. Tesztelni kell egy folyamatot, de a tesztelhetőség miatt komoly infrastruktúrát kell felépíteni, aminek az egyedüli szerepe a tesztelhetőség lehetővé tétele vagy hatékonyságának növelése. Ezeket mi stub-oknak hívjuk. Az átalakított boingeket később arra is használták, hogy az űrrepülőket múzeumokba vagy légiparádékra szállítsák – talán a mi stubjaink is jók lesznek valamire még?