Skip to content

Origin

"Dummy" in testing comes from the general English sense of "an object that stands in for the real thing"; the software-specific meaning was formalised by Meszaros in 2007 as the fifth test double.

The word entered software testing from the broader English usage of "dummy" for a sham or a placeholder (19th century: a "dummy book" on a shelf, a "dummy run"). Meszaros' book codified the five-double taxonomy in 2007 and, in doing so, gave the dummy its own precise definition — distinct from a stub (which returns something) and from a fake (which works). Before the formalisation, developers used "dummy" interchangeably with "stub" and "mock", which is why the term survives in legacy code as an over-broad label.

  1. 19th century — "dummy" as a placeholder or sham in general English

  2. 2007 — Meszaros formalises Dummy as one of five doubles

  3. 2011 — Sinon.js keeps dummies implicit (you pass null, not a dummy class)

  4. 2014 — Jest popularises simpler dummies via {} and null

  5. 2020s — Modern test frameworks de-emphasise dummies in favour of explicit stubs

Object Mother is a way to create dummy objects for your tests without having to build them from scratch every time.

— Martin Fowler, *ObjectMother*, 2006 (paraphrase)
2007 · Meszaros formaliza Dummy como uno de cinco dobles
5 · doblesdummy, stub, spy, mock, fake
0 · comportamiento esperado de un dummy
1 · propósitosatisfacer la firma