I think the problem is the choice of words. Maybe mocks should actually be called "spies" instead and stubs "fakes".
I think the problem is the choice of words. Maybe mocks should actually be called "spies" instead and stubs "fakes".
Personally, I tend to think of stubs as being super basic. A stub class for me returns default values or throws NotImplemented or something as simple as possible. It doesn't maintain meaningful state. Mocks for me are generally simplified implementations like an in-memory store that replaces a DB. Frameworks like Moq have muddied my definition though because they call things mocks when they only return canned data. Building a real mock (fake) with real state using Moq tends to be a pain.
It's almost as if the experts don't all agree with this terminology.
Edit: This was a bit too snarky, but truthfully, I don't see evidence in the field that these definitions are widely used. I see evidence that an very small crowd is using these terms and asserting their correctness. Meanwhile the rest of the industry thinks anything they use as a "double" in a test is a "mock".
Even the people writing widely-used mocking libraries aren't using this terminology consistently.