Identify common test double types and the testing purpose each one serves.
Sort each substitute collaborator into the correct test double type. Dummy Fake Stub Spy Mock A required constructor argument passed as nullLogger but never used by the behavior An in-memory repository that stores and retrieves orders for the test A clock object that always returns 2026-06-26 10:00 An email service substitute that records messages so the test can inspect them later A payment client programmed to expect charge(1000) exactly once A placeholder analytics object passed only because the API requires it A lightweight file store that writes to memory instead of disk A user service substitute that returns a canned…
Sign up free — one personalized lesson every day, matched to your role and goals.
Already have an account? Sign in