Stub
Updated 2026-07-30
Summary
Temporary code used to simulate a module or an external interface that has not yet been developed.
Definition
Temporary code used to simulate modules or external interfaces that have not yet been developed. It does not implement real functionality, but returns preset fake data to test the caller's logic. Scaffolding role: Scaffolding for modular advancement. When your work depends on others (because they haven't finished), don't wait. Write a "stub" (assume others have finished, return ideal results), and first get your own logic working. Don't let external blocking become your excuse.
Introduction
How to use
Scaffolding for modular advancement. When your work depends on others (because they haven't finished), don't wait. Write a "stub" (assume others have finished, return ideal results), and first get your own logic working. Don't let external blocking become your excuse.
Mechanism
A stub is a placeholder implementation for modules that are not yet implemented, returning fake data or no-op, allowing the system to be integrated and tested early. Placeholder enables parallelism.
Practice
In progress 0/4Practice this model in one real situation:
Cases
- When frontend and backend are developed in parallel, frontend uses mock stubs; test doubles in testing; interfaces before implementation.
Common pitfalls
- Stubs not replaced for a long time lead to false positives; stub behavior deviates from reality causing misjudgment; ignoring maintenance cost of stubs.
Sources
Source support: Explicit
References currently contain only Wikipedia links; primary sources still need review.
- en.wikipedia.orghttps://en.wikipedia.org/wiki/Stubverified
account_treeGenealogyexpand_more
PRIVATE NOTES · Only visible to you
SAVED Q&A
ENTRY Q&A · Private saving available
Ask with a clear boundary
thinkingmodels answers from published entry context only.
Your question is sent to thinkingmodels. The answer uses public entry context only.
RELATED MODELS