SlideShare une entreprise Scribd logo
1  sur  28
Behaviour Driven
  Development
  owen evans, xero.com developer
   http://bgeek.net @buildmaster
Behaviour Driven
      Development

• What is BDD?
 • A rethinking and repurposing of
   existing methodologies
 • A second generation Agile Technique
 • A companion to other techniques
   such as TDD and XP
A Combination of
        Disciplines
• TDD
 • Test first methodology
 • But a focus on value
 • Defining value up front
• XP/Scrum/<Insert ‘Agile’ methodology here>
 • Close communication with all stakeholders
 • Common language definition to aid
   communication
A Focus On Value

• TDD says only one thing: Test First
 • Tests alone do not drive value
 • Tests are not deliverables
 • Tests can be crap
• BDD says: only do what needs to be
  done (and test first)
What needs to be done?
• Test driven specification/Acceptance
  Test Driven Design
 • All systems can be defined by their
   behaviour [says BDD]
 • The behaviour is what makes a system
   usable/crap
 • We can use required behaviour to
   drive development
Features
(come from agile
    stories)
Example: STEP ONE THE
       Feature


Feature
As a Cake Lover
I want to be able to turn on my Acme
Cake Maker
So that I can start making great cakes
The Feature


• Broken into three elements:
• the actor (Cake Lover)
• the action (turn on cake maker)
• the motivation (want to start making
  cakes)
Why?

• The actor gives us a stakeholder, this is
  who we’re providing value to
• The action allows us to drive
  functionality
• The motivation allows us to tell when
  we’re done
Example part 2: The
     Scenario(s)
Scenario
Given there the cake maker is not switched
on
When I press the “on” button
Then the machine should say “welcome to
the Acme Cake Maker”
And the machine should ask me which cake
type I want to make
Scenarios


• Scenarios are always 1st person
 • We want to design in terms of the
   stakeholder
 • We want to see that we are providing
   them value
What does this give us?
• BDD has three main tenants:
  • Enough is Enough
    • Just do what’s needed no more
  • Deliver Stakeholder Value
    • Everything we do should be tracable to
      value to a stakeholder
  • It’s All Behaviour
    • We can alwys describe code in terms of it’s
      behaviours
Remember

• A stakeholder isn’t necessarily a human
 • it can be a company goal
 • it can be required API’s
 • it can be other developers (ok they
   might be human)
 • Stakeholder ≠ customer
Great... WTF?



• How do we apply this
 • BDD has inspired many tools
ATDD* Tools
*Acceptance Test Driven Design
FitNesse
    Granddaddy of
  Acceptance Testing
         Tools.
 A wiki formed around
  Ward Cunningham’s
    Framework for
Integrated Testing (FIT)
• Pros:

 • Language agnostic (runners for most major
   languages)

 • Wiki Syntax is easy to learn and use

• Cons:

 • Doesn’t support BDD syntax easily/natively

 • Fit style tests can be quite cumbersome
   when setting up complex objects
Story Q
Nunit Based Runner for
        Stories
Story Q
• Pros:

  • native c#

  • native support for BDD

  • quick integration with
    testing tools

• Cons

  • Code based (only
    output is stakeholder
    readable)

  • Syntax can be hard
Cucumber
      A Ruby BDD
 Specification Runner
Part of the RSpec Ruby
  Testing Framework
• Pros:

 • Feature rich

 • Native support for BDD syntax

 • Plain text runner (sharable
   specifications)

• Cons:

 • Ruby only
Unit Testing
• Keep to your framework of choice

 • Xunit.net

 • Nunit

 • MBUnit

 • also many frameworks to help use a more
   BDD syntax

   • NBehave, NSpecify,
     Machine.Specifications
How does this all fit
       together
• Concentric feedback circles:
  • Step 1 write the acceptance test(s) using Given
    When Then syntax
  • Step 2: Make sure they fail (red-green-refactor
    cycle)
  • Step 3: Write unit test on first part of code (this is
    just TDD), and make sure it fails
  • Step 4: Make test pass, does Acceptance test pass?
    • Yes go to step 1, No go to step 3
