The Good, The Bad, and The Stubbed: A Java Unit Testing Adventure
summary
Argues that unit testing is as important as production code and shows a runnable mini shop (bunny supply store) built and tested with JUnit and Mockito, using real classes Shop, CartService and FoodService so examples actually execute. Demonstrates stub vs mock vs spy where stubs provide controlled data, mocks assert side effects and can fail tests, spies wrap real objects, and notes surprising anecdotes like teams with one million passing unit tests but a broken system.
AI-written summary · about
chapters (8)
- 0:00Introduction
- 1:50Why unit test
- 8:32Good test and good code
- 11:41JUnit and Mockito setup
- 13:03Stubs vs mocks vs spies
- 21:07Testing principles
- 36:24Team testing paradigm shift
- 38:33Conclusion and Q&A
related talks
55mUnit Testing Like a Pro - Towards a Testable Design
01h 46mHow Java developers should test their applications (RU)
02h 58mOverview of Testing in Our Applications
41mTesting done right: From bugs to brilliance
02h 46mThe Joy of Testing
59mJava Testing Part 2: Mocks, Stubs, and Spies with Mockito 4
43mThe Little Shop of TDD Horrors
54mAutomated Tests: What Courses Won't Teach You
