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

Not Breaking Stuff: Unit Testing (2009)

E34acb847338523dc088f03f0eedd1eb?s=47 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.

E34acb847338523dc088f03f0eedd1eb?s=128

Rob Howard

October 05, 2009
Tweet

Transcript

  1. Not Breaking Stuff

  2. 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.
  3. Well, That Doesn't Sound Fun. ▪ It really isn't.

  4. 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.
  5. 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.
  6. 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).
  7. Testing As You Go

  8. Augmenting An Existing System

  9. Demo Time ▪ http://demo.robhoward.id.au/deepend/testing/asyougo/ (I'll chuck it up on the

    blog when we're done here.)