SlideShare a Scribd company logo
1 of 16
Download to read offline
BDD – Behaviour Driven Development
Marek Majchrzak, Andrzej Bednarz
Wrocław, 11.10.2011
BDD in a nutshell
It is an evolution in the thinking behind TDD (Test Driven Development)
and Acceptance Tests Driven Planning

It brings together strands from TDD (Test Driven Development) and
Domain Driven Design into an integrated whole

Source: http://behaviour-driven.org/

Source:
http://lostechies.com/derekgreer/2011/03/21/effectivetests-test-first/

© 2010 Capgemini – All rights reserved
#16_BDD – Behaviour Driven Development.pptx

2
BDD origins – Dan North
I had a problem. While using and teaching agile practices like test-driven
development (TDD) on projects in different environments, I kept coming
across the same confusion and misunderstandings
Programmers wanted to know where to start, what to test and what not to
test, how much to test in one go, what to call their tests, and how to
understand why a test fails.
My response is behaviour-driven development (BDD).

Source: http://dannorth.net/introducing-bdd/
© 2010 Capgemini – All rights reserved
#16_BDD – Behaviour Driven Development.pptx

3
Template for user stories
As a [X]
I want [Y]
so that [Z]
in ubiquitous language!

As a customer,
I want to withdraw cash from an ATM,
so that I don’t have to wait in line at the bank.
A story’s behaviour is simply its acceptance criteria – if the system fulfills all the acceptance
criteria, it’s behaving correctly; if it doesn’t, it isn’t. So we created a template to capture a
story’s acceptance criteria.
Source: http://dannorth.net/introducing-bdd/
© 2010 Capgemini – All rights reserved
#16_BDD – Behaviour Driven Development.pptx

4
Template for scenarios
Given some initial context (the givens),
When an event occurs,
Then ensure some outcomes.

Scenario 1:
Account is in credit

Scenario 2:
Account is overdrawn past the
overdraft limit

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

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

Source: http://dannorth.net/introducing-bdd/
© 2010 Capgemini – All rights reserved
#16_BDD – Behaviour Driven Development.pptx

5
Example

© 2010 Capgemini – All rights reserved
#16_BDD – Behaviour Driven Development.pptx

6
Example

© 2010 Capgemini – All rights reserved
#16_BDD – Behaviour Driven Development.pptx

7
Example

© 2010 Capgemini – All rights reserved
#16_BDD – Behaviour Driven Development.pptx

8
Example

© 2010 Capgemini – All rights reserved
#16_BDD – Behaviour Driven Development.pptx

9
Example

© 2010 Capgemini – All rights reserved
#16_BDD – Behaviour Driven Development.pptx

10
Another example
Given a stock of <symbol> and a <threshold>
When the stock is traded at <price>
Then the alert status should be <status>
Examples:
|symbol|threshold|price|status|
|STK1|10.0|5.0|OFF|
|STK1|10.0|11.0|ON|

© 2010 Capgemini – All rights reserved
#16_BDD – Behaviour Driven Development.pptx

11
The Core Principles

Business and Technology should refer to the
same system in the same way – Its all behaviour
Any system should have an identified, verifiable
value to the business – Wheres the business value
Up-front analysis, design and planning all have a
diminishing return – Enough is enough

© 2010 Capgemini – All rights reserved
#16_BDD – Behaviour Driven Development.pptx

12
BDD vs TDD
• It is important to keep BDD distinct from TDD. These two practices are
equally important but address different concerns and should be
complementary in best development practices.

• BDD is concerned primarily with the specification of the behavior of the
system under test as a whole, thus is particularly suited for acceptance
and regression testing. TDD is concerned primarily with the testing of a
component as a unit, in isolation from other dependencies, which are
typically mocked or stubbed.

• BDD should talk the language of the business domain and not the
language of the development technology, which on the other hand is
“spoken” by TDD.

© 2010 Capgemini – All rights reserved
#16_BDD – Behaviour Driven Development.pptx

13
Sources, References and more…
1. Dan North, Introducing BDD,
http://dannorth.net/introducing-bdd/
2. BDD Wiki, http://behaviour-driven.org/
3. JBehave, http://jbehave.org/
4. RSpec, http://rspec.info/
5. Cucumber, http://cukes.info/
6. Dan North, Deliberate Discovery,
http://dannorth.net/2010/08/30/introducing-deliberatediscovery/
7. Dan North, Programming is not a craft,
http://dannorth.net/2011/01/11/programming-is-not-a-craft/
& Martin Fowler
http://martinfowler.com/bliki/CraftmanshipAndTheCrevasse
.html
8. Liz Keogh's blog, http://lizkeogh.com/

