~/talk

Testing in Practice: Keeping Your Tests Concise and Declarative

Talkat droidcon Berlin 2024 · 2024-07-03..07-05· [testing, android]
slides:none on file

Argues that mocks cause brittle, interaction-only tests and recommends replacing them with Kotlin idioms: factory functions for injectable constructors, functional interfaces for one-line fakes, and small focused interfaces so fakes remain simple. Shows tests that keep behavior inside a single function body, prefer object-to-object assertions over fragile property checks, and use Compose screenshot testing for pixel diffs. Claims these changes reduce setup noise, expose poor architecture, and make tests declarative and maintainable.

AI-written summary · about

  1. 0:00Testing philosophy intro
  2. 1:49Automated testing types
  3. 3:13Unit tests and design
  4. 8:51Mock-heavy test critique
  5. 11:41Kotlin factory functions
  6. 13:06Functional interfaces
  7. 14:33Shared state avoidance
  8. 15:59DAMP vs DRY
  9. 17:00Why code is better than documentation
  10. 19:49Self-documenting tests
  11. 20:32Faking context
  12. 21:13Interface segregation
  13. 22:40Test naming
  14. 23:43Kotlin object mocking
  15. 24:25State vs properties
  16. 25:51Mock-free testing tips
  17. 27:17Outtakes
~/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.