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

How Much Should We Test?

How Much Should We Test?

Presented at SP Tech Talk

Cad06c496d78923202f2c30444fab2ea?s=128

Michael Cheng

March 09, 2017
Tweet

More Decks by Michael Cheng

Other Decks in Programming

Transcript

  1. HOW MUCH SHOULD WE TEST? Or how to stop hating

    your tests
  2. GOALS OF TEST SUITE • Tests should be thorough •

    Tests should be stable • Tests should be fast • Tests should be few (minimal)
  3. TEST DRIVEN DEVELOPMENT • We use test cases to guide

    the design of our code • 2 approaches to testing - Inside Out and Outside In • Outside In - Use integration tests to guide you • Inside Out - Build & test individual components, integrate later
  4. None
  5. None
  6. Object under test

  7. Object under test Incoming Messages

  8. Object under test Incoming Messages Outgoing Messages

  9. Object under test Incoming Messages Outgoing Messages

  10. Object under test Incoming Messages Outgoing Messages Send to self

  11. Object under test Incoming Messages Outgoing Messages Send to self

    Message Types:
  12. Object under test Incoming Messages Outgoing Messages Send to self

    Query Message Types:
  13. Object under test Incoming Messages Outgoing Messages Send to self

    Command Query Message Types:
  14. MESSAGE TYPES • Query: Returns something / changes nothing •

    Command: Returns nothing / changes something Object under test Incoming Messages Outgoing Messages Send to self Command Query
  15. None
  16. None
  17. None
  18. None
  19. None
  20. None
  21. RESOURCES • “The Magic Tricks of Testing” - Sandi Metz


    http://confreaks.tv/videos/railsconf2013- the-magic-tricks-of-testing • “Working Effectively with Unit Tests” - Jay Fields
 https://leanpub.com/wewut