wordfor

test double (mock, stub, fake)

noun

Software design

  1. A stand-in for a real dependency in tests: stubs return canned answers, mocks verify calls, fakes are lightweight working versions. An in-memory fake repository lets the test suite run in seconds without a database.

In plain words

  • fake the API in tests
  • pretend database for testing
  • tests call the real payment service

See also dependency injection pure function

Find similar words