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

Not Breaking Stuff: Unit Testing (2009)

Rob Howard
October 05, 2009

Not Breaking Stuff: Unit Testing (2009)

The second in a short series of presentations given at a PHP development shop.

Rob Howard

October 05, 2009
Tweet

More Decks by Rob Howard

Other Decks in Technology

Transcript

  1. The Situation ▪ The system you're building is huge. ▪

    Lots of parts, some dependent on each-other. ▪ Change one thing, another thing breaks, BUT YOU DON'T KNOW IT. ▪ End up in a constant treadmill of bug-fixing, testing, bug-fixing... until you reach the finish line, battered and bruised.
  2. The Feedback Loop ▪ Every time you change something, you

    need to check everything. ▪ Checking everything takes a long time, thus a long time before you get an ”all-clear” on your changes. ▪ Therefore your feedback loop is huge.
  3. The Feedback Loop ▪ So automate the checking, and reduce

    the feedback loop to seconds instead of days. ▪ The more you automate it; clicking links, typing values (etc) is the slow way. ▪ Aim for way to run the tests with a single click. ▪ More work upfront setting it up, but it pays off the larger the system gets.
  4. Testing Approaches ▪ Build the tests as (or just before)

    writing the system code. ▪ Grafting it on afterwards as a check before larger changes (eg. refactoring).