Both Stubs and Mocks override external dependencies but the difference is
Stubs -> To Test Data
Mocks -> To Test Behavior
A quote from Fowler's Mocks Aren't Stubs article:
- Stubs provide canned answers to calls made during the test, usually not responding at all to anything outside what's programmed in for the test.
- Mocks are what we are talking about here: objects pre-programmed with expectations which form a specification of the calls they are expected to receive.
This obviously tells the difference.
Fake/Dummy -> Test nothing (just override functionality with empty methods, eg replace Logger to avoid any logging noise while testing)