Your SlideShare is downloading. ×
0
Behavior Driven Development              From The Trenches
Lee BrandtIndependent Consultant15 Years ProgrammingEarly .NET BetasTDD / BDD Enthusiast                     KS | MO    In...
DISCLAIMERS• My opinions are mine, no one else’s. – If you don’t like what you hear, blame me.• My opinions are my opinion...
Don’t we already have TEST Driven Development?
The Intention
What actually happened.
Test Fixture   Class
TDD Comes Up Short
TDD Comes Up Short   not the intent
TDD Comes Up Short    not the intentthe language misleads
TDD Comes Up Short    not the intentthe language misleads  not about testing
BDD
BDD is NOT something new
BDD is a shift in TDD language that helps guide you   to do TDD the way it was meant to be done.
3 for $12
UBIQUITOUS LANGUAGE    (User Voice)
DDD   TDD
BDD DDD   TDD
Two Types of BDD• Story-Based (Concentric Circle) – Outside Circle => JBehave, SpecFlow,   Cucumber – Inside Circle => NSp...
Questions and Techniques• Implicit Requirements – Garage Example   • Foundation   • Electrician   • Building Permit   • In...
Scrum, Kanban & XP OH MY!User Stories• Role – Goal – Motivation• As a [Role] I need to [Goal] so that [Motivation]• As an ...
Given I have an inventory of Parts  When loading the part search pageThen I should see an empty search form
User Interface   Web Interface      Windows Interface                        User Interface Layer                         ...
.Net Frameworks• SpecUnit.Net  – Scott Bellware• MSpec  – Part of MultiFunctionMachineMachine  – Aaron Jensen & Jacob Lewa...
PeopleDan North          Liz KeoghDave Astels        Scott BellwareAaron Jensen       Jacob LewallenJimmy Bogard       Joe...
Thank YouPapers• http://behaviour-driven.org• http://dannorth.net/introducing-bdd/Videos• http://domaindrivendesign.org/ev...
Behavior Driven Development
Behavior Driven Development
Upcoming SlideShare
Loading in...5
×

Behavior Driven Development

284

Published on

Presentation from HDC12 BDD class.

Published in: Technology
0 Comments
0 Likes
Statistics
Notes
  • Be the first to comment

  • Be the first to like this

No Downloads
Views
Total Views
284
On Slideshare
0
From Embeds
0
Number of Embeds
1
Actions
Shares
0
Downloads
7
Comments
0
Likes
0
Embeds 0
No embeds

