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

Test to Break Principles

Rob Waller
February 01, 2019

Test to Break Principles

There are two types of tests a developer can write, ‘test to work’ and ‘test to break’. Both are essential to robust development, but many developers only use the former and not the latter. This talk explains why ‘test to break’ principles are essential to ensure robust application development.

Rob Waller

February 01, 2019
Tweet

More Decks by Rob Waller

Other Decks in Technology

Transcript

  1. W: rbrt.wllr.info | T: @RobDWaller TDD Tips Test Business Logic

    Test Private Methods Test Input / Output Test Big Methods Do Don’t
  2. W: rbrt.wllr.info | T: @RobDWaller Example 1. Given the driver

    has a valid car key. When they insert the key into the ignition. And they turn the key. Then the car's engine starts.
  3. W: rbrt.wllr.info | T: @RobDWaller Example 2. Given the driver

    has an invalid car key. When they insert the key into the ignition. And they turn the key. Then the car's engine will not start.
  4. W: rbrt.wllr.info | T: @RobDWaller Example 1. Given the driver

    has a screwdriver. When they insert it into the ignition. And turn the screwdriver. Then the car's engine will not start.
  5. W: rbrt.wllr.info | T: @RobDWaller Example 2. Given a car

    is traveling at 30 mph. When it hits a tree. Then all the seat belts tighten. And the airbags deploy.
  6. W: rbrt.wllr.info | T: @RobDWaller Rules 1. Cars can only

    be black. 2. Cars can have two or four doors. 3. Cars must have four wheels.
  7. W: rbrt.wllr.info | T: @RobDWaller Summary ‘Working’ software is not

    good enough. Writing good software is hard. You are ignorant. Your problems are complicated. Always write tests. Stress and break your business logic. Code will work in one way always.