Test Double - CI/CD Glossary Definition
A test double is any stand-in object used in place of a real dependency during testing. Mocks, stubs, fakes, spies, and dummies are the five canonical kinds.
The five kinds
A dummy fills a parameter and is never used; a stub returns canned answers; a spy records how it was called; a mock asserts on expected calls; a fake is a lightweight working implementation (like an in-memory database).
Why use them
Test doubles isolate the code under test from slow, nondeterministic, or external systems, making unit tests fast and repeatable in CI.
Related guides
Mock - CI/CD Glossary DefinitionMock: A mock is a test double pre-programmed with expectations about how it should be called, that fails the…
Stub - CI/CD Glossary DefinitionStub: A stub is a test double that returns predefined responses to calls made during a test, with no logic of…
Snapshot Test - CI/CD Glossary DefinitionSnapshot Test: A snapshot test records the output of code (a rendered component, a serialized object) to a st…