A Dummy is the simplest test double in Gerard Meszaros' taxonomy from xUnit Test Patterns (2007): an object passed only to fill a required parameter and never actually used in the test. It has no behaviour, and any call to it signals a fault in the test setup. Dummies satisfy constructor or method signatures whose parameters are irrelevant to the scenario under test.

Test Double: Dummy (Meszaros)

Details

Core Concepts:

Purpose

An object passed to fill a required parameter but never actually used in the test. The simplest form of test double.

Behavior

Has no behavior. Calls to a Dummy should not occur — if they do, something is wrong with the test setup.

Typical use

Satisfying constructor or method signatures where the parameter is irrelevant to the test scenario.

Key Proponent

Gerard Meszaros ("xUnit Test Patterns", 2007)

When to Use:

  • Tell an LLM: "Create a Dummy test double for this parameter — it should never be called"

  • When a method requires parameters that are irrelevant to the behavior being tested

  • Filling dependency injection containers with unused dependencies