Stubs provide fixed responses, mocks verify interactions, and fakes are lightweight implementations (e.g., in-memory DB). They serve different goals in tests.
Pick the right substitute:
Fakes are often more robust than mocks for integration-style tests.
Payment provider:
Stub: returns success
Mock: assert charge() called once with amount=100
Fake: in-memory ledger that records balances