Get More From Your Unit Tests
summary
Code that’s hard to test gets simplified into a to‑do list, repository protocol and small units; tests verify behavior not internal calls, reducing fragile coupling. Tests use test doubles and the Cuckoo mocking framework to assert save is called with the created item. Tests follow given when then for clarity. A real bug leads to a failing test, a regex change (allowing a period) fixes it and the suite stays green, turning tests into live specs.
AI-written summary · about
chapters (33)
- 0:00iOS Conf SG 2022 17-21 January
- 0:18Why write unit tests?
- 0:59Major issues with unit testing in practice
- 1:36Code Under Test
- 1:58Identify different responsibilities
- 2:27Break down responsibilities
- 3:21Add todo source code
- 3:35Testing code with external dependencies?
- 4:05How to mock?
- 4:29Test "add todo"
- 5:51Lets say those magical words again
- 6:45Test for the "error path"
- 7:01Test "remove todo"
- 7:38Fragile Test Problem
- 8:29Example
- 8:49Redundant?
- 9:16Solution
- 9:42Are these "unit" tests?
- 10:15"Unit" ?
- 10:36Todo Package
- 11:08Not a silver bullet
- 11:46References
- 12:08Books?
- 12:45Tests are not meaningful
- 13:05Meaningful Tests
- 13:48Product Requirement Doc (PRD)
- 14:21What happens when Test = Spec?
- 15:43Scenario
- 16:11Existing Test
- 16:24New failing test
- 16:38Update Code
- 16:54Test passes!
- 17:23Summary








