Pro Yearly is on sale from $80 to $50! »

Test to Break Principles

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

99a446aac48cfaf36593646d5565a830?s=128

Rob Waller

February 01, 2019
Tweet

Transcript

  1. W: rbrt.wllr.info | T: @RobDWaller Test to Break Principles Why

    You Should Crash Your Car Into a Tree
  2. W: rbrt.wllr.info | T: @RobDWaller

  3. W: rbrt.wllr.info | T: @RobDWaller

  4. W: rbrt.wllr.info | T: @RobDWaller What is a Unit Test?

  5. W: rbrt.wllr.info | T: @RobDWaller 3 Types of Test

  6. W: rbrt.wllr.info | T: @RobDWaller

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

    Test Private Methods Test Input / Output Test Big Methods Do Don’t
  8. W: rbrt.wllr.info | T: @RobDWaller Test to Work

  9. 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.
  10. 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.
  11. W: rbrt.wllr.info | T: @RobDWaller Test to Break

  12. 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.
  13. 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.
  14. W: rbrt.wllr.info | T: @RobDWaller Code Example

  15. W: rbrt.wllr.info | T: @RobDWaller

  16. W: rbrt.wllr.info | T: @RobDWaller

  17. W: rbrt.wllr.info | T: @RobDWaller

  18. W: rbrt.wllr.info | T: @RobDWaller

  19. W: rbrt.wllr.info | T: @RobDWaller

  20. W: rbrt.wllr.info | T: @RobDWaller

  21. W: rbrt.wllr.info | T: @RobDWaller Good software functions well and

    is bug free.
  22. W: rbrt.wllr.info | T: @RobDWaller Ignorance Complexity

  23. W: rbrt.wllr.info | T: @RobDWaller Ignorance is natural Complexity is

    standard Test to break helps
  24. W: rbrt.wllr.info | T: @RobDWaller

  25. 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.
  26. W: rbrt.wllr.info | T: @RobDWaller

  27. W: rbrt.wllr.info | T: @RobDWaller

  28. 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.
  29. W: rbrt.wllr.info | T: @RobDWaller

  30. W: rbrt.wllr.info | T: @RobDWaller Rob Waller T: @RobDWaller W:

    rbrt.wllr.info