Skip to main content
InterviewHubPRO
Section Overview
Q6

Question 6 of 50

Part 1: Basic & Foundational Concepts (Junior / Entry-Level)

12%
Software Testing & QA (50 Qs)•Part 1: Basic & Foundational Concepts (Junior / Entry-Level)

Test Doubles Taxonomy: Dummy, Stub, Spy, Mock, and Fake.

junior Levelsoftware-testingBasic

In Simple Words: According to Gerard Meszaros' taxonomy:

  1. Dummy: Objects passed around simply to satisfy function signatures (e.g. filling an unused required argument null or {}).
  2. Stub: Returns hardcoded, predefined responses to calls made during the test. Contains no verification logic.
  3. Spy: Wraps a real object or function to record execution history (how many times it was called, with what arguments).
  4. Mock: Pre-programmed with expectations of calls it should receive. Fails the test if the expected calls do not occur.
  5. Fake: A working implementation with a simplified shortcut not suitable for production (e.g. an In-Memory SQLite database or an in-memory Map simulating a Redis cache).