You Can't Test This? Hammertime!
summary
Lists common excuses for untestable code, then gives practical fixes: stub the RNG or pass a provider for randomness and fake clocks for datetime to avoid 24‑hour runs, use dependency injection and local DB copies or emulators instead of prod, and run CI so “works on my machine” stops. Recommends Chaos Monkey style failure tests, property‑based and mutation testing (mentions Pex/Moles‑style tools), approval tests and fuzzers; cites real pain: 72‑hour suites and flaky tests, and shows how smaller units expose bugs quickly.
AI-written summary · about
chapters (8)
- 0:00Start
- 5:58You can't test this • You don't know what it's supposed to do yet • It writes to the screen • Formal proofs? Do you need to be *certain of everything?
- 12:52Why do we test? Confidence for you? Your customers? What do you mean by confidence? No regressions eg seagull merge With business people, your team. Concert examples are easier to point at/reason about
- 20:26How do we test? • End to end "Integration"
- 42:04The numbers are wrong ProTip: Send in zeros and check for discontinuities
- 43:30A True Story "I'm not an engineer but I don't understand how you can test something you haven't built yet."
- 53:23Mocks, stubs and stunt doubles Fake it til they make it Does the coverage hit the code or just the mocks Maybe try some mutation testing
- 56:21How do you test machine learning? Jupyter/Data bricks etc note books • The structure is hard to test • One long function • Randomness inside • Results are a often a graph
related talks
44mTesting the untestable - patterns and use cases analysis
59m.NET Testing Techniques You Didn’t Know You Needed
57mAdvanced Testing Techniques: Tips from the trenches
42mDon't Let Your Tests Flake Out
43mCan you Test it
26mTesting the Tricky Stuff
42mTesting on Thin Ice: Chipping Away at Test Unpredictability
46mTesting the untestable - patterns and use cases analysis