In Pictures
     Focus on one scenario

1.   Write Failing step definition

     drop into unit tests

2.   Write failing unit test

3.   Get the test to pass

4.   Refactor

5.   Once Acceptance Test Step is passing

6.   Refactor

7.   Repeat 2-6 till acceptance test is
     complete and passes

     Write next acceptance test
Take aways
• BDD is not about tooling
• BDD focuses on three tenants
 • Enough is Enough
 • Always deliver value
 • Everything can be expressed as
   behaviour
• BDD is only part of the arsenal
Great resources
• Cucumber and RSpec are thought
  leading frameworks so read the RSpec
  Book
 • http://www.pragprog.com/titles/
   achbd/the-rspec-book
• BDD mailing list
 • http://groups.google.com/group/
   behaviordrivendevelopment
FIN
 me: owen@bgeek.net
Twitter: @Buildmaster
Blog: http://bgeek.net

Contenu connexe

Tendances

Behavior-Driven Design: One Team's Exploration
Behavior-Driven Design: One Team's ExplorationBehavior-Driven Design: One Team's Exploration
Behavior-Driven Design: One Team's Explorationdtcoutu
 
Introduction to Bdd and cucumber
Introduction to Bdd and cucumberIntroduction to Bdd and cucumber
Introduction to Bdd and cucumberNibu Baby
 
TDD, Refactoring - Workshop
TDD, Refactoring - WorkshopTDD, Refactoring - Workshop
TDD, Refactoring - WorkshopLeena N
 
BDD and QA - Make Yourself More Valuable
BDD and QA - Make Yourself More ValuableBDD and QA - Make Yourself More Valuable
BDD and QA - Make Yourself More Valuablevikramviblr
 
Promoting Agility with Running Tested Features - Lightening Talk
Promoting Agility with Running Tested Features - Lightening TalkPromoting Agility with Running Tested Features - Lightening Talk
Promoting Agility with Running Tested Features - Lightening TalkCamille Bell
 
Beter code for better tests
Beter code for better testsBeter code for better tests
Beter code for better testsGil Zilberfeld
 
Inside Behavior Driven Development
Inside Behavior Driven DevelopmentInside Behavior Driven Development
Inside Behavior Driven DevelopmentCamille Bell
 
Zen and the Art of Test Maintenance
Zen and the Art of Test MaintenanceZen and the Art of Test Maintenance
Zen and the Art of Test MaintenanceGil Zilberfeld
 
Test Driven Development
Test Driven DevelopmentTest Driven Development
Test Driven Developmentdcsunu
 
Putting the D&D in TDD
Putting the D&D in TDDPutting the D&D in TDD
Putting the D&D in TDDGuy Royse
 
Bdd agile requirements
Bdd agile requirementsBdd agile requirements
Bdd agile requirementsAgile Vietnam
 
Run your project like it's an OpenSource project
Run your project like it's an OpenSource projectRun your project like it's an OpenSource project
Run your project like it's an OpenSource projectIan Bull
 
Javascript Tests with Jasmine for Front-end Devs
Javascript Tests with Jasmine for Front-end DevsJavascript Tests with Jasmine for Front-end Devs
Javascript Tests with Jasmine for Front-end DevsChris Powers
 
Being Good Developer
Being Good DeveloperBeing Good Developer
Being Good DeveloperSally Ahmed
 

Tendances (20)

Behavior-Driven Design: One Team's Exploration
Behavior-Driven Design: One Team's ExplorationBehavior-Driven Design: One Team's Exploration
Behavior-Driven Design: One Team's Exploration
 
Introduction to Bdd and cucumber
Introduction to Bdd and cucumberIntroduction to Bdd and cucumber
Introduction to Bdd and cucumber
 
TDD, Refactoring - Workshop
TDD, Refactoring - WorkshopTDD, Refactoring - Workshop
TDD, Refactoring - Workshop
 
Jasmine
JasmineJasmine
Jasmine
 
