Slide 1

Slide 1 text

HOW MUCH SHOULD WE TEST? Or how to stop hating your tests

Slide 2

Slide 2 text

GOALS OF TEST SUITE • Tests should be thorough • Tests should be stable • Tests should be fast • Tests should be few (minimal)

Slide 3

Slide 3 text

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

Slide 4

Slide 4 text

No content

Slide 5

Slide 5 text

No content

Slide 6

Slide 6 text

Object under test

Slide 7

Slide 7 text

Object under test Incoming Messages

Slide 8

Slide 8 text

Object under test Incoming Messages Outgoing Messages

Slide 9

Slide 9 text

Object under test Incoming Messages Outgoing Messages

Slide 10

Slide 10 text

Object under test Incoming Messages Outgoing Messages Send to self

Slide 11

Slide 11 text

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

Slide 12

Slide 12 text

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

Slide 13

Slide 13 text

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

Slide 14

Slide 14 text

MESSAGE TYPES • Query: Returns something / changes nothing • Command: Returns nothing / changes something Object under test Incoming Messages Outgoing Messages Send to self Command Query

Slide 15

Slide 15 text

No content

Slide 16

Slide 16 text

No content

Slide 17

Slide 17 text

No content

Slide 18

Slide 18 text

No content

Slide 19

Slide 19 text

No content

Slide 20

Slide 20 text

No content

Slide 21

Slide 21 text

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