SlideShare a Scribd company logo
1 of 58
Hello BDD!
Hello BDD!
ANTONIO ROBRES TURON
Given a speaker with name Toni
When he is giving his conference
Then you should not fall asleep
BDD
EDD
ATDD
DDD
SPECIFICATION BY
EXAMPLE
AGILE ACCEPTANCE
TEST
EXECUTABLE
SPECIFICATIONS
STORY TELLING
Index
• Why born BDD?
• What is BDD?
• How use BDD?
• Benefits
• Demo
BDD HISTORY
First approach
TDD  Test Drive Development
0 Is not a tool!!!! It’s a design methodology
0 Focused in unit testing
0 Life cycle
0 Red
0 Green
0 Refactor
0 Something is missing:
0 THINK!
0 Think  Red  Green  Refactor
TDD is fine but…
• Is programmer focused
• Only take care about the source code
• Helps to write code right but not right code
• Not support communication
0 Inside team (including QA, BA, Data analyst…)
0 With stakeholders
• Is bottom – up process
BDD History
BDD was developed by Dan North as a
response to the issues encountered
teaching TDD
0 Where to start in the process
0 What to test and what not to test
0 How much to test in one go
0 What to call the tests
0 How to understand why a test fails
0 Give you reliability your tests?
BDD History
• The first proposes was that the unit testing
names be whole sentences starting with the
word SHOULD and written in order of
business value.
0Every class should do something
• ClientDetailsValidatorTest
0ShouldFailForMissingSurname
0ShouldFailForMissingAge
What is BDD?
Definition
• 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.
• Using examples to create a shared
understanding and surface uncertainly to
deliver software that matters.
How use BDD?
Story
• What’s an story?
It has to be a description of a requirement and its
business benefit, and a set of criteria by which we all
agree that it is “done” (Dann North)
• Written in business language
Story
• Structure:
0 Title (one line describing the story)
0 Narrative:
0 As a [role]
0 I want [feature]
0 So that [benefit]
Story
Example:
0 As a user
0 I want to publish a tweet
0 So that share information with my followers
Story
Another template:
0 Title (one line describing the story)
0 Narrative
0 In order to [benefit]
0 As a [role]
0 I want to [feature]
Story
Example:
0 In order to share information with my followers
0 As a user
0 I want to publish a tweet
Scenario
• It’s the acceptance criteria
• It’s a description of each specific case
of the narrative
• Can be used to help discover the scope
of the story or the feature
• The scenario should be described in
terms of Givens, Events and Outcomes
Scenario
Structure:
0 Title (one line describing the scenario)
0 Narrative
0 Given [context]
0 And [some more context]...
0 When [event]
0 Then [outcome]
0 And [another outcome]...
Scenario
Example:
Given a twitter account activated
When I send a tweet with 139 characters
Then the tweet is published
And all my followers can read the tweet
How to build scenarios?
Only 4 keywords have the empowerment
to build scenarios
0 but something is missing…
What is the most powerful tool to build
the scenarios?
Having conversations
User Story & Scenario Example
Title: Customer withdraws cash
As a customer,
I want to withdraw cash from an ATM,
so that I don’t have to wait in line at the bank.
Scenario 1: Account is in credit
Given the account is in credit
And the card is valid
And the dispenser contains cash
When the customer requests cash
Then ensure the account is debited
And ensure cash is dispensed
And ensure the card is returned
User Story & Scenario Example
Scenario 2: Account has insufficient funds
Given the account is overdrawn
And the card is valid
When the customer requests cash
Then ensure a rejection message is displayed
And ensure cash is not dispensed
And ensure the card is returned
User Story & Scenario Example
Scenario 3: Card has been disabled
Given the card is disabled
When the customer requests cash
Then the ATM should retain the card
And the ATM should say the card has been retained
Tools
• Python
0 Should-DSL
0 Lettuce
0 Pycuke
• Java
0 Jbehave
0 Concordion
• Ruby
0 Cucumber
• Others
0 Fitnesse
0 Tartare
BDD life cycle
BDD Life cycle
• Let’s choose a problem Given a
number, what is its factorial?
• User Story:
0 Feature: Compute factorial
0 In order to learn BDD
0 As beginners
0 We'll implement factorial
BDD Life cycle
• Writte the first scenario:
• Scenario: Factorial of 0
0 Given I have the number 0
0 When I compute its factorial
0 Then I see the number 1
BDD Life cycle
Define steps in python (or another
language):
BDD Life cycle
Run and watch it fail
BDD Life cycle
Write code to make it pass:
BDD Life cycle
Run again and watch it pass:
BDD Life cycle
Add the another scenarios:
0 Scenario: Factorial of 1
0 Given I have the number 1
0 When I compute its factorial
0 Then I see the number 1
0 Scenario: Factorial of 2
0 Given I have the number 2
0 When I compute its factorial
0 Then I see the number 2
BDD Life cycle
0We don’t need change the steps in python
because we haven’t changed the definition
BDD Life cycle
Write code to make it pass:
BDD Life cycle
Execute!
BDD Life cycle
• We can add more scenarios and
improve the software quality:
0 What happen when we introduce a character?
0 What happen when we introduce a float?
0 What happen when we not introduce nothing?
0 …
BDD Life cycle
Refactor your scenarios and source code:
BDD Life cycle
First:
0 Analyze the feature
•Google API about geography codification:
0 We want offer a product to improve the geography
knowledge
0 As a user we need a product that when a city is
introduced the application returns the country.
BDD Life cycle
0User story:
0 As a user
0 I want know the country code of one city
0 In order to improve my geography knowledge
BDD Life cycle
• We start thinking about the possible
scenarios to build the acceptance
criteria:
0 What happen if the city not exists?
0 What happen if the city parameter is null?
0 What happen if the city is mispelled
0 Should the request be authenticated?
BDD life cycle
Scenario Outline: Retrieve the geolocation with city
name given
Given a <city> name
When I request the geoencoding of the city
Then I obtain the <city> name with the <country_code>
Examples:
| city | country_code |
| Barcelona | ES |
| Paris | FR |
| San+Francisco | US |
BDD life cycle
• Code the scenario!
• Every line in the scenario is a function or
method in the code.
0 Given: Preconditions settings
0 When: API request
0 Then: Assertions
BDD life cycle
• Execute:
BDD life cycle
• Build the source code
• Remember build only the source code
required to pass the scenario
• If something is not required, delete it
BDD life cycle
Execute:
BDD life cycle
Refactor:
0 Give feedback to the stakeholders and the whole team
0 Refactor the source code to improve it!
0 Refactor the scenarios
0 Add new scenarios
BDD life cycle
BENEFITS
Communication
Improve communication
0 BDD is about conversations
0 Ubiquitous language (shared between stakeholders and
whole team)
0 Collaboration between stakeholders, Bussiness
Analysts, QA and programmers
Speak the same language = building
toguether
Documentation
• Formal documentation is not required
• Scenarios can be used as a software
documentation
• Every time the software changes… the
scenarios should be changed also (red,
green, refactor)
Live Documentation!!!!
Other benefits
• Only code the required functionality
(YAGNI)
• Quick feedback
If the tests are included in the CI
• Involve stakeholders in the
implementation process
• Develop code right and right code
• Give confidence in your code refactors
Resources
0 http://dannorth.net
0 http://lizkeogh.com
0 http://
www.slideshare.net/ajaydanait1/behavior-driven-development-bdd-16779998
0 http://behaviour-driven.org/
0 http://cukes.info/
0 http://lettuce.it/
0 http://fitnesse.org/
0 http://www.concordion.org/
0 http://jbehave.org/
0 User Stories Applied: For Agile Software Development, Mike Cohn
0 Agile Testing: A Practical Guide for Testers and Agile Teams, Lisa Crispin
and Janet Gregory
0 Specification by Example, Gojko Adzic
Questions?
Contact
Twiiter: @twiindan
Email: twiindan@gmail.com
Linkedin:
http://es.linkedin.com/in/antoniorobres
Web: www.softqatest.com