BDD and QA - Make Yourself More Valuable
BDD and QA - Make Yourself More ValuableBDD and QA - Make Yourself More Valuable
BDD and QA - Make Yourself More Valuable
 
Peer Review Guidelines
Peer Review GuidelinesPeer Review Guidelines
Peer Review Guidelines
 
Promoting Agility with Running Tested Features - Lightening Talk
Promoting Agility with Running Tested Features - Lightening TalkPromoting Agility with Running Tested Features - Lightening Talk
Promoting Agility with Running Tested Features - Lightening Talk
 
Beter code for better tests
Beter code for better testsBeter code for better tests
Beter code for better tests
 
Inside Behavior Driven Development
Inside Behavior Driven DevelopmentInside Behavior Driven Development
Inside Behavior Driven Development
 
Zen and the Art of Test Maintenance
Zen and the Art of Test MaintenanceZen and the Art of Test Maintenance
Zen and the Art of Test Maintenance
 
Test Driven Development
Test Driven DevelopmentTest Driven Development
Test Driven Development
 
Putting the D&D in TDD
Putting the D&D in TDDPutting the D&D in TDD
Putting the D&D in TDD
 
Agile Testing
Agile TestingAgile Testing
Agile Testing
 
Bdd agile requirements
Bdd agile requirementsBdd agile requirements
Bdd agile requirements
 
Test Driven Development
Test Driven DevelopmentTest Driven Development
Test Driven Development
 
Run your project like it's an OpenSource project
Run your project like it's an OpenSource projectRun your project like it's an OpenSource project
Run your project like it's an OpenSource project
 
TDD In Practice
TDD In PracticeTDD In Practice
TDD In Practice
 
Javascript Tests with Jasmine for Front-end Devs
Javascript Tests with Jasmine for Front-end DevsJavascript Tests with Jasmine for Front-end Devs
Javascript Tests with Jasmine for Front-end Devs
 
Being Good Developer
Being Good DeveloperBeing Good Developer
Being Good Developer
 
Cucumber & gherkin language
Cucumber & gherkin languageCucumber & gherkin language
Cucumber & gherkin language
 

En vedette

Introduction to Behaviour Driven Development
Introduction to Behaviour Driven DevelopmentIntroduction to Behaviour Driven Development
Introduction to Behaviour Driven DevelopmentChristophe Achouiantz
 
Behaviour-Driven Development
Behaviour-Driven DevelopmentBehaviour-Driven Development
Behaviour-Driven DevelopmentKerry Buckley
 
Implementing BDD at scale for agile and DevOps teams
Implementing BDD at scale for agile and DevOps teamsImplementing BDD at scale for agile and DevOps teams
Implementing BDD at scale for agile and DevOps teamsLaurent PY
 
Software testing
Software testingSoftware testing
Software testingBala Ganesh
 
Anand Bagmar - Behavior Driven Testing (BDT) in Agile
Anand Bagmar - Behavior Driven Testing (BDT) in AgileAnand Bagmar - Behavior Driven Testing (BDT) in Agile
Anand Bagmar - Behavior Driven Testing (BDT) in AgileAnand Bagmar
 
Inverting The Testing Pyramid
Inverting The Testing PyramidInverting The Testing Pyramid
Inverting The Testing PyramidNaresh Jain
 
Behavior Driven Development (BDD) and Agile Testing
Behavior Driven Development (BDD) and Agile TestingBehavior Driven Development (BDD) and Agile Testing
Behavior Driven Development (BDD) and Agile Testingdversaci
 
Behavior Driven Development Pros and Cons
Behavior Driven Development Pros and ConsBehavior Driven Development Pros and Cons
Behavior Driven Development Pros and ConsIosif Itkin
 
Test and Behaviour Driven Development (TDD/BDD)
Test and Behaviour Driven Development (TDD/BDD)Test and Behaviour Driven Development (TDD/BDD)
Test and Behaviour Driven Development (TDD/BDD)Lars Thorup
 
BDD with JBehave and Selenium
BDD with JBehave and SeleniumBDD with JBehave and Selenium
BDD with JBehave and SeleniumNikolay Vasilev
 
