79485227

Date: 2025-03-05 01:16:31
Score: 1
Natty:
Report link

I consider the meaning of these words.

Consider when you are seeing a branch in a tree in the dark, or from a distance. You may ask: is it a real branch or a fake branch?

If it is fake, it can be just a short cylinder, with no subbranches nor leaves, and so its a stub; or it may have fake subbranches and fake leaves, and so it imitates, or mocks, a real branch, and so it is a mock.

Therefore, a function which replaces real behavior with fake behavior is a fake. There two kinds of fakes; a function whose behavior is a fixed answer, and so it is extremely simple, is a stub; a function whose behavior simulates the real behavior, and so it is somewhat or very complex, is a mock.

Reasons:
  • Long answer (-0.5):
  • No code block (0.5):
  • Contains question mark (0.5):
  • Low reputation (0.5):
Posted by: carlo.milanesi