No notes for slide
  • \n
  • \n
  • \n
  • \n
  • In the beginning… there were Unit Tests\nDone afterward\nFirst thing to get cut when budget/deadline imposed\nThen I started doing TDD\nI wrote my tests BEFORE I wrote the code\nHadn’t done enough Unit Testing to be overly tainted (should thank those budget/deadline constraints)\nSaw vast improvements in the modularity of my code\nThought I was getting the max benefit from TDD\nWRONG!\n
  • People (including myself) took those unit tests that they wrote after they wrote the code,\nAnd wrote those same tests before writing each code unit.\nPeople (me too) got confused about how to test a unit that doesn’t exist.\nWhere to begin?\n
  • \n
  • Using TDD, a lot of people ended up using the anti-pattern of a fixture per class and 1-n Tests per method\nStructure of the test code matches the structure of your production code.\n
  • \n
  • \n
  • \n
  • Dan North – Coined the term\nThinking about why it is so hard to teach TDD\n
  • Help Drive DEVELOPMENT\nWrite a TEST that expresses what you want the code to DO\nTHEN write code to make your application do that\nHAPPY COINCIDENCE: The original test is left behind to ensure that your application always can do everything it should do\n
  • \n
  • \n
  • Story about Trading Credit Derivatives\nPerturb an interest rate curve and calculate the value of a Collateral Debt Obligation (CDO)\n
  • DDD and BDD are MASSIVELY complimentary\nDDD gives you the vocabulary\nBDD are sentences that you make with those words\n
  • DDD and BDD are MASSIVELY complimentary\nDDD gives you the vocabulary\nBDD are sentences that you make with those words\n
  • DDD and BDD are MASSIVELY complimentary\nDDD gives you the vocabulary\nBDD are sentences that you make with those words\n
  • \n
  • \n
  • \n
  • \n
  • \n
  • User interface testing should still be done external to BDD\nBDD is done to DRIVE DEVELOPMENT and leaves a trail of UNIT tests behind as a happy coincidence\n
  • Some frameworks that can help you get focused on BDD and away from the test-centric language of unit-testing frameworks\n
  • Some of the people to look for when looking for good BDD information\n
  • \n
  • \n
  • Transcript of "Behavior Driven Development"

    1. 1. Behavior Driven Development From The Trenches
    2. 2. Lee BrandtIndependent Consultant15 Years ProgrammingEarly .NET BetasTDD / BDD Enthusiast KS | MO Insiders Speaker Program www.telerik.com/community/insiders leebrandt@gmail.com @leebrandt http://disruptivetheory.com
    3. 3. DISCLAIMERS• My opinions are mine, no one else’s. – If you don’t like what you hear, blame me.• My opinions are my opinions as of TODAY. – And are based on what I know TODAY.• I am not Hoyle – This is not “THE” way to do BDD.
    4. 4. Don’t we already have TEST Driven Development?
    5. 5. The Intention
    6. 6. What actually happened.
    7. 7. Test Fixture Class
    8. 8. TDD Comes Up Short
    9. 9. TDD Comes Up Short not the intent
    10. 10. TDD Comes Up Short not the intentthe language misleads
    11. 11. TDD Comes Up Short not the intentthe language misleads not about testing
    12. 12. BDD
    13. 13. BDD is NOT something new
    14. 14. BDD is a shift in TDD language that helps guide you to do TDD the way it was meant to be done.
    15. 15. 3 for $12
    16. 16. UBIQUITOUS LANGUAGE (User Voice)
    17. 17. DDD TDD
    18. 18. BDD DDD TDD
    19. 19. Two Types of BDD• Story-Based (Concentric Circle) – Outside Circle => JBehave, SpecFlow, Cucumber – Inside Circle => NSpec, MSpec, Rspec• Context-Specification – Outside => Interactions (Lots of Mocks)
    20. 20. Questions and Techniques• Implicit Requirements – Garage Example • Foundation • Electrician • Building Permit • Inspection• Outside-In Development – Start with the outermost layer (layer closest to the stakeholder/consumer) – Work your way down the layers – Stay in User Voice
    21. 21. Scrum, Kanban & XP OH MY!User Stories• Role – Goal – Motivation• As a [Role] I need to [Goal] so that [Motivation]• As an Account Holder I need to be able to transfer funds from my savings tomy checking so that I don’t bounce checks.Scenarios• Context – Action – Observation• Given [Context] When [Action] Then [Observation] LANGUAGE All about expressing the user’s needs and what it means to the user to have those needs filled.
    22. 22. Given I have an inventory of Parts When loading the part search pageThen I should see an empty search form
    23. 23. User Interface Web Interface Windows Interface User Interface Layer Presentation Layer Domain Objects Services Persistence
    24. 24. .Net Frameworks• SpecUnit.Net – Scott Bellware• MSpec – Part of MultiFunctionMachineMachine – Aaron Jensen & Jacob Lewallen• SpecFlow – Gherkin – Specflow.org• Nbehave – Jbehave – Joe Ocampo & Jimmy Bogard – Nbehave.org
    25. 25. PeopleDan North Liz KeoghDave Astels Scott BellwareAaron Jensen Jacob LewallenJimmy Bogard Joe OcampoDerrick Bailey Tim Haughton
    26. 26. Thank YouPapers• http://behaviour-driven.org• http://dannorth.net/introducing-bdd/Videos• http://domaindrivendesign.org/events/oopsla2007/dan_north/• http://video.google.com/videoplay?docid=8135690990081075324•http://blog.wekeroad.com/mvc-storefront/kona-3/Blogs• http://techblog.daveastels.com/• http://lizkeogh.com/• http://dannorth.net/Lee BrandtEmail: leebrandt@gmail.comTwitter: @leebrandt WWW.DISRUPTIVETHEORY.COM
    1. A particular slide catching your eye?

      Clipping is a handy way to collect important slides you want to go back to later.

    ×