More Related Content

Similar to Hello bdd

Bdd agile requirements
Bdd agile requirementsBdd agile requirements
Bdd agile requirements
Agile Vietnam
 

Similar to Hello bdd (20)

Behavior Driven Development - WPC 2011
Behavior Driven Development - WPC 2011Behavior Driven Development - WPC 2011
Behavior Driven Development - WPC 2011
 
Behaviour Driven Development (BDD) - Closing the Loop on a Great Fiori UX
Behaviour Driven Development (BDD) - Closing the Loop on a Great Fiori UXBehaviour Driven Development (BDD) - Closing the Loop on a Great Fiori UX
Behaviour Driven Development (BDD) - Closing the Loop on a Great Fiori UX
 
Intro to TDD & BDD
Intro to TDD & BDDIntro to TDD & BDD
Intro to TDD & BDD
 
ITB2015 - Behavior Driven Development, Automation and Continuous Integration
ITB2015 - Behavior Driven Development, Automation and Continuous IntegrationITB2015 - Behavior Driven Development, Automation and Continuous Integration
ITB2015 - Behavior Driven Development, Automation and Continuous Integration
 
2015 in tothebox-introtddbdd
2015 in tothebox-introtddbdd2015 in tothebox-introtddbdd
2015 in tothebox-introtddbdd
 
