Stub - CI/CD Glossary Definition
A stub is a test double that returns canned, predetermined responses so the code under test has predictable inputs.
A stub is a test double that returns predetermined responses to calls made during a test, with no logic of its own. It supplies inputs to the code under test but does not assert on how it was used.
Stubs are used when a test needs a dependency to return a specific value (an HTTP 200, an empty list) without invoking real behavior.
Related guides
Test Double - CI/CD Glossary DefinitionTest Double: A test double is any object that stands in for a real dependency during a test, such as a stub,…
Mock - CI/CD Glossary DefinitionMock: A mock is a test double that is preprogrammed with expectations about the calls it should receive, and…
Fixture - CI/CD Glossary DefinitionFixture: A fixture is the fixed baseline state, data, or objects set up before a test runs and torn down afte…