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
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
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
“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
Extra Ball • Effective Unit Testing • WEWUT • Pragmatic Unit Testing with JUnit • GOOS • The Art of Unit Testing • JUnit in Action • xUnit Patterns • Refactoring