© 2010 Capgemini – All rights reserved
#16_BDD – Behaviour Driven Development.pptx

14
Vielen Dank für Ihre Aufmerksamkeit!

www.de.capgemini.com
Programming is not a craft - Opposition to Software Craftmanship
The software shouldn't be at the center of a programmer's world, instead a
programmer should focus on the benefit that the software is supposed to
deliver.
Martin Fowler
I would love to see someone rewrite the Software Craftsmanship Manifesto
in terms of getting results and delighting customers.
Dan North
I don’t want “steadily adding value,” I want “amazing their customers
every day!” Software craftsmen should be egoless, humble, with a focus
on the outcome rather than the code or the process.
Dan North
… refactoring to oblivion while failing to deliver, focusing on test coverage
while the company continues to leak money, worrying about the latest
testing tool while failing to talk to stakeholders, or insisting that no one
can interrupt their two-week sprint once they’ve made a commitment …
Liz Keogh
© 2010 Capgemini – All rights reserved
#16_BDD – Behaviour Driven Development.pptx

16

More Related Content

Similar to bdd behaviour driven development

What to prepare before engaging with an offshore team (footnotes included)
What to prepare before engaging with an offshore team (footnotes included)What to prepare before engaging with an offshore team (footnotes included)
What to prepare before engaging with an offshore team (footnotes included)Chris Hote
 
Bridging the gap between business and technology - Behaviour Driven Developme...
Bridging the gap between business and technology - Behaviour Driven Developme...Bridging the gap between business and technology - Behaviour Driven Developme...
Bridging the gap between business and technology - Behaviour Driven Developme...marcin_pajdzik
 
Practiced agile developer with tdd & bdd
Practiced agile developer with tdd & bdd Practiced agile developer with tdd & bdd
Practiced agile developer with tdd & bdd Sakares Saengkaew
 
Bridging the gap between business and technology - Behaviour Driven Developme...
Bridging the gap between business and technology - Behaviour Driven Developme...Bridging the gap between business and technology - Behaviour Driven Developme...
Bridging the gap between business and technology - Behaviour Driven Developme...Eugenio Minardi
 
Hemant_Mittal_Resume
Hemant_Mittal_ResumeHemant_Mittal_Resume
Hemant_Mittal_ResumeHemant Mittal
 
Whole team approach to agile testing bdd can help better pune 15th meetup
Whole team approach to agile testing    bdd can help better pune 15th meetupWhole team approach to agile testing    bdd can help better pune 15th meetup
Whole team approach to agile testing bdd can help better pune 15th meetupAgile Testing Alliance
 
Building Durable Software in Startups
Building Durable Software in StartupsBuilding Durable Software in Startups
Building Durable Software in StartupsDipto Chakravarty
 
Attacking M&A Due Diligence - To Win!
Attacking M&A Due Diligence - To Win!Attacking M&A Due Diligence - To Win!
Attacking M&A Due Diligence - To Win!Daniel Behrendt
 
Doniel Wilson Presents: Surviving the Shift. Agile and its Impact to your Fut...
Doniel Wilson Presents: Surviving the Shift. Agile and its Impact to your Fut...Doniel Wilson Presents: Surviving the Shift. Agile and its Impact to your Fut...
Doniel Wilson Presents: Surviving the Shift. Agile and its Impact to your Fut...Liana Underwood
 
Wednesday Webinar on "Strengthening your Agility with BDD - A demo using Cucu...
Wednesday Webinar on "Strengthening your Agility with BDD - A demo using Cucu...Wednesday Webinar on "Strengthening your Agility with BDD - A demo using Cucu...
Wednesday Webinar on "Strengthening your Agility with BDD - A demo using Cucu...Agile Testing Alliance
 
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
 
Pay Now or Pay More Every Day: Reduce Technical Debt Now!
Pay Now or Pay More Every Day: Reduce Technical Debt Now!Pay Now or Pay More Every Day: Reduce Technical Debt Now!
Pay Now or Pay More Every Day: Reduce Technical Debt Now!TechWell
 
Chap 4.1- Develop Project Charter
Chap 4.1- Develop Project CharterChap 4.1- Develop Project Charter
Chap 4.1- Develop Project CharterAnand Bobade
 

Similar to bdd behaviour driven development (20)

Cs207 1
Cs207 1Cs207 1
Cs207 1
 
What to prepare before engaging with an offshore team (footnotes included)
What to prepare before engaging with an offshore team (footnotes included)What to prepare before engaging with an offshore team (footnotes included)
What to prepare before engaging with an offshore team (footnotes included)
 
