Method stub
A method stub or simply stub
An example of a stub in pseudocode might be as follows:
temperature = ThermometerRead(Outside) if temperature > 40 then print "It is hot!" end if
function ThermometerRead(Source insideOrOutside) return 28 end function
The above pseudocode utilises the function ThermometerRead, which returns a temperature. While ThermometerRead would be intended to read some hardware device, this function currently does not contain the necessary code. So ThermometerRead does not, in essence,
A stub
In the context of
The small pieces of dummy code branched into—so as to allow a graceful exit when invoking a fat binary in the wrong environment—are also called (code) stubs.
See also
- Abstract method
- Mock object
- Dummy code
- Test stub
- Glue code
- Shim (computing)
- DOS stub
References
- ISBN 978-0-7637-3234-9.
- ^ "stub". WEBOPEDIA. 23 March 1998. Retrieved 2012-08-28.
- ISBN 978-0-596-00712-6. Retrieved 2012-08-28.
External links
- A Stub Generation System For C++ (PDF)
- Stub/mock frameworks for Java Review and comparison of stub & mock frameworks for Java