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

Testing Express: 0 to 100 in 30 slides

Tuenti
July 16, 2016

Testing Express: 0 to 100 in 30 slides

Tuenti

July 16, 2016
Tweet

More Decks by Tuenti

Other Decks in Programming

Transcript

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

    View Slide

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

    View Slide

  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

    View Slide

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

    View Slide

  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

    View Slide

  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

    View Slide

  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

    View Slide

  8. What’s wrong with this?

    View Slide

  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

    View Slide

  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

    View Slide

  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

    View Slide

  12. Talk is cheap.
    Show me the code.

    View Slide

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

    View Slide

  14. View Slide

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

    View Slide

  16. View Slide

  17. Code readability + Naming + Code
    structure + DSL

    View Slide

  18. View Slide

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

    View Slide

  20. View Slide

  21. • Builders

    View Slide

  22. Builders + Mothers

    View Slide

  23. View Slide

  24. View Slide

  25. View Slide

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

    View Slide

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

    View Slide

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

    View Slide

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

    View Slide

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

    View Slide