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

Testing Best Practices, or The Five Habits of H...

Testing Best Practices, or The Five Habits of Highly Effective Tests

There’s all kinds of discussion on how to make test processes work, and how to make tests fast, but it sometimes seems like there’s not much discussion on how to make tests useful. What makes a BDD test valuable, in that it will save more time that it will cost in maintenance? I’ll claim that there are five things that you should look for in your tests: independence, repeatability, clarity, conciseness, and robustness. These features will make the tests easier to write, easier to verify, and easier to keep consistent as your application becomes more complicated. You’ll leave this talk ready and able to write great tests.

Noel Rappin

April 25, 2012
Tweet

More Decks by Noel Rappin

Other Decks in Technology

Transcript

  1. Testing Best Practices or The 5 Habits of Highly Effective

    Tests Noel Rappin @noelrap Wednesday, April 25, 12
  2. "I get paid for code that works, not for tests"

    -- Kent Beck Wednesday, April 25, 12
  3. If the tests can't be simple, the code is bad

    simple Wednesday, April 25, 12
  4. A test is well-defined if it gives the same result

    every time well-defined Wednesday, April 25, 12
  5. A test is independent if it does not depend on

    external state independent Wednesday, April 25, 12
  6. If your tests are not fast, you can not be

    test-driven fast Wednesday, April 25, 12
  7. A test is truthful if it accurately reflects the underlying

    code truthful Wednesday, April 25, 12