~/talk

Put Your Tests on a Diet:Testing the Behavior and Not the Implementation

Talkat Droidcon London 2023 · 2023-10-26..10-27· [testing]
slides:none on file

Argues that replacing heavy mocking with a Given‑When‑Then BDD style on a sample chat app (StateFlow viewmodel, use cases, repository, message factory) yields a single, fast test suite that mocks only the external chat data source and avoids brittle verifies that fail because the factory generates random IDs/dates. Uses the cest behavior spec to run the flow-based tests, achieves full coverage of production classes with fewer tests, lets refactoring pass without breaking tests and recommends mock only external services.

AI-written summary · about

  1. 0:00Introduction and speaker intro
  2. 3:15Modern app architecture overview
  3. 4:39Sample chat app walkthrough
  4. 7:05Problems with mocking every layer
  5. 13:23Anti-pattern test code review
  6. 15:51Expert opinions on mocking
  7. 17:18Behavior-driven development explained
  8. 19:01BDD test structure demo
  9. 22:12Testing the whole feature flow
  10. 24:38Redefining unit tests
  11. 25:42When to mock in BDD
  12. 26:46Benefits of behavior testing
  13. 28:54TDD and refactoring confidence
  14. 31:25Key takeaways summary
~/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.