Myths and Challenges of Behaviour Driven Development
Myths and Challenges of Behaviour Driven DevelopmentMyths and Challenges of Behaviour Driven Development
Myths and Challenges of Behaviour Driven Development
 
Introduction to BDD
Introduction to BDD Introduction to BDD
Introduction to BDD
 
Successfully Implementing BDD in an Agile World
Successfully Implementing BDD in an Agile WorldSuccessfully Implementing BDD in an Agile World
Successfully Implementing BDD in an Agile World
 
Automation testing
Automation testingAutomation testing
Automation testing
 
It's Better To Have a Permanent Income Than to Be Fascinating: Killer Feature...
It's Better To Have a Permanent Income Than to Be Fascinating: Killer Feature...It's Better To Have a Permanent Income Than to Be Fascinating: Killer Feature...
It's Better To Have a Permanent Income Than to Be Fascinating: Killer Feature...
 
Scrum + bdd + ddd
Scrum + bdd + dddScrum + bdd + ddd
Scrum + bdd + ddd
 
Build your first IoT device - The tricky interface of Product and R&D with Ni...
Build your first IoT device - The tricky interface of Product and R&D with Ni...Build your first IoT device - The tricky interface of Product and R&D with Ni...
Build your first IoT device - The tricky interface of Product and R&D with Ni...
 
Bdd in action
Bdd in actionBdd in action
Bdd in action
 
Cucumber, Zephyr and All the Rest
Cucumber, Zephyr and All the RestCucumber, Zephyr and All the Rest
Cucumber, Zephyr and All the Rest
 
ITB2017 - Intro to Behavior Driven Development
ITB2017 - Intro to Behavior Driven DevelopmentITB2017 - Intro to Behavior Driven Development
ITB2017 - Intro to Behavior Driven Development
 
Building Conversational Experiences for Google Assistant
Building Conversational Experiences for Google AssistantBuilding Conversational Experiences for Google Assistant
Building Conversational Experiences for Google Assistant
 
BDD in open source projects - Is it really beneficial?
BDD in open source projects - Is it really beneficial?BDD in open source projects - Is it really beneficial?
BDD in open source projects - Is it really beneficial?
 
It's Better To Have a Permanent Income Than to Be Fascinating: Killer Feature...
It's Better To Have a Permanent Income Than to Be Fascinating: Killer Feature...It's Better To Have a Permanent Income Than to Be Fascinating: Killer Feature...
It's Better To Have a Permanent Income Than to Be Fascinating: Killer Feature...
 
Bdd agile requirements
Bdd agile requirementsBdd agile requirements
Bdd agile requirements
 
Agile software requirements management with Impact Mapping and BDD
Agile software requirements management with Impact Mapping and BDDAgile software requirements management with Impact Mapping and BDD
Agile software requirements management with Impact Mapping and BDD
 

