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 full-size slide

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

    View full-size 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 full-size slide

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

    View full-size 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 full-size 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 full-size 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 full-size slide

  8. What’s wrong with this?

    View full-size 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 full-size 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 full-size 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 full-size slide

  12. Talk is cheap.
    Show me the code.

    View full-size slide

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

    View full-size slide

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

    View full-size slide

  15. Code readability + Naming + Code
    structure + DSL

    View full-size slide

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

    View full-size slide

  17. • Builders

    View full-size slide

  18. Builders + Mothers

    View full-size slide

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

    View full-size slide

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

    View full-size slide

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

    View full-size slide

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

    View full-size slide

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

    View full-size slide