jargon

Backend & systems·Testing and test doubles

you hard-code the collaborator to return a fixed value so the code under test has something to work with.

Stub

A double that returns canned responses, providing inputs to the code under test. It has no assertions and no logic; it exists so the test can reach the code path you care about. If your test asserts on what the stub was called with, you have written a mock.

Commonly confused with