Test doubles (fakes, mocks and stubs)

[Google Scholar] [Wikipedia]

Notes: test driven development, testability

Replacement for a software component. Terminology is apparently inconsistent about which is which but the three choices are

  • A simplified, but accurate implementation of a component (e.g., an in-memory database)
  • An empty shell that can be preprogrammed with a canned sequence of expected method calls and results to return in response to those calls. If the call sequence does not match the expectation, a test failure is reported.

Dependency injection, Test driven development, Testability