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. Why this talk? • We <3 our customers • Confidence

    • Safety Net • Refactoring, refactoring, refactoring • It is professional, guys :) Q&A => http:/ /goo.gl/slides/x4c4xw
  2. 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
  3. 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
  4. JVM Application classes in isolation Test doubles Build time Really

    fast tests F.I.R.S.T. Q&A => http:/ /goo.gl/slides/x4c4xw
  5. 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
  6. 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
  7. “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
  8. Extra Ball • Mix JVM Languages (Groovy, Scala, Kotlin, etc)

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

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