Testing · Senior · Question 58 of 75
What is the difference between a mock and a fake?
- ✓Correct answer: A fake has a working simplified implementation (in-memory DB); a mock is pre-programmed with expectations about calls
- 2They are the same
- 3A fake is used only in E2E tests
Explanation
Fakes give realistic behaviour without infrastructure; mocks check interactions. Both are test doubles.