Stub and Fake

noun

say it: “STUB and FAYK” /stʌb ænd feɪk/

Test stand-ins: a stub returns fixed answers, and a fake is a simple working version, such as an in-memory list.

What is Stub and Fake?

A stub returns canned answers; a fake is a working lightweight version, like an in-memory repository.

In a sentence

  • “We used a stub clock that always says 9 a.m., and a fake repository that keeps products in a list.”

Level: Journeyman · More Unit Testing terms at this level

Updated