~/talk

Mocking your codebase without cursing it

Talkat GopherCon Singapore 2025 · 2025-01-22..01-24· [testing, developer-experience]
links:none on file
slides:none on file

Argues that mocks should only cover coordination, not business logic, and that constraining design yields smaller, testable pieces; uses Go examples, hand‑rolled function mocks and testify/mock (tip: use testify mock and call its Test method), recommends generators or LLMs for boilerplate, and shows a RAG-style incident‑report coordinator as a concrete example. Advises to limit collaborators to three or four and write two tests per collaborator (happy + error), mock only direct collaborators, avoid mixing real objects with mocks, and layer with integration and end‑to‑end tests.

AI-written summary · about

  1. 0:00Introduction to mocking
  2. 1:02What mocks are
  3. 2:04Mock examples in Go
  4. 4:53History and design benefits
  5. 6:16Real-world example
  6. 7:39Outside-in testing
  7. 8:21Coordinators vs logic
  8. 9:25How mocks go wrong
  9. 10:27Business vs sociable tests
  10. 13:18Common mocking smells
  11. 16:32Concerns about mocks
  12. 18:40Mocks limitations
  13. 20:23Test pyramid explained
  14. 23:35Key takeaways
  15. 25:20Practical advice
~/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.