Agile Testing Framework - The Art of Automated Testing
Agile Testing Framework - The Art of Automated TestingAgile Testing Framework - The Art of Automated Testing
Agile Testing Framework - The Art of Automated TestingDimitri Ponomareff
 
Test Automation Strategies For Agile
Test Automation Strategies For AgileTest Automation Strategies For Agile
Test Automation Strategies For AgileNaresh Jain
 

En vedette (13)

Introduction to Behaviour Driven Development
Introduction to Behaviour Driven DevelopmentIntroduction to Behaviour Driven Development
Introduction to Behaviour Driven Development
 
Behaviour-Driven Development
Behaviour-Driven DevelopmentBehaviour-Driven Development
Behaviour-Driven Development
 
Implementing BDD at scale for agile and DevOps teams
Implementing BDD at scale for agile and DevOps teamsImplementing BDD at scale for agile and DevOps teams
Implementing BDD at scale for agile and DevOps teams
 
Software testing
Software testingSoftware testing
Software testing
 
Anand Bagmar - Behavior Driven Testing (BDT) in Agile
Anand Bagmar - Behavior Driven Testing (BDT) in AgileAnand Bagmar - Behavior Driven Testing (BDT) in Agile
Anand Bagmar - Behavior Driven Testing (BDT) in Agile
 
BDD using JBehave
BDD using JBehaveBDD using JBehave
BDD using JBehave
 
Inverting The Testing Pyramid
Inverting The Testing PyramidInverting The Testing Pyramid
Inverting The Testing Pyramid
 
Behavior Driven Development (BDD) and Agile Testing
Behavior Driven Development (BDD) and Agile TestingBehavior Driven Development (BDD) and Agile Testing
Behavior Driven Development (BDD) and Agile Testing
 
Behavior Driven Development Pros and Cons
Behavior Driven Development Pros and ConsBehavior Driven Development Pros and Cons
Behavior Driven Development Pros and Cons
 
Test and Behaviour Driven Development (TDD/BDD)
Test and Behaviour Driven Development (TDD/BDD)Test and Behaviour Driven Development (TDD/BDD)
Test and Behaviour Driven Development (TDD/BDD)
 
BDD with JBehave and Selenium
BDD with JBehave and SeleniumBDD with JBehave and Selenium
BDD with JBehave and Selenium
 
Agile Testing Framework - The Art of Automated Testing
Agile Testing Framework - The Art of Automated TestingAgile Testing Framework - The Art of Automated Testing
Agile Testing Framework - The Art of Automated Testing
 
Test Automation Strategies For Agile
Test Automation Strategies For AgileTest Automation Strategies For Agile
Test Automation Strategies For Agile
 

Similaire à Bahaviour Driven Development

Prashant technical practices-tdd for xebia event
Prashant   technical practices-tdd for xebia eventPrashant   technical practices-tdd for xebia event
Prashant technical practices-tdd for xebia eventXebia India
 
Joe Cisar - Everything I Know About TDD - Agile Midwest 2019
Joe Cisar - Everything I Know About TDD - Agile Midwest 2019Joe Cisar - Everything I Know About TDD - Agile Midwest 2019
Joe Cisar - Everything I Know About TDD - Agile Midwest 2019Jason Tice
 
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 DevelopmentPankaj Nakhat
 
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 WorldSmartBear
 
Acceptance Test Driven Development and Robot Framework
Acceptance Test Driven Development and Robot FrameworkAcceptance Test Driven Development and Robot Framework
Acceptance Test Driven Development and Robot FrameworkSteve Zhang
 
Becoming a better programmer - unit testing
Becoming a better programmer - unit testingBecoming a better programmer - unit testing
Becoming a better programmer - unit testingDuy Tan Geek
 
Mastering BDD - Eran Kinsbruner Workshop Quest 2018
Mastering BDD - Eran Kinsbruner Workshop Quest 2018Mastering BDD - Eran Kinsbruner Workshop Quest 2018
Mastering BDD - Eran Kinsbruner Workshop Quest 2018Perfecto Mobile
 