Bridging the gap between business and technology - Behaviour Driven Developme...
Bridging the gap between business and technology - Behaviour Driven Developme...Bridging the gap between business and technology - Behaviour Driven Developme...
Bridging the gap between business and technology - Behaviour Driven Developme...
 
Practiced agile developer with tdd & bdd
Practiced agile developer with tdd & bdd Practiced agile developer with tdd & bdd
Practiced agile developer with tdd & bdd
 
Bridging the gap between business and technology - Behaviour Driven Developme...
Bridging the gap between business and technology - Behaviour Driven Developme...Bridging the gap between business and technology - Behaviour Driven Developme...
Bridging the gap between business and technology - Behaviour Driven Developme...
 
Hemant_Mittal_Resume
Hemant_Mittal_ResumeHemant_Mittal_Resume
Hemant_Mittal_Resume
 
Profile2016
Profile2016Profile2016
Profile2016
 
Introduction to TDD and BDD
Introduction to TDD and BDDIntroduction to TDD and BDD
Introduction to TDD and BDD
 
Whole team approach to agile testing bdd can help better pune 15th meetup
Whole team approach to agile testing    bdd can help better pune 15th meetupWhole team approach to agile testing    bdd can help better pune 15th meetup
Whole team approach to agile testing bdd can help better pune 15th meetup
 
Building Durable Software in Startups
Building Durable Software in StartupsBuilding Durable Software in Startups
Building Durable Software in Startups
 
Santhosh_Resume
Santhosh_ResumeSanthosh_Resume
Santhosh_Resume
 
Attacking M&A Due Diligence - To Win!
Attacking M&A Due Diligence - To Win!Attacking M&A Due Diligence - To Win!
Attacking M&A Due Diligence - To Win!
 
Doniel Wilson Presents: Surviving the Shift. Agile and its Impact to your Fut...
Doniel Wilson Presents: Surviving the Shift. Agile and its Impact to your Fut...Doniel Wilson Presents: Surviving the Shift. Agile and its Impact to your Fut...
Doniel Wilson Presents: Surviving the Shift. Agile and its Impact to your Fut...
 
Agile Dev. II
Agile Dev. IIAgile Dev. II
Agile Dev. II
 
Wednesday Webinar on "Strengthening your Agility with BDD - A demo using Cucu...
Wednesday Webinar on "Strengthening your Agility with BDD - A demo using Cucu...Wednesday Webinar on "Strengthening your Agility with BDD - A demo using Cucu...
Wednesday Webinar on "Strengthening your Agility with BDD - A demo using Cucu...
 
Project tree
Project treeProject tree
Project tree
 
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...
 
RESUME Danish_Mujawar
RESUME Danish_MujawarRESUME Danish_Mujawar
RESUME Danish_Mujawar
 
Pay Now or Pay More Every Day: Reduce Technical Debt Now!
Pay Now or Pay More Every Day: Reduce Technical Debt Now!Pay Now or Pay More Every Day: Reduce Technical Debt Now!
Pay Now or Pay More Every Day: Reduce Technical Debt Now!
 
Chap 4.1- Develop Project Charter
Chap 4.1- Develop Project CharterChap 4.1- Develop Project Charter
Chap 4.1- Develop Project Charter
 

Recently uploaded

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 MenDelhi Call girls
 
A Year of the Servo Reboot: Where Are We Now?
A Year of the Servo Reboot: Where Are We Now?A Year of the Servo Reboot: Where Are We Now?
A Year of the Servo Reboot: Where Are We Now?Igalia
 
Artificial Intelligence: Facts and Myths
Artificial Intelligence: Facts and MythsArtificial Intelligence: Facts and Myths
Artificial Intelligence: Facts and MythsJoaquim Jorge
 
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 2024The Digital Insurer
 
Breaking the Kubernetes Kill Chain: Host Path Mount
Breaking the Kubernetes Kill Chain: Host Path MountBreaking the Kubernetes Kill Chain: Host Path Mount
Breaking the Kubernetes Kill Chain: Host Path MountPuma Security, LLC
 
[2024]Digital Global Overview Report 2024 Meltwater.pdf
[2024]Digital Global Overview Report 2024 Meltwater.pdf[2024]Digital Global Overview Report 2024 Meltwater.pdf
[2024]Digital Global Overview Report 2024 Meltwater.pdfhans926745
 
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 MenDelhi Call girls
 
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 RobisonAnna Loughnan Colquhoun
 
