Testing the Tricky Stuff
summary
Shows concrete, working techniques: replace singletons with injectable properties so fakes drive behavior; build custom assertions to collapse many checks into one readable expectation; run tests in playgrounds with a custom test observer; use in-memory Core Data store and create fixtures in setup/teardown to avoid shared state; use predicate/KVO expectations for async progress; randomize and parallelize tests to cut a 3-minute suite toward 30s and surface hidden order dependencies; aims for pragmatic coverage (example: 95% framework, 80% app) and prioritizes bug-reproducing tests.
AI-written summary · about
chapters (22)
- 0:00Welcome and introduction
- 1:48Why testing matters
- 3:57Learning from other ecosystems
- 5:21Custom assertions in Swift
- 6:24Testing Singletons and dependencies
- 7:50Testing in playgrounds
- 8:32UI and navigation testing
- 9:15Asynchronous testing with predicates
- 10:40Core Data testing strategies
- 11:45Shared fixtures and setup
- 12:49Teardown and cleanup
- 13:35Class-level setup and teardown
- 13:56Randomizing and parallel testing
- 15:21Optimizing test speed
- 16:47Q&A begins
- 17:39Test coverage strategies
- 19:43Unit vs integration vs UI tests
- 20:38Randomized order benefits
- 22:05Adding tests to legacy projects
- 23:53Snapshot testing discussion
- 24:55Encouraging testing culture
- 25:58Final thoughts and thanks








