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

BDD

 BDD

BDD in a nutshell

Renan Ivo

March 13, 2015
Tweet

More Decks by Renan Ivo

Other Decks in Technology

Transcript

  1. BDD

  2. 1. Write a test; 2. Make it run; 3. Make

    it right. -- Test Driven Development By Example Kent Beck General TDD Cycle
  3. • Where to start; • What to test and what

    not to test; • How much to test in one go; • What to call their tests; • How to understand why a test fails. http://dannorth.net/introducing-bdd/ Programmers wanted to know
  4. "I came across the convention of starting test method names

    with the word 'should.' This sentence template" http://dannorth.net/introducing-bdd/ The class should do something
  5. Example AgeCalculatorBehaviour: • should fail for years before 1900 •

    should fail for years after the current year • should fail when age is greater than the given minimum age
  6. "After a while, I found that if I was changing

    code and caused a test to fail, I could look at the test method name and identify the intended behaviour of the code." http://dannorth.net/introducing-bdd/ Behaviour
  7. When a test fail • I had introduced a bug;

    • The intended behaviour was still relevant but had moved elsewhere • The behaviour was no longer correct - the premise of the system had changed.