Finology Group – Insurtech Innovation Award 2024
Finology Group – Insurtech Innovation Award 2024Finology Group – Insurtech Innovation Award 2024
Finology Group – Insurtech Innovation Award 2024The Digital Insurer
 
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 Processorsdebabhi2
 
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 interpreternaman860154
 
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 organizationRadu Cotescu
 
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 2024Rafal Los
 
A Call to Action for Generative AI in 2024
A Call to Action for Generative AI in 2024A Call to Action for Generative AI in 2024
A Call to Action for Generative AI in 2024Results
 
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.pdfUK Journal
 
08448380779 Call Girls In Diplomatic Enclave Women Seeking Men
08448380779 Call Girls In Diplomatic Enclave Women Seeking Men08448380779 Call Girls In Diplomatic Enclave Women Seeking Men
08448380779 Call Girls In Diplomatic Enclave Women Seeking MenDelhi Call girls
 
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...Neo4j
 
Factors to Consider When Choosing Accounts Payable Services Providers.pptx
Factors to Consider When Choosing Accounts Payable Services Providers.pptxFactors to Consider When Choosing Accounts Payable Services Providers.pptx
Factors to Consider When Choosing Accounts Payable Services Providers.pptxKatpro Technologies
 
Slack Application Development 101 Slides
Slack Application Development 101 SlidesSlack Application Development 101 Slides
Slack Application Development 101 Slidespraypatel2
 
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...apidays
 

Recently uploaded (20)

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
 
A Year of the Servo Reboot: Where Are We Now?
A Year of the Servo Reboot: Where Are We Now?A Year of the Servo Reboot: Where Are We Now?
A Year of the Servo Reboot: Where Are We Now?
 
Artificial Intelligence: Facts and Myths
Artificial Intelligence: Facts and MythsArtificial Intelligence: Facts and Myths
Artificial Intelligence: Facts and Myths
 
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
 
Breaking the Kubernetes Kill Chain: Host Path Mount
Breaking the Kubernetes Kill Chain: Host Path MountBreaking the Kubernetes Kill Chain: Host Path Mount
Breaking the Kubernetes Kill Chain: Host Path Mount
 
[2024]Digital Global Overview Report 2024 Meltwater.pdf
[2024]Digital Global Overview Report 2024 Meltwater.pdf[2024]Digital Global Overview Report 2024 Meltwater.pdf
[2024]Digital Global Overview Report 2024 Meltwater.pdf
 
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
 
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
 
Finology Group – Insurtech Innovation Award 2024
Finology Group – Insurtech Innovation Award 2024Finology Group – Insurtech Innovation Award 2024
Finology Group – Insurtech Innovation Award 2024
 
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
 
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
 
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
 
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
 
A Call to Action for Generative AI in 2024
A Call to Action for Generative AI in 2024A Call to Action for Generative AI in 2024
A Call to Action for Generative AI in 2024
 
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
 
08448380779 Call Girls In Diplomatic Enclave Women Seeking Men
08448380779 Call Girls In Diplomatic Enclave Women Seeking Men08448380779 Call Girls In Diplomatic Enclave Women Seeking Men
08448380779 Call Girls In Diplomatic Enclave Women Seeking Men
 
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...
 
Factors to Consider When Choosing Accounts Payable Services Providers.pptx
Factors to Consider When Choosing Accounts Payable Services Providers.pptxFactors to Consider When Choosing Accounts Payable Services Providers.pptx
Factors to Consider When Choosing Accounts Payable Services Providers.pptx
 
Slack Application Development 101 Slides
Slack Application Development 101 SlidesSlack Application Development 101 Slides
Slack Application Development 101 Slides
 
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...
 

