~/talk

Beyond the Mockery- Why We Should Embrace Testing Without Mocking Frameworks

Talkat droidcon New York 2023 · 2023-09-14..09-15· [testing]
slides:none on file

Argues that heavy use of Mockito creates brittle, slow, and hard-to-read tests: Mockito returning nulls and mocks returning mocks hide failures, suffer type-erasure surprises, deep-stub footguns, and generate shared mutable state. Recommends constructor injection, immutability and small interfaces, then replacing expensive or third-party dependencies with tiny stubs or hand-coded fakes (example: an in-memory fake coffee-stock repository) that run fast, reveal API changes at compile time, and verify resulting state instead of internal interactions.

AI-written summary · about

  1. 0:00Introduction and motivation
  2. 3:41Testing challenges and anti-patterns
  3. 10:23Problems with mocking frameworks
  4. 16:23Costs of unpredictability in mocks
  5. 21:03Stubs and fakes as alternatives
  6. 25:38Seams and interface segregation
  7. 29:30Conclusion and final advice
~/search
type to search 6,249 conferences, 138,987 speakers and 185,172 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
?
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.