Test stub

Test stub image
Definition: A test stub is a stand-in for a real component or interface that returns pre-set responses, so code can be developed or tested without the real thing. Stubs often rely on assumed data.

So what? Stubs make it possible to move quickly when a dependency isn't ready. The risk is building on assumptions that turn out to be wrong, which real examples would have exposed sooner.

Examples: Building a stub payment gateway that returns assumed messages while the real gateway is unavailable. Replacing a slow external service with a stub during automated tests.

Explore MoT
Test Forward 2027 ยท Software Quality in the age of AI image
Tue, 19 Jan 2027
Test Forward is one afternoon at Station F with the QA and engineering people closing that gap in their own teams.
MoT Software Testing Essentials Certificate image
Boost your career in software testing with the MoT Software Testing Essentials Certificate. Learn essential skills, from basic testing techniques to advanced risk analysis, crafted by industry experts.
This Week in Quality image
Debrief the week in Quality via a community radio show hosted by Simon Tomes and members of the community
Subscribe to our newsletter