Three neighbours in the family; the difference is when they judge, not what they record.
Aspect | Stub | Spy | Mock |
|---|
Returns | Fixed answer | Delegates to real | Expects specific answer |
Records calls | No | Yes | Yes |
Fails on its own | No | No | Yes (unmet expectation) |
Test asserts on | State | Ledger | Contract |
Refactor resilience | High | High | Low |