~/talk

Fake it till you make it - effective use of test doubles

Talkat droidcon Americas 2020 · 2020-11-16..11-17· [testing, developer-experience]
links:none on file
slides:none on file

Explains when to use stubs, fakes, mocks and dummies with concrete examples: a splash screen presenter tested by injecting a fake view that records loading/error state, a stubbed use‑case that returns logged‑in or throws, and a mocked router verified to open main or login screens. Uses Mockito(+Kotlin extensions) for classic mocks but warns Mockito cannot mock suspend functions; recommends MockK supports suspend functions and final classes. Shows alternatives for static APIs: wrap, set global delegates, or use MockK/PowerMock. Emphasizes constructor injection and readability.

AI-written summary · about

  1. 0:00Introduction and speaker
  2. 1:19Test pyramid and unit tests
  3. 3:29Splash screen example
  4. 9:21Types of test doubles
  5. 10:26Mocking with Mockito
  6. 14:01Custom fakes vs mocks
  7. 16:32Mockito features
  8. 17:36Mockito matchers
  9. 22:41Mocking coroutines
  10. 25:11Handling static access
  11. 30:37Takeaways and summary
  12. 33:10Q&A session
~/search
type to search 8,222 conferences, 162,397 speakers and 219,688 talks
~/help
cmdctrl k
search every conference, speaker and series
/
focus the filter search
h
home
c
conferences
s
speakers
e
series
t
light / dark — the status bar button does the same
← →
on a talk: 5 seconds back / forward
0–9
on a talk: jump to 0%–90% of the recording
?
this help
esc
close this, then clear every filter — or just the search, while you are typing in it

Ignored while you are typing. Pages without a filter rail have no search to focus.