Upgrade to Pro — share decks privately, control downloads, hide ads and more …

First experiences with BDD

First experiences with BDD

First-hand experiences of adopting and embracing BDD in a project.

Avatar for Carlos Ortega

Carlos Ortega

September 17, 2014

Other Decks in Programming

Transcript

  1. Include a new feature into a project • Read tons

    of documentation • Cross your fingers for an updated docs
  2. Include a new feature into a project • Read tons

    of documentation • Cross your fingers for an updated docs • Feel afraid to modify the current code
  3. Include a new feature into a project • Read tons

    of documentation • Cross your fingers for an updated docs • Feel afraid to modify the current code • Understand the current algorithms
  4. During development • Write the best algorithm ever • Objects

    are strongly coupled • Rely on the QA to find your bugs
  5. During development • Write the best algorithm ever • Objects

    are strongly coupled • Rely on the QA to find your bugs • Code very difficult to test
  6. During development • Write the best algorithm ever • Objects

    are strongly coupled • Rely on the QA to find your bugs • Code very difficult to test • Automatic tests not always possible
  7. During development • Write the best algorithm ever • Objects

    are strongly coupled • Rely on the QA to find your bugs • Code very difficult to test • Automatic tests not always possible • Write tests once you have the code
  8. During development • Write the best algorithm ever • Objects

    are strongly coupled • Rely on the QA to find your bugs • Code very difficult to test • Automatic tests not always possible • Write tests once you have the code • Duplicated functionalities
  9. Deliver the project • Rarely deliver what it was expected

    • Perform a bunch of manual tests • Expect user reports of crashes
  10. Deliver the project • Rarely deliver what it was expected

    • Perform a bunch of manual tests • Expect user reports of crashes • Work hard to fix the crashes
  11. Deliver the project • Rarely deliver what it was expected

    • Perform a bunch of manual tests • Expect user reports of crashes • Work hard to fix the crashes • Fix one bug and create two more
  12. What is BDD? • Tests first (TDD) • Examples first

    • They describe how your code should work
  13. What is BDD? • Tests first (TDD) • Examples first

    • They describe how your code should work • BDD at any level
  14. What is BDD? • Tests first (TDD) • Examples first

    • They describe how your code should work • BDD at any level • Spec, fix, refactor
  15. Include a new feature into a project • Feel confident

    to mess up the code • Code is self-explanatory
  16. During development • Develop just the required stuff • Write

    examples before modify your code • Code is testable by default
  17. During development • Develop just the required stuff • Write

    examples before modify your code • Code is testable by default • Only required edge cases are defined
  18. During development • Develop just the required stuff • Write

    examples before modify your code • Code is testable by default • Only required edge cases are defined • Prevent regression bugs
  19. During development • Develop just the required stuff • Write

    examples before modify your code • Code is testable by default • Only required edge cases are defined • Prevent regression bugs • Expect QA to thumbs up
  20. During development • Develop just the required stuff • Write

    examples before modify your code • Code is testable by default • Only required edge cases are defined • Prevent regression bugs • Expect QA to thumbs up • Code as your documentation