Skip to content
Surf Wiki
Save to docs
technology/software-engineering

From Surf Wiki (app.surf) — the open knowledge base

Method stub

Short and simple version of a method


Short and simple version of a method

A method stub is a short and simple placeholder for a method that is not yet written for production needs. Generally, a method stub contains just enough code to allow it to be used a declaration with any parameters, and if applicable, a return value.{{cite web

A method stub may be used to implement an interface that is defined but for which the implementation is not available.

Example

In the following example pseudocode, the function returns a particular value even though ultimately it is supposed to read a value from a hardware source. It returns a valid value, allowing consuming code to be runnable. The function ignores the input parameter which is common for a stub.

function ReadThermometer(Source source) return 28 end function

References

References

  1. (2004). "Programming in C++". Jones & Bartlett Learning.
Info: Wikipedia Source

This article was imported from Wikipedia and is available under the Creative Commons Attribution-ShareAlike 4.0 License. Content has been adapted to SurfDoc format. Original contributors can be found on the article history page.

Want to explore this topic further?

Ask Mako anything about Method stub — get instant answers, deeper analysis, and related topics.

Research with Mako

Free with your Surf account

Content sourced from Wikipedia, available under CC BY-SA 4.0.

This content may have been generated or modified by AI. CloudSurf Software LLC is not responsible for the accuracy, completeness, or reliability of AI-generated content. Always verify important information from primary sources.

Report