0
Behavior Driven Testing (BDT)         Anand Bagmar      Software Quality Evangelist           ThoughtWorks
Case Study             • Multiple, long               running projects             • Legacy               applications    ...
Testing Challenges• No Automation - Long regression cycle• Mini-Waterfall• Huge cost of fixing defects
•   No visibility into what is tested•   Outdated tests in QC•   Brittle•   Little / less value•   Maintenance nightmare
• Remove the ambiguity• Same visibility for all  roles on the team
Evolution of Test Frameworks             Behavior              Driven           Development              (BDD)          Op...
Behavior Driven Development                 (BDD)• Specify the behavior looking at the system  from the outside.• Collabor...
Behavior Driven Development                 (BDD)• BDD is an extension of TDD  – primarily a development practice• Develop...
Expected Functionality:The customer should be able to withdrawmoney from his accountGiven the account has balance of INR 5...
Behavior Driven Testing                 (BDT)• It is an approach to testing• Work towards the big picture
Given the account is in creditAnd the dispenser contains cashWhen the customer requests cashThen ensure the account is deb...
New Expected Functionality:The customer should be able to withdrawmoney from his account only if his card isvalid
Given the account is in creditAnd the card is validAnd the dispenser contains cashWhen the customer requests cashThen ensu...
Imperative ScenarioReference: http://watirmelon.com/2010/12/10/cucumber-imperative-or-declarative-that-is-the-question/
Declarative ScenarioReference: http://watirmelon.com/2010/12/10/cucumber-imperative-or-declarative-that-is-the-question/
What does this do for me?• Identify the different user flows / behaviors  for the product• Determine how the functionality...
What does this do for me?• Provide visibility• Automate the right set of tests• Make your testing efforts more effective
How did we accomplish this?
Who is doing the action?What is the business functionality?Actions and verifications / assertionshappen implicitlyLong run...
Current stateTestes running on Hudson / Jenkins   Since 1st test was automatedFeature files                        33Scena...
Its not what Isaid, its what I     mean!
Are you doing BDD or BDT?Pattern                                         Testing TypeThe QA team does Test Automation alon...
Tools to enable BDD / BDT•   Cucumber•   JBehave•   SpecFlow•   Twist
Anand.Bagmar@thoughtworks.com     abagmar@gmail.com
Anand Bagmar - Behavior Driven Testing (BDT)
Anand Bagmar - Behavior Driven Testing (BDT)
Anand Bagmar - Behavior Driven Testing (BDT)
Anand Bagmar - Behavior Driven Testing (BDT)
Anand Bagmar - Behavior Driven Testing (BDT)
Anand Bagmar - Behavior Driven Testing (BDT)
Upcoming SlideShare
Loading in...5
×

Anand Bagmar - Behavior Driven Testing (BDT)

7,891

Published on

What is Behavior Driven Testing (BDT)? How does it differ from Behavior Driven Development? What tools support this kind of testing? The value proposition BDT offers. - Anand Bagmar

Published in: Technology

Transcript of "Anand Bagmar - Behavior Driven Testing (BDT)"

  1. 1. Behavior Driven Testing (BDT) Anand Bagmar Software Quality Evangelist ThoughtWorks
  2. 2. Case Study • Multiple, long running projects • Legacy applications • Integrated
  3. 3. Testing Challenges• No Automation - Long regression cycle• Mini-Waterfall• Huge cost of fixing defects
  4. 4. • No visibility into what is tested• Outdated tests in QC• Brittle• Little / less value• Maintenance nightmare
  5. 5. • Remove the ambiguity• Same visibility for all roles on the team
  6. 6. Evolution of Test Frameworks Behavior Driven Development (BDD) Optimized scripts Record & Playback Core Framework
  7. 7. Behavior Driven Development (BDD)• Specify the behavior looking at the system from the outside.• Collaborate and come up with a good and clear set of Acceptance Criteria
  8. 8. Behavior Driven Development (BDD)• BDD is an extension of TDD – primarily a development practice• Developers translate the Acceptance Criteria into product functionality
  9. 9. Expected Functionality:The customer should be able to withdrawmoney from his accountGiven the account has balance of INR 5000When the customer requests INR 1000Then the account is debited by INR 1000
  10. 10. Behavior Driven Testing (BDT)• It is an approach to testing• Work towards the big picture
  11. 11. Given the account is in creditAnd the dispenser contains cashWhen the customer requests cashThen ensure the account is debitedAnd ensure cash is dispensedAnd ensure the card is returned
  12. 12. New Expected Functionality:The customer should be able to withdrawmoney from his account only if his card isvalid
  13. 13. Given 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
  14. 14. Imperative ScenarioReference: http://watirmelon.com/2010/12/10/cucumber-imperative-or-declarative-that-is-the-question/
  15. 15. Declarative ScenarioReference: http://watirmelon.com/2010/12/10/cucumber-imperative-or-declarative-that-is-the-question/
  16. 16. What does this do for me?• Identify the different user flows / behaviors for the product• Determine how the functionality under test affects / impacts the above user flows• Incrementally build up your user flows
  17. 17. What does this do for me?• Provide visibility• Automate the right set of tests• Make your testing efforts more effective
  18. 18. How did we accomplish this?
  19. 19. Who is doing the action?What is the business functionality?Actions and verifications / assertionshappen implicitlyLong running tests
  20. 20. Current stateTestes running on Hudson / Jenkins Since 1st test was automatedFeature files 33Scenarios 65Smoke tests execution time 15 minutesRegression tests execution time 45 minutesTest case repository (manual + Cucumber .feature files withautomated) appropriate taggingProject Management tool Mingle
  21. 21. Its not what Isaid, its what I mean!
  22. 22. Are you doing BDD or BDT?Pattern Testing TypeThe QA team does Test Automation along with BDTother testing responsibilities.The QA team focuses on defining acceptance BDDcriteria, doing manual / ad-hoc / exploratorytesting, etc. and the development team itselfwill do Functional Test Automation.The QA team focuses on defining acceptance BDD + BDTcriteria, doing manual / ad-hoc / exploratorytesting, etc. and pairs with the developmentteam to do Functional Test Automation.
  23. 23. Tools to enable BDD / BDT• Cucumber• JBehave• SpecFlow• Twist
  24. 24. Anand.Bagmar@thoughtworks.com abagmar@gmail.com
  1. A particular slide catching your eye?

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

×