“Testing Without Mocks” Course
Welcome! In this self-guided course, you’ll learn how to write tests using Nullables, a novel technique for testing code that involves external systems and state.
For more information about Nullables, see the Nullables Hub.
No Support
This course was originally a paid, instructor-led course. I’m releasing it for free as a gift, with the caveat that you’re on your own. I’m not able to answer questions or provide tutoring. If you’d like private training on this material, please contact me to arrange for a paid session.
However, you’re welcome to post on my Discord or reach out on Mastodon. Other people could be able to help, and I do respond on occasion. Just no promises.
Pre-Course Setup
Download the course repository here. You’ll need it for the exercises.
JavaScript and Node.js Primers
The course exercises use Node.js with JavaScript (or TypeScript). If you’re not familiar with JavaScript, read the JavaScript Basics primer.
The remaining primers are linked from the exercises. You can read them in advance, if you like, or wait until you’re working on the exercises that need them.
Course Materials
The course is focused on learning by doing. Each module starts with a short lecture video, but it may not make sense until you do the exercises. Follow the “Exercise Setup” instructions in each module, then do the challenges in order. Be sure to use the hints to stay on track, and refer to the API documentation for details about the methods that are available for you to use.
If you get stuck, there’s a complete solution at the bottom of each challenge.
Although you can use TypeScript for the exercises, I recommend starting with JavaScript. TypeScript’s added complexity makes the material harder to understand. You can always use TypeScript on your second time through.
Module 1: Using Nullables
Learn how to use Nullables to test application code that depends on infrastructure.
Module 2: High-Level Infrastructure
Learn how to create and test high-level Nullable infrastructure wrappers.
Module 3: Narrow Integration Tests
Learn how to create low-level infrastructure wrappers and test their communication with external systems.
Module 4: Embedded Stubs
Learn how to make low-level infrastructure wrappers Nullable using embedded stubs.