Hi everyone,
One of the most common questions I get about #nullables is, “How is that any different than a mock?”
The short answer is that Nullables result in sociable, state-based tests, and mocks (and spies) result in solitary, interaction-based tests. This has two major benefits:
1. Nullables catch bugs that mocks don't.
2. Nullables don't break when you refactor.
I go into more detail here:
Cheers,
James