Slide 1

Slide 1 text

Testing Express: 0 to 100 in 30 slides [email protected] @kinisoftware

Slide 2

Slide 2 text

Self-promotion Q&A => http:/ /goo.gl/slides/x4c4xw

Slide 3

Slide 3 text

Why this talk? • We <3 our customers • Confidence • Safety Net • Refactoring, refactoring, refactoring • It is professional, guys :) Q&A => http:/ /goo.gl/slides/x4c4xw

Slide 4

Slide 4 text

By Mike Cohn Q&A => http:/ /goo.gl/slides/x4c4xw

Slide 5

Slide 5 text

Black-box oriented tests End to end Phone/simulator No tests doubles can be used Needs a full & provisionable server environment Slow tests Page Objects Q&A => http:/ /goo.gl/slides/x4c4xw

Slide 6

Slide 6 text

JVM No need external env set up Tests run in build time Use test doubles Slower tests than unit tests Q&A => http:/ /goo.gl/slides/x4c4xw

Slide 7

Slide 7 text

JVM Application classes in isolation Test doubles Build time Really fast tests F.I.R.S.T. Q&A => http:/ /goo.gl/slides/x4c4xw

Slide 8

Slide 8 text

What’s wrong with this?

Slide 9

Slide 9 text

Testability • Mixing object graph construction with application logic • Ask for things, don’t look for things • Doing work in constructor • Global State/Singletons • Static methods Q&A => http:/ /goo.gl/slides/x4c4xw

Slide 10

Slide 10 text

Test Doubles • Stubs => Canned answers • Mocks => Stubs + verify • Spies => Record interaction info • Fake => I seem real but not • Dummy => I do nothing at all Q&A => http:/ /goo.gl/slides/x4c4xw

Slide 11

Slide 11 text

“It’s overwhelmingly easy to write bad unit tests that add very little value to a project while inflating the cost of code changes astronomically.” • Code coverage != Test quality • Don’t Repeat Yourself (Globally) • Mocks, mocks everywhere • Test smells

Slide 12

Slide 12 text

Talk is cheap. Show me the code.

Slide 13

Slide 13 text

Q&A => http:/ /goo.gl/slides/x4c4xw

Slide 14

Slide 14 text

No content

Slide 15

Slide 15 text

Q&A => http:/ /goo.gl/slides/x4c4xw

Slide 16

Slide 16 text

No content

Slide 17

Slide 17 text

Code readability + Naming + Code structure + DSL

Slide 18

Slide 18 text

No content

Slide 19

Slide 19 text

Q&A => http:/ /goo.gl/slides/x4c4xw

Slide 20

Slide 20 text

No content

Slide 21

Slide 21 text

• Builders

Slide 22

Slide 22 text

Builders + Mothers

Slide 23

Slide 23 text

No content

Slide 24

Slide 24 text

No content

Slide 25

Slide 25 text

No content

Slide 26

Slide 26 text

Q&A => http:/ /goo.gl/slides/x4c4xw

Slide 27

Slide 27 text

Q&A [email protected] @kinisoftware http:/ /goo.gl/slides/x4c4xw

Slide 28

Slide 28 text

Thanks!! We are hiring! [email protected] @kinisoftware

Slide 29

Slide 29 text

Extra Ball • Mix JVM Languages (Groovy, Scala, Kotlin, etc) • Java 8 fuck yeah! • JUnit 5 • Mutation Testing

Slide 30

Slide 30 text

Extra Ball • Effective Unit Testing • WEWUT • Pragmatic Unit Testing with JUnit • GOOS • The Art of Unit Testing • JUnit in Action • xUnit Patterns • Refactoring