~/talk

Test like a ninja with Go

Talkat stackconf 2024 · 2024-06-18..06-19· [go, testing]
links:none on file
slides:none on file

Covers concrete Go techniques: table-driven and subtests for units, mockery + testify.mock for generated mocks, benchmarks run with go test -bench=. -benchmem and are machine-dependent, and fuzzing (added in Go 1.18) using the seed corpus and -fuzz/-fuzztime to discover edge cases. Recommends reproducing bugs with an integration test first, then fixing code; prefers many integration tests over heavy mocking and uses testcontainers-go to spin up databases reliably. Notes a quick survey: ~58% of developers write automated tests.

AI-written summary · about

  1. 0:00Introduction
  2. 1:51Why testing matters
  3. 4:44Go testing basics
  4. 7:55Unit test techniques
  5. 10:28Mocking dependencies
  6. 13:36Benchmarking performance
  7. 15:46Fuzz testing
  8. 19:16Example tests
  9. 20:43Integration tests
  10. 23:34Test suites with testify
  11. 25:44Test containers
  12. 27:35Resources and thanks
  13. 27:58Q&A
~/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.