{10.0} Test Driven Development.pptx
{10.0} Test Driven Development.pptx{10.0} Test Driven Development.pptx
{10.0} Test Driven Development.pptxAmalEldhose2
 
Test Driven Development using QUnit
Test Driven Development using QUnitTest Driven Development using QUnit
Test Driven Development using QUnitsatejsahu
 
TDD - Seriously, try it! (updated '22)
TDD - Seriously, try it! (updated '22)TDD - Seriously, try it! (updated '22)
TDD - Seriously, try it! (updated '22)Nacho Cougil
 
Test Driven Development Methodology and Philosophy
Test Driven Development Methodology and Philosophy Test Driven Development Methodology and Philosophy
Test Driven Development Methodology and Philosophy Vijay Kumbhar
 
Android tdd
Android tddAndroid tdd
Android tddNhan Cao
 
Creating change from within - Agile Practitioners 2012
Creating change from within - Agile Practitioners 2012Creating change from within - Agile Practitioners 2012
Creating change from within - Agile Practitioners 2012Dror Helper
 
Driving application development through behavior driven development
Driving application development through behavior driven developmentDriving application development through behavior driven development
Driving application development through behavior driven developmentEinar Ingebrigtsen
 
An Introduction To Software Development - Final Review
An Introduction To Software Development - Final ReviewAn Introduction To Software Development - Final Review
An Introduction To Software Development - Final ReviewBlue Elephant Consulting
 
Lean-Agile Development with SharePoint - Bill Ayers
Lean-Agile Development with SharePoint - Bill AyersLean-Agile Development with SharePoint - Bill Ayers
Lean-Agile Development with SharePoint - Bill AyersSPC Adriatics
 

Similaire à Bahaviour Driven Development (20)

Tdd and bdd
Tdd and bddTdd and bdd
Tdd and bdd
 
Prashant technical practices-tdd for xebia event
Prashant   technical practices-tdd for xebia eventPrashant   technical practices-tdd for xebia event
Prashant technical practices-tdd for xebia event
 
Bdd in action
Bdd in actionBdd in action
Bdd in action
 
Joe Cisar - Everything I Know About TDD - Agile Midwest 2019
Joe Cisar - Everything I Know About TDD - Agile Midwest 2019Joe Cisar - Everything I Know About TDD - Agile Midwest 2019
Joe Cisar - Everything I Know About TDD - Agile Midwest 2019
 
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
 
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
 
Acceptance Test Driven Development and Robot Framework
Acceptance Test Driven Development and Robot FrameworkAcceptance Test Driven Development and Robot Framework
Acceptance Test Driven Development and Robot Framework
 
TDD in Agile
TDD in AgileTDD in Agile
TDD in Agile
 
Becoming a better programmer - unit testing
Becoming a better programmer - unit testingBecoming a better programmer - unit testing
Becoming a better programmer - unit testing
 
Mastering BDD - Eran Kinsbruner Workshop Quest 2018
Mastering BDD - Eran Kinsbruner Workshop Quest 2018Mastering BDD - Eran Kinsbruner Workshop Quest 2018
Mastering BDD - Eran Kinsbruner Workshop Quest 2018
 
{10.0} Test Driven Development.pptx
{10.0} Test Driven Development.pptx{10.0} Test Driven Development.pptx
{10.0} Test Driven Development.pptx
 
Test Driven Development using QUnit
Test Driven Development using QUnitTest Driven Development using QUnit
Test Driven Development using QUnit
 
TDD - Seriously, try it! (updated '22)
TDD - Seriously, try it! (updated '22)TDD - Seriously, try it! (updated '22)
TDD - Seriously, try it! (updated '22)
 
Test Driven Development Methodology and Philosophy
Test Driven Development Methodology and Philosophy Test Driven Development Methodology and Philosophy
Test Driven Development Methodology and Philosophy
 
Android tdd
Android tddAndroid tdd
Android tdd
 
Creating change from within - Agile Practitioners 2012
Creating change from within - Agile Practitioners 2012Creating change from within - Agile Practitioners 2012
Creating change from within - Agile Practitioners 2012
 
Driving application development through behavior driven development
Driving application development through behavior driven developmentDriving application development through behavior driven development
Driving application development through behavior driven development
 
An Introduction To Software Development - Final Review
An Introduction To Software Development - Final ReviewAn Introduction To Software Development - Final Review
An Introduction To Software Development - Final Review
 
Lean-Agile Development with SharePoint - Bill Ayers
Lean-Agile Development with SharePoint - Bill AyersLean-Agile Development with SharePoint - Bill Ayers
Lean-Agile Development with SharePoint - Bill Ayers
 
Methodology: IT test
Methodology: IT testMethodology: IT test
Methodology: IT test
 

Plus de buildmaster

DevOps is Dead. Long live devops
DevOps is Dead. Long live devopsDevOps is Dead. Long live devops
DevOps is Dead. Long live devopsbuildmaster
 
API Days: For the Love of Small
API Days: For the Love of SmallAPI Days: For the Love of Small
API Days: For the Love of Smallbuildmaster
 
MEFilicious Applications
MEFilicious ApplicationsMEFilicious Applications
MEFilicious Applicationsbuildmaster
 
ASP.net MVC CodeCamp Presentation
ASP.net MVC CodeCamp PresentationASP.net MVC CodeCamp Presentation
ASP.net MVC CodeCamp Presentationbuildmaster
 

Plus de buildmaster (7)

DevOps is Dead. Long live devops
DevOps is Dead. Long live devopsDevOps is Dead. Long live devops
DevOps is Dead. Long live devops
 
API Days: For the Love of Small
API Days: For the Love of SmallAPI Days: For the Love of Small
API Days: For the Love of Small
 
MEFilicious Applications
MEFilicious ApplicationsMEFilicious Applications
MEFilicious Applications
 
Linq Refresher
Linq RefresherLinq Refresher
Linq Refresher
 
Oslo
OsloOslo
Oslo
 
ASP.net MVC CodeCamp Presentation
ASP.net MVC CodeCamp PresentationASP.net MVC CodeCamp Presentation
ASP.net MVC CodeCamp Presentation
 
Mocking 101
Mocking 101Mocking 101
Mocking 101
 

Dernier

The Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdf
The Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdfThe Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdf
The Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdfEnterprise Knowledge
 
Swan(sea) Song – personal research during my six years at Swansea ... and bey...
Swan(sea) Song – personal research during my six years at Swansea ... and bey...Swan(sea) Song – personal research during my six years at Swansea ... and bey...
Swan(sea) Song – personal research during my six years at Swansea ... and bey...Alan Dix
 
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
 
Transforming Data Streams with Kafka Connect: An Introduction to Single Messa...
Transforming Data Streams with Kafka Connect: An Introduction to Single Messa...Transforming Data Streams with Kafka Connect: An Introduction to Single Messa...
Transforming Data Streams with Kafka Connect: An Introduction to Single Messa...HostedbyConfluent
 
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 WorkerThousandEyes
 
Enhancing Worker Digital Experience: A Hands-on Workshop for Partners
Enhancing Worker Digital Experience: A Hands-on Workshop for PartnersEnhancing Worker Digital Experience: A Hands-on Workshop for Partners
Enhancing Worker Digital Experience: A Hands-on Workshop for PartnersThousandEyes
 
Tech-Forward - Achieving Business Readiness For Copilot in Microsoft 365
Tech-Forward - Achieving Business Readiness For Copilot in Microsoft 365Tech-Forward - Achieving Business Readiness For Copilot in Microsoft 365
Tech-Forward - Achieving Business Readiness For Copilot in Microsoft 3652toLead Limited
 
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
 
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
 
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 AutomationSafe Software
 
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 textsMaria Levchenko
 
Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...
Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...
Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...Igalia
 
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
 
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
 
My Hashitalk Indonesia April 2024 Presentation
My Hashitalk Indonesia April 2024 PresentationMy Hashitalk Indonesia April 2024 Presentation
My Hashitalk Indonesia April 2024 PresentationRidwan Fadjar
 
Google AI Hackathon: LLM based Evaluator for RAG
Google AI Hackathon: LLM based Evaluator for RAGGoogle AI Hackathon: LLM based Evaluator for RAG
Google AI Hackathon: LLM based Evaluator for RAGSujit Pal
 
Understanding the Laravel MVC Architecture
Understanding the Laravel MVC ArchitectureUnderstanding the Laravel MVC Architecture
Understanding the Laravel MVC ArchitecturePixlogix Infotech
 
WhatsApp 9892124323 ✓Call Girls In Kalyan ( Mumbai ) secure service
WhatsApp 9892124323 ✓Call Girls In Kalyan ( Mumbai ) secure serviceWhatsApp 9892124323 ✓Call Girls In Kalyan ( Mumbai ) secure service
WhatsApp 9892124323 ✓Call Girls In Kalyan ( Mumbai ) secure servicePooja Nehwal
 

Dernier (20)

The Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdf
The Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdfThe Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdf
The Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdf
 
Swan(sea) Song – personal research during my six years at Swansea ... and bey...
Swan(sea) Song – personal research during my six years at Swansea ... and bey...Swan(sea) Song – personal research during my six years at Swansea ... and bey...
Swan(sea) Song – personal research during my six years at Swansea ... and bey...
 
Finology Group – Insurtech Innovation Award 2024
Finology Group – Insurtech Innovation Award 2024Finology Group – Insurtech Innovation Award 2024
Finology Group – Insurtech Innovation Award 2024
 
Transforming Data Streams with Kafka Connect: An Introduction to Single Messa...
Transforming Data Streams with Kafka Connect: An Introduction to Single Messa...Transforming Data Streams with Kafka Connect: An Introduction to Single Messa...
Transforming Data Streams with Kafka Connect: An Introduction to Single Messa...
 
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
 
Enhancing Worker Digital Experience: A Hands-on Workshop for Partners
Enhancing Worker Digital Experience: A Hands-on Workshop for PartnersEnhancing Worker Digital Experience: A Hands-on Workshop for Partners
Enhancing Worker Digital Experience: A Hands-on Workshop for Partners
 
Tech-Forward - Achieving Business Readiness For Copilot in Microsoft 365
Tech-Forward - Achieving Business Readiness For Copilot in Microsoft 365Tech-Forward - Achieving Business Readiness For Copilot in Microsoft 365
Tech-Forward - Achieving Business Readiness For Copilot in Microsoft 365
 
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...
 
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...
 
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
 
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
 
Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...
Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...
Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...
 
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
 
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
 
My Hashitalk Indonesia April 2024 Presentation
My Hashitalk Indonesia April 2024 PresentationMy Hashitalk Indonesia April 2024 Presentation
My Hashitalk Indonesia April 2024 Presentation
 
Google AI Hackathon: LLM based Evaluator for RAG
Google AI Hackathon: LLM based Evaluator for RAGGoogle AI Hackathon: LLM based Evaluator for RAG
Google AI Hackathon: LLM based Evaluator for RAG
 
Understanding the Laravel MVC Architecture
Understanding the Laravel MVC ArchitectureUnderstanding the Laravel MVC Architecture
Understanding the Laravel MVC Architecture
 
WhatsApp 9892124323 ✓Call Girls In Kalyan ( Mumbai ) secure service
WhatsApp 9892124323 ✓Call Girls In Kalyan ( Mumbai ) secure serviceWhatsApp 9892124323 ✓Call Girls In Kalyan ( Mumbai ) secure service
WhatsApp 9892124323 ✓Call Girls In Kalyan ( Mumbai ) secure service
 

Bahaviour Driven Development

  • 1. Behaviour Driven Development owen evans, xero.com developer http://bgeek.net @buildmaster
  • 2. Behaviour Driven Development • What is BDD? • A rethinking and repurposing of existing methodologies • A second generation Agile Technique • A companion to other techniques such as TDD and XP
  • 3. A Combination of Disciplines • TDD • Test first methodology • But a focus on value • Defining value up front • XP/Scrum/<Insert ‘Agile’ methodology here> • Close communication with all stakeholders • Common language definition to aid communication
  • 4. A Focus On Value • TDD says only one thing: Test First • Tests alone do not drive value • Tests are not deliverables • Tests can be crap • BDD says: only do what needs to be done (and test first)
  • 5. What needs to be done? • Test driven specification/Acceptance Test Driven Design • All systems can be defined by their behaviour [says BDD] • The behaviour is what makes a system usable/crap • We can use required behaviour to drive development
  • 7. Example: STEP ONE THE Feature Feature As a Cake Lover I want to be able to turn on my Acme Cake Maker So that I can start making great cakes
  • 8. The Feature • Broken into three elements: • the actor (Cake Lover) • the action (turn on cake maker) • the motivation (want to start making cakes)
  • 9. Why? • The actor gives us a stakeholder, this is who we’re providing value to • The action allows us to drive functionality • The motivation allows us to tell when we’re done
  • 10. Example part 2: The Scenario(s) Scenario Given there the cake maker is not switched on When I press the “on” button Then the machine should say “welcome to the Acme Cake Maker” And the machine should ask me which cake type I want to make
  • 11. Scenarios • Scenarios are always 1st person • We want to design in terms of the stakeholder • We want to see that we are providing them value
  • 12. What does this give us? • BDD has three main tenants: • Enough is Enough • Just do what’s needed no more • Deliver Stakeholder Value • Everything we do should be tracable to value to a stakeholder • It’s All Behaviour • We can alwys describe code in terms of it’s behaviours
  • 13. Remember • A stakeholder isn’t necessarily a human • it can be a company goal • it can be required API’s • it can be other developers (ok they might be human) • Stakeholder ≠ customer
  • 14. Great... WTF? • How do we apply this • BDD has inspired many tools
  • 16. FitNesse Granddaddy of Acceptance Testing Tools. A wiki formed around Ward Cunningham’s Framework for Integrated Testing (FIT)
  • 17. • Pros: • Language agnostic (runners for most major languages) • Wiki Syntax is easy to learn and use • Cons: • Doesn’t support BDD syntax easily/natively • Fit style tests can be quite cumbersome when setting up complex objects
  • 18. Story Q Nunit Based Runner for Stories
  • 19. Story Q • Pros: • native c# • native support for BDD • quick integration with testing tools • Cons • Code based (only output is stakeholder readable) • Syntax can be hard
  • 20. Cucumber A Ruby BDD Specification Runner Part of the RSpec Ruby Testing Framework
  • 21. • Pros: • Feature rich • Native support for BDD syntax • Plain text runner (sharable specifications) • Cons: • Ruby only
  • 23. • Keep to your framework of choice • Xunit.net • Nunit • MBUnit • also many frameworks to help use a more BDD syntax • NBehave, NSpecify, Machine.Specifications
  • 24. How does this all fit together • Concentric feedback circles: • Step 1 write the acceptance test(s) using Given When Then syntax • Step 2: Make sure they fail (red-green-refactor cycle) • Step 3: Write unit test on first part of code (this is just TDD), and make sure it fails • Step 4: Make test pass, does Acceptance test pass? • Yes go to step 1, No go to step 3
  • 25. In Pictures Focus on one scenario 1. Write Failing step definition drop into unit tests 2. Write failing unit test 3. Get the test to pass 4. Refactor 5. Once Acceptance Test Step is passing 6. Refactor 7. Repeat 2-6 till acceptance test is complete and passes Write next acceptance test
  • 26. Take aways • BDD is not about tooling • BDD focuses on three tenants • Enough is Enough • Always deliver value • Everything can be expressed as behaviour • BDD is only part of the arsenal
  • 27. Great resources • Cucumber and RSpec are thought leading frameworks so read the RSpec Book • http://www.pragprog.com/titles/ achbd/the-rspec-book • BDD mailing list • http://groups.google.com/group/ behaviordrivendevelopment
  • 28. FIN me: owen@bgeek.net Twitter: @Buildmaster Blog: http://bgeek.net