More from Antonio Robres Turon (10)

Mockito para tus pruebas unitarias
Mockito para tus pruebas unitariasMockito para tus pruebas unitarias
Mockito para tus pruebas unitarias
 
¡El mejor lenguaje para automatizar pruebas!
¡El mejor lenguaje para automatizar pruebas!¡El mejor lenguaje para automatizar pruebas!
¡El mejor lenguaje para automatizar pruebas!
 
[Tefcon] are you ready for the war
[Tefcon] are you ready for the war[Tefcon] are you ready for the war
[Tefcon] are you ready for the war
 
BDD en practica (seminario)
BDD en practica (seminario)BDD en practica (seminario)
BDD en practica (seminario)
 
El pequeño se hace mayor
El pequeño se hace mayor El pequeño se hace mayor
El pequeño se hace mayor
 
Testing Testing everywhere
Testing Testing everywhereTesting Testing everywhere
Testing Testing everywhere
 
One to rule them all
One to rule them allOne to rule them all
One to rule them all
 
Testing Proud
Testing ProudTesting Proud
Testing Proud
 
Existe el tester perfecto
Existe el tester perfectoExiste el tester perfecto
Existe el tester perfecto
 
Existe el tester perfecto
Existe el tester perfectoExiste el tester perfecto
Existe el tester perfecto
 

Recently uploaded

Artificial Intelligence: Facts and Myths
Artificial Intelligence: Facts and MythsArtificial Intelligence: Facts and Myths
Artificial Intelligence: Facts and Myths
Joaquim Jorge
 
EIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptx
EIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptxEIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptx
EIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptx
Earley Information Science
 

Recently uploaded (20)

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...
 
Boost PC performance: How more available memory can improve productivity
Boost PC performance: How more available memory can improve productivityBoost PC performance: How more available memory can improve productivity
Boost PC performance: How more available memory can improve productivity
 
GenCyber Cyber Security Day Presentation
GenCyber Cyber Security Day PresentationGenCyber Cyber Security Day Presentation
GenCyber Cyber Security Day Presentation
 
presentation ICT roal in 21st century education
presentation ICT roal in 21st century educationpresentation ICT roal in 21st century education
presentation ICT roal in 21st century education
 
Artificial Intelligence: Facts and Myths
Artificial Intelligence: Facts and MythsArtificial Intelligence: Facts and Myths
Artificial Intelligence: Facts and Myths
 
Strategies for Landing an Oracle DBA Job as a Fresher
Strategies for Landing an Oracle DBA Job as a FresherStrategies for Landing an Oracle DBA Job as a Fresher
Strategies for Landing an Oracle DBA Job as a Fresher
 
Understanding Discord NSFW Servers A Guide for Responsible Users.pdf
Understanding Discord NSFW Servers A Guide for Responsible Users.pdfUnderstanding Discord NSFW Servers A Guide for Responsible Users.pdf
Understanding Discord NSFW Servers A Guide for Responsible Users.pdf
 
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemke
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemkeProductAnonymous-April2024-WinProductDiscovery-MelissaKlemke
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemke
 
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
 
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
 
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
 
Presentation on how to chat with PDF using ChatGPT code interpreter
Presentation on how to chat with PDF using ChatGPT code interpreterPresentation on how to chat with PDF using ChatGPT code interpreter
Presentation on how to chat with PDF using ChatGPT code interpreter
 
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
 
Data Cloud, More than a CDP by Matt Robison
Data Cloud, More than a CDP by Matt RobisonData Cloud, More than a CDP by Matt Robison
Data Cloud, More than a CDP by Matt Robison
 
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
 
08448380779 Call Girls In Civil Lines Women Seeking Men
08448380779 Call Girls In Civil Lines Women Seeking Men08448380779 Call Girls In Civil Lines Women Seeking Men
08448380779 Call Girls In Civil Lines Women Seeking Men
 
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
 
