Successfully reported this slideshow.

The concept of Behavior-Driven Development

4,261 views

Published on

The concept of Behavior-Driven Development

Published in: Technology, Business

The concept of Behavior-Driven Development

  1. 1. Fabian Kiss THE CONCEPT OFBEHAVIOR-DRIVEN DEVELOPMENT
  2. 2. UnitTesting
  3. 3. test-first Unit Testing
  4. 4. test-first Unit TestingTDD
  5. 5. BDD test-first Unit TestingTDD
  6. 6. BDD ?“TDD done right”
  7. 7. BDD IS NOT ABOUT TOOLS (ALTHOUGH THERE ARE TOOLS FOR BDD)
  8. 8. BDD acticespr
  9. 9. BDD acticespr maybe you already practice it (without being aware of it)
  10. 10. BDD acticespr maybe you already practice it (without being aware of it)
  11. 11. BDD acticespr awaren ess
  12. 12. SYNTACTIC CONVENTIONS method names are complete sentences public class CustomerLookupTest extends TestCase { testFindsCustomerById() { ... } testFailsForDuplicateCustomers() { ... } ... } “should” instead of “test” testShouldFailForMissingSurname testShouldFailForMissingTitle ... http://dannorth.net/introducing-bdd/
  13. 13. WHAT TO TEST?
  14. 14. WHAT TO TEST? UNITS
  15. 15. CODE COVERAGE ...Picture by PeterJBellis, licensed under the CC BY 2.0
  16. 16. … A FALSE SENSE OF SECURITYPicture by Salim Virji, licensed under the CC BY-SA 2.0
  17. 17. WHAT TO TEST? UNITSWHAT TO TEST?
  18. 18. WHAT TO TEST? UNITSWHAT TO TEST? BEHAVIOR
  19. 19. BEHAVIOR constituted by scenarios (descriptions of them)
  20. 20. BEHAVIOR constituted by scenarios (descriptions of them) acceptance criteria extract User story As a ... I want … So that ...
  21. 21. BEHAVIOR constituted by scenarios (descriptions of them) describe in DSL → executable acceptance criteria extract User story As a ... I want … So that ...
  22. 22. BEHAVIOR constituted by scenarios (descriptions of them) describe in DSL → executable acceptance criteria extract Gherkin: Given a precondition User story When an event occurred Then an outcome is achieved As a ... I want … So that ...
  23. 23. BEHAVIOR constituted by scenarios (descriptions of them) describe in DSL → executable acceptance criteria extract Gherkin: Given a precondition User story When an event occurred Then an outcome is achieved As a ... I want … So that ... execute tool

×