VOOZH about

URL: https://forum.wordreference.com/threads/stub-out.2597396/

⇱ stub out | WordReference Forums


Menu


Install the app
You are using an out of date browser. It may not display this or other websites correctly.
You should upgrade or use an alternative browser.

stub out

afx

Senior Member
slovak
Hello,

In one computers related book I found a sentence:
To help with this, you can stub out (or “mock”) controller dependencies.

Stub, or mock in this context means simplify object to other form that fakes behavior of the original one,
but is much simpler and this is used for testing.

That said it is clear what stub out in this context means. But in dictionary I found that stub out means extinguish.
So my question is if stub out is only some form of computer slang or it can also be used in common speech in the meaning:
"extract something from something else"?

Thanks a lot for answer.


Last edited:
I only ever met it to mean extinguish as a verb. Or something short in its noun form.

A quick check in the urban dictionary does not suggest anything in common speech relating to your definition here.
Assuming that handbook is free of error, then I think we're looking at some form of computer jargon here.
Ah, yes. It has become computer jargon, although the metaphor comes from construction.

Let's say that you are building a house and you want to have a deck, but you don't have the money to pay for a deck right away.

So, you would have the builders leave short sections of deck supports sticking out where you want the deck to be so as the new deck will be easier to attach when you are ready.

So, you would instruct the builders to "stub out" the deck supports, i.e. in the form of "stubs."

In the computer world, it means to write software in such a manner that it's easy to add. i.e. "attach" future features.

See this Wikipedia article: http://en.wikipedia.org/wiki/Template:Stub

On the other hand, I've never seen it used to mean "simulate" something, as is implied by your question. ("Simulate" seems to be much more appropriate here.)

Unfortunately, you haven't followed our guidelines and provided the source of your material. I have a feeling that your material either was not written by a native speaker or that it's a poor translation of an original in another language. This kind of information can be critical when providing help to learners.

So my question is if stub out is only some form of computer slang or it can also be used in common speech in the meaning:
"extract something from something else"?

Don't 👁 Thumbs Down :thumbsdow
Last edited:
So my question is if stub out is only some form of computer slang or it can also be used in common speech in the meaning:
"extract something from something else"?
It is computer jargon, but it means to make a "stub" (stub like the stump of a bush that's had all the leaves and branches cut off) version of each function in the object. I'm not sure where you're getting this idea of "extracting".
For completeness I am adding definition of stub from the same book (and even if authors are Italians it is original English printing
from Manning Publications so I suppose they use correct English):

STUB A class or a method that mimics the behavior of an external dependency,
accepting the same inputs and providing likely outputs. You can
use a stub to replace that dependency for testing purposes, and you can
also use stubs to temporarily substitute for code that has yet to be written.

So it is clear what they meant by stub out in a given context. I was just curious if I could use it the same way outside of
programmers word, though my question about "extract something from something" probably was not completely accurate.
I always thought Wikipedia meant "this article is a stubby little thing and it needs to be expanded."

The only way I've ever heard stub used as a verb is to mean extinguish, and I'd say that over 99 percent of the time it's been in the phrase "stub out a cigarette."
Last edited:
Back
Top Bottom