1 / 23

Code Camp NZ 2011

Code Camp NZ 2011. # CCNZ. www.mscommunities.co.nz. About. Agile Coach Manager Methods & Practices Aucklan d DNUG @ Scrumdod Scrumdod.blogspot.com http://www.scrum.org. BDD Overview. What is Behaviour Driven Development? Where did it come from? How did it evolve?

mervyn
Download Presentation

Code Camp NZ 2011

An Image/Link below is provided (as is) to download presentation Download Policy: Content on the Website is provided to you AS IS for your information and personal use and may not be sold / licensed / shared on other websites without getting consent from its author. Content is provided to you AS IS for your information and personal use only. Download presentation by click this link. While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server. During download, if you can't get a presentation, the file might be deleted by the publisher.

E N D

Presentation Transcript


  1. Code Camp NZ 2011 #CCNZ www.mscommunities.co.nz

  2. About • Agile Coach • Manager Methods & Practices • Auckland DNUG • @Scrumdod • Scrumdod.blogspot.com • http://www.scrum.org

  3. BDD Overview • What is Behaviour Driven Development? • Where did it come from? • How did it evolve? • What tools / frameworks are available? • How do we integrate BDD into our ALM environment?

  4. Founder – Dan North • 2006 ish • http://DanNorth.net • http://dannorth.net/introducing-bdd BDD is a second-generation, outside-in, pull-based, multiple-stakeholder, multiple-scale, high-automation, agile methodology. It describes a cycle of interactions with well-defined outputs, resulting in the delivery of working, tested software that matters. – Dan North 2009

  5. Why? • Communication • Outside In – outputs are the only value • TDD Problems

  6. BDD – In the beginning • Tests should output sentences CustomerLookup - finds customer by id - fails for duplicate customers • ... • Output made sense to more than just developers

  7. BDD • Test Methods start with “Should” • This class should do something • Can only define a test for the current class

  8. BDD • An expressive test name is helpful when a test fails • Who has seen this? TestEngineModelFactoryShouldReturn_ZeroValueForIncorrectChecksum

  9. BDD • “Behaviour” is a more useful word than “test”

  10. BDD • Determine the next most important behaviour

  11. BDD • Requirements are behaviour, too • DDD – ubiquitous language

  12. BDD • BDD provides a “ubiquitous language” for analysis • Given When Then, works at many levels As a customer,I want to withdraw cash from an ATM,so that I don’t have to wait in line at the bank. Scenario 1: Account is in creditGiven the Account is in creditAnd the Card is validAnd the Dispenser contains CashWhen the Customer requests CashThen ensure the Account is debitedAnd ensure Cash is dispensedAnd ensure the Card is returned

  13. BDD • Acceptance criteria should be executable public class AccountIsInCredit :Given { public void setup(World world) { ... } } public class CardIsValid :Given { public void setup(World world) {...} } and one for the event: public class CustomerRequestsCash :Event { public void occurIn(World world) { ... } }

  14. BDD • Context Specification / Alternative to GWT As a customer,I want to withdraw cash from an ATM,so that I don’t have to wait in line at the bank. Scenario 1: Account is in creditWhenthe customer requests cash from an account that is in creditIt Should ensure the account is debited

  15. Tools • JBehave -> RBehave -> RSpec -> Cucumber • MSpec • StoryQ • SpecFlow • …

  16. MSpec • Uses Context Specification • Lambdas (love or hate) - = () => • Can output a html report • Cannot use MSTest • Inheritance

  17. StoryQ • Uses Given When Then • Very strict format required • Html output format • One way requirement translation • Parser not runner

  18. SpecFlow • VS Add in • Feature files • Regex • Parser

  19. What about TDD? • Does this replace TDD?

  20. Summary • BDD is about conversations not tools • Can be integrated with ALM process • Works at many levels • Call to action

  21. Questions?

  22. Thanks to our sponsorsand partners! Sponsor Premier Partners Associated Partners Supporting Partners

More Related