Program with GUTS
summary
Argues that good unit tests are specifications and documentation, not just pass/fail checks, and demonstrates concrete patterns in JUnit (including JUnit 5 display-name generators): name each test as a clear proposition, make failures pinpoint the broken rule, and prefer parameterized tests to avoid duplicated examples. Uses the leap year rule to show four mutually exclusive cases (not divisible by 4; divisible by 4 but not 100; divisible by 100 but not 400; divisible by 400), notes only about 5–10% of developers know the full rule, and models queues with state-centric tests (capacity, length, enqueue/dequeue).
AI-written summary · about
chapters (17)
- 0:00Introduction
- 1:07Unit tests and guts focus
- 3:56What makes good unit tests
- 8:55Leap year example and test names
- 17:25Writing tests for people
- 20:34Leap year rules to testable code
- 24:44Refining test names
- 27:17Failing tests reveal problems
- 30:10Meaningful test names
- 34:01Tests as specifications
- 37:09Parameterized tests
- 40:18Error cases and edge conditions
- 42:45Queue example
- 44:52Queue test smells
- 46:18State transition tests
- 49:30Given-when-then structure
- 50:12Q&A
related talks
01h 08mStructure and Interpretation of Test Cases
15mProgram with GUTs
01h 11mStructure and Interpretation of Test Cases
46mStructure and Interpretation of Test Cases
02h 46mThe Joy of Testing
45mTesting the untestable PART II – patterns, use cases and practices
48mEffective Unit Testing
37mClean Test Code
