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

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
 
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
 
Real Time Object Detection Using Open CV
Real Time Object Detection Using Open CVReal Time Object Detection Using Open CV
Real Time Object Detection Using Open CVKhem
 
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
 
IAC 2024 - IA Fast Track to Search Focused AI Solutions
IAC 2024 - IA Fast Track to Search Focused AI SolutionsIAC 2024 - IA Fast Track to Search Focused AI Solutions
IAC 2024 - IA Fast Track to Search Focused AI SolutionsEnterprise Knowledge
 
Tata AIG General Insurance Company - Insurer Innovation Award 2024
Tata AIG General Insurance Company - Insurer Innovation Award 2024Tata AIG General Insurance Company - Insurer Innovation Award 2024
Tata AIG General Insurance Company - Insurer Innovation Award 2024The Digital Insurer
 
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 MenDelhi Call girls
 
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 2024The Digital Insurer
 
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
 
What Are The Drone Anti-jamming Systems Technology?
What Are The Drone Anti-jamming Systems Technology?What Are The Drone Anti-jamming Systems Technology?
What Are The Drone Anti-jamming Systems Technology?Antenna Manufacturer Coco
 
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 Nanonetsnaman860154
 
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
 
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
 
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
 
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...Drew Madelung
 
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)wesley chun
 
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...Miguel Araújo
 
Histor y of HAM Radio presentation slide
Histor y of HAM Radio presentation slideHistor y of HAM Radio presentation slide
Histor y of HAM Radio presentation slidevu2urc
 
A Domino Admins Adventures (Engage 2024)
A Domino Admins Adventures (Engage 2024)A Domino Admins Adventures (Engage 2024)
A Domino Admins Adventures (Engage 2024)Gabriella Davis
 
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
 

Recently uploaded (20)

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?
 
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
 
Real Time Object Detection Using Open CV
Real Time Object Detection Using Open CVReal Time Object Detection Using Open CV
Real Time Object Detection Using Open CV
 
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...
 
IAC 2024 - IA Fast Track to Search Focused AI Solutions
IAC 2024 - IA Fast Track to Search Focused AI SolutionsIAC 2024 - IA Fast Track to Search Focused AI Solutions
IAC 2024 - IA Fast Track to Search Focused AI Solutions
 
Tata AIG General Insurance Company - Insurer Innovation Award 2024
Tata AIG General Insurance Company - Insurer Innovation Award 2024Tata AIG General Insurance Company - Insurer Innovation Award 2024
Tata AIG General Insurance Company - Insurer Innovation Award 2024
 
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
 
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
 
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
 
What Are The Drone Anti-jamming Systems Technology?
What Are The Drone Anti-jamming Systems Technology?What Are The Drone Anti-jamming Systems Technology?
What Are The Drone Anti-jamming Systems Technology?
 
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
 
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
 
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
 
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
 
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...
 
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)
 
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...
 
Histor y of HAM Radio presentation slide
Histor y of HAM Radio presentation slideHistor y of HAM Radio presentation slide
Histor y of HAM Radio presentation slide
 
A Domino Admins Adventures (Engage 2024)
A Domino Admins Adventures (Engage 2024)A Domino Admins Adventures (Engage 2024)
A Domino Admins Adventures (Engage 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
 

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