bdd behaviour driven development

  • 1. BDD – Behaviour Driven Development Marek Majchrzak, Andrzej Bednarz Wrocław, 11.10.2011
  • 2. BDD in a nutshell It is an evolution in the thinking behind TDD (Test Driven Development) and Acceptance Tests Driven Planning It brings together strands from TDD (Test Driven Development) and Domain Driven Design into an integrated whole Source: http://behaviour-driven.org/ Source: http://lostechies.com/derekgreer/2011/03/21/effectivetests-test-first/ © 2010 Capgemini – All rights reserved #16_BDD – Behaviour Driven Development.pptx 2
  • 3. BDD origins – Dan North I had a problem. While using and teaching agile practices like test-driven development (TDD) on projects in different environments, I kept coming across the same confusion and misunderstandings Programmers wanted to know where to start, what to test and what not to test, how much to test in one go, what to call their tests, and how to understand why a test fails. My response is behaviour-driven development (BDD). Source: http://dannorth.net/introducing-bdd/ © 2010 Capgemini – All rights reserved #16_BDD – Behaviour Driven Development.pptx 3
  • 4. Template for user stories As a [X] I want [Y] so that [Z] in ubiquitous language! As a customer, I want to withdraw cash from an ATM, so that I don’t have to wait in line at the bank. A story’s behaviour is simply its acceptance criteria – if the system fulfills all the acceptance criteria, it’s behaving correctly; if it doesn’t, it isn’t. So we created a template to capture a story’s acceptance criteria. Source: http://dannorth.net/introducing-bdd/ © 2010 Capgemini – All rights reserved #16_BDD – Behaviour Driven Development.pptx 4
  • 5. Template for scenarios Given some initial context (the givens), When an event occurs, Then ensure some outcomes. Scenario 1: Account is in credit Scenario 2: Account is overdrawn past the overdraft limit 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 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 Source: http://dannorth.net/introducing-bdd/ © 2010 Capgemini – All rights reserved #16_BDD – Behaviour Driven Development.pptx 5
  • 6. Example © 2010 Capgemini – All rights reserved #16_BDD – Behaviour Driven Development.pptx 6
  • 7. Example © 2010 Capgemini – All rights reserved #16_BDD – Behaviour Driven Development.pptx 7
  • 8. Example © 2010 Capgemini – All rights reserved #16_BDD – Behaviour Driven Development.pptx 8
  • 9. Example © 2010 Capgemini – All rights reserved #16_BDD – Behaviour Driven Development.pptx 9
  • 10. Example © 2010 Capgemini – All rights reserved #16_BDD – Behaviour Driven Development.pptx 10
  • 11. Another example Given a stock of <symbol> and a <threshold> When the stock is traded at <price> Then the alert status should be <status> Examples: |symbol|threshold|price|status| |STK1|10.0|5.0|OFF| |STK1|10.0|11.0|ON| © 2010 Capgemini – All rights reserved #16_BDD – Behaviour Driven Development.pptx 11
  • 12. The Core Principles Business and Technology should refer to the same system in the same way – Its all behaviour Any system should have an identified, verifiable value to the business – Wheres the business value Up-front analysis, design and planning all have a diminishing return – Enough is enough © 2010 Capgemini – All rights reserved #16_BDD – Behaviour Driven Development.pptx 12
  • 13. BDD vs TDD • It is important to keep BDD distinct from TDD. These two practices are equally important but address different concerns and should be complementary in best development practices. • BDD is concerned primarily with the specification of the behavior of the system under test as a whole, thus is particularly suited for acceptance and regression testing. TDD is concerned primarily with the testing of a component as a unit, in isolation from other dependencies, which are typically mocked or stubbed. • BDD should talk the language of the business domain and not the language of the development technology, which on the other hand is “spoken” by TDD. © 2010 Capgemini – All rights reserved #16_BDD – Behaviour Driven Development.pptx 13
  • 14. Sources, References and more… 1. Dan North, Introducing BDD, http://dannorth.net/introducing-bdd/ 2. BDD Wiki, http://behaviour-driven.org/ 3. JBehave, http://jbehave.org/ 4. RSpec, http://rspec.info/ 5. Cucumber, http://cukes.info/ 6. Dan North, Deliberate Discovery, http://dannorth.net/2010/08/30/introducing-deliberatediscovery/ 7. Dan North, Programming is not a craft, http://dannorth.net/2011/01/11/programming-is-not-a-craft/ & Martin Fowler http://martinfowler.com/bliki/CraftmanshipAndTheCrevasse .html 8. Liz Keogh's blog, http://lizkeogh.com/ © 2010 Capgemini – All rights reserved #16_BDD – Behaviour Driven Development.pptx 14
  • 15. Vielen Dank für Ihre Aufmerksamkeit! www.de.capgemini.com
  • 16. Programming is not a craft - Opposition to Software Craftmanship The software shouldn't be at the center of a programmer's world, instead a programmer should focus on the benefit that the software is supposed to deliver. Martin Fowler I would love to see someone rewrite the Software Craftsmanship Manifesto in terms of getting results and delighting customers. Dan North I don’t want “steadily adding value,” I want “amazing their customers every day!” Software craftsmen should be egoless, humble, with a focus on the outcome rather than the code or the process. Dan North … refactoring to oblivion while failing to deliver, focusing on test coverage while the company continues to leak money, worrying about the latest testing tool while failing to talk to stakeholders, or insisting that no one can interrupt their two-week sprint once they’ve made a commitment … Liz Keogh © 2010 Capgemini – All rights reserved #16_BDD – Behaviour Driven Development.pptx 16