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

Testing Express: 0 to 100 in 30 slides

129b5ff44f5d43b6e7cf6703211abe7e?s=47 Tuenti
July 16, 2016

Testing Express: 0 to 100 in 30 slides

129b5ff44f5d43b6e7cf6703211abe7e?s=128

Tuenti

July 16, 2016
Tweet

Transcript

  1. Testing Express: 0 to 100 in 30 slides kini@tuenti.com @kinisoftware

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

  3. Why this talk? • We <3 our customers • Confidence

    • Safety Net • Refactoring, refactoring, refactoring • It is professional, guys :) Q&A => http:/ /goo.gl/slides/x4c4xw
  4. By Mike Cohn Q&A => http:/ /goo.gl/slides/x4c4xw

  5. 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
  6. 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
  7. JVM Application classes in isolation Test doubles Build time Really

    fast tests F.I.R.S.T. Q&A => http:/ /goo.gl/slides/x4c4xw
  8. What’s wrong with this?

  9. 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
  10. 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
  11. “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
  12. Talk is cheap. Show me the code.

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

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

  16. None
  17. Code readability + Naming + Code structure + DSL

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

  20. None
  21. • Builders

  22. Builders + Mothers

  23. None
  24. None
  25. None
  26. Q&A => http:/ /goo.gl/slides/x4c4xw

  27. Q&A kini@tuenti.com @kinisoftware http:/ /goo.gl/slides/x4c4xw

  28. Thanks!! We are hiring! kini@tuenti.com @kinisoftware

  29. Extra Ball • Mix JVM Languages (Groovy, Scala, Kotlin, etc)

    • Java 8 fuck yeah! • JUnit 5 • Mutation Testing
  30. Extra Ball • Effective Unit Testing • WEWUT • Pragmatic

    Unit Testing with JUnit • GOOS • The Art of Unit Testing • JUnit in Action • xUnit Patterns • Refactoring