04-2024-HHUG-Sales-and-Marketing-Alignment.pptx
04-2024-HHUG-Sales-and-Marketing-Alignment.pptx04-2024-HHUG-Sales-and-Marketing-Alignment.pptx
04-2024-HHUG-Sales-and-Marketing-Alignment.pptx
 
Handwritten Text Recognition for manuscripts and early printed texts
Handwritten Text Recognition for manuscripts and early printed textsHandwritten Text Recognition for manuscripts and early printed texts
Handwritten Text Recognition for manuscripts and early printed texts
 
EIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptx
EIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptxEIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptx
EIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptx
 

Hello bdd

  • 2. Given a speaker with name Toni When he is giving his conference Then you should not fall asleep
  • 3.
  • 5. Index • Why born BDD? • What is BDD? • How use BDD? • Benefits • Demo
  • 7. First approach TDD  Test Drive Development 0 Is not a tool!!!! It’s a design methodology 0 Focused in unit testing 0 Life cycle 0 Red 0 Green 0 Refactor 0 Something is missing: 0 THINK! 0 Think  Red  Green  Refactor
  • 8. TDD is fine but… • Is programmer focused • Only take care about the source code • Helps to write code right but not right code • Not support communication 0 Inside team (including QA, BA, Data analyst…) 0 With stakeholders • Is bottom – up process
  • 9. BDD History BDD was developed by Dan North as a response to the issues encountered teaching TDD 0 Where to start in the process 0 What to test and what not to test 0 How much to test in one go 0 What to call the tests 0 How to understand why a test fails 0 Give you reliability your tests?
  • 10. BDD History • The first proposes was that the unit testing names be whole sentences starting with the word SHOULD and written in order of business value. 0Every class should do something • ClientDetailsValidatorTest 0ShouldFailForMissingSurname 0ShouldFailForMissingAge
  • 12. Definition • 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. • Using examples to create a shared understanding and surface uncertainly to deliver software that matters.
  • 14. Story • What’s an story? It has to be a description of a requirement and its business benefit, and a set of criteria by which we all agree that it is “done” (Dann North) • Written in business language
  • 15. Story • Structure: 0 Title (one line describing the story) 0 Narrative: 0 As a [role] 0 I want [feature] 0 So that [benefit]
  • 16. Story Example: 0 As a user 0 I want to publish a tweet 0 So that share information with my followers
  • 17. Story Another template: 0 Title (one line describing the story) 0 Narrative 0 In order to [benefit] 0 As a [role] 0 I want to [feature]
  • 18. Story Example: 0 In order to share information with my followers 0 As a user 0 I want to publish a tweet
  • 19. Scenario • It’s the acceptance criteria • It’s a description of each specific case of the narrative • Can be used to help discover the scope of the story or the feature • The scenario should be described in terms of Givens, Events and Outcomes
  • 20. Scenario Structure: 0 Title (one line describing the scenario) 0 Narrative 0 Given [context] 0 And [some more context]... 0 When [event] 0 Then [outcome] 0 And [another outcome]...
  • 21. Scenario Example: Given a twitter account activated When I send a tweet with 139 characters Then the tweet is published And all my followers can read the tweet
  • 22. How to build scenarios? Only 4 keywords have the empowerment to build scenarios 0 but something is missing… What is the most powerful tool to build the scenarios?
  • 23.
  • 25. User Story & Scenario Example Title: Customer withdraws cash As a customer, I want to withdraw cash from an ATM, so that I don’t have to wait in line at the bank. Scenario 1: Account is in credit Given the account is in credit And the card is valid And the dispenser contains cash When the customer requests cash Then ensure the account is debited And ensure cash is dispensed And ensure the card is returned
  • 26. User Story & Scenario Example Scenario 2: Account has insufficient funds Given the account is overdrawn And the card is valid When the customer requests cash Then ensure a rejection message is displayed And ensure cash is not dispensed And ensure the card is returned
  • 27. User Story & Scenario Example Scenario 3: Card has been disabled Given the card is disabled When the customer requests cash Then the ATM should retain the card And the ATM should say the card has been retained
  • 28. Tools • Python 0 Should-DSL 0 Lettuce 0 Pycuke • Java 0 Jbehave 0 Concordion • Ruby 0 Cucumber • Others 0 Fitnesse 0 Tartare
  • 30. BDD Life cycle • Let’s choose a problem Given a number, what is its factorial? • User Story: 0 Feature: Compute factorial 0 In order to learn BDD 0 As beginners 0 We'll implement factorial
  • 31. BDD Life cycle • Writte the first scenario: • Scenario: Factorial of 0 0 Given I have the number 0 0 When I compute its factorial 0 Then I see the number 1
  • 32. BDD Life cycle Define steps in python (or another language):
  • 33. BDD Life cycle Run and watch it fail
  • 34. BDD Life cycle Write code to make it pass:
  • 35. BDD Life cycle Run again and watch it pass:
  • 36. BDD Life cycle Add the another scenarios: 0 Scenario: Factorial of 1 0 Given I have the number 1 0 When I compute its factorial 0 Then I see the number 1 0 Scenario: Factorial of 2 0 Given I have the number 2 0 When I compute its factorial 0 Then I see the number 2
  • 37. BDD Life cycle 0We don’t need change the steps in python because we haven’t changed the definition
  • 38. BDD Life cycle Write code to make it pass:
  • 40. BDD Life cycle • We can add more scenarios and improve the software quality: 0 What happen when we introduce a character? 0 What happen when we introduce a float? 0 What happen when we not introduce nothing? 0 …
  • 41. BDD Life cycle Refactor your scenarios and source code:
  • 42. BDD Life cycle First: 0 Analyze the feature •Google API about geography codification: 0 We want offer a product to improve the geography knowledge 0 As a user we need a product that when a city is introduced the application returns the country.
  • 43. BDD Life cycle 0User story: 0 As a user 0 I want know the country code of one city 0 In order to improve my geography knowledge
  • 44. BDD Life cycle • We start thinking about the possible scenarios to build the acceptance criteria: 0 What happen if the city not exists? 0 What happen if the city parameter is null? 0 What happen if the city is mispelled 0 Should the request be authenticated?
  • 45. BDD life cycle Scenario Outline: Retrieve the geolocation with city name given Given a <city> name When I request the geoencoding of the city Then I obtain the <city> name with the <country_code> Examples: | city | country_code | | Barcelona | ES | | Paris | FR | | San+Francisco | US |
  • 46. BDD life cycle • Code the scenario! • Every line in the scenario is a function or method in the code. 0 Given: Preconditions settings 0 When: API request 0 Then: Assertions
  • 47. BDD life cycle • Execute:
  • 48. BDD life cycle • Build the source code • Remember build only the source code required to pass the scenario • If something is not required, delete it
  • 50. BDD life cycle Refactor: 0 Give feedback to the stakeholders and the whole team 0 Refactor the source code to improve it! 0 Refactor the scenarios 0 Add new scenarios
  • 53. Communication Improve communication 0 BDD is about conversations 0 Ubiquitous language (shared between stakeholders and whole team) 0 Collaboration between stakeholders, Bussiness Analysts, QA and programmers Speak the same language = building toguether
  • 54. Documentation • Formal documentation is not required • Scenarios can be used as a software documentation • Every time the software changes… the scenarios should be changed also (red, green, refactor) Live Documentation!!!!
  • 55. Other benefits • Only code the required functionality (YAGNI) • Quick feedback If the tests are included in the CI • Involve stakeholders in the implementation process • Develop code right and right code • Give confidence in your code refactors
  • 56. Resources 0 http://dannorth.net 0 http://lizkeogh.com 0 http:// www.slideshare.net/ajaydanait1/behavior-driven-development-bdd-16779998 0 http://behaviour-driven.org/ 0 http://cukes.info/ 0 http://lettuce.it/ 0 http://fitnesse.org/ 0 http://www.concordion.org/ 0 http://jbehave.org/ 0 User Stories Applied: For Agile Software Development, Mike Cohn 0 Agile Testing: A Practical Guide for Testers and Agile Teams, Lisa Crispin and Janet Gregory 0 Specification by Example, Gojko Adzic