Note to reviewers: A key purpose of publishing these patterns is to give everyone a common vocabulary for talking about test design. Current usage of terms such as Mock Object, Stub, Fake and Dummy Object are used in many different ways with the meaning of each term becoming very ambiguous. I have tried to standardize on the most common or most correct (as defined in related literature) usage. I invented the name Test Double as the generic name for Dummies, Stubs, Fakes and Mock Objects. Feedback on this proposal for standardized terminology is earnestly requested!
Types of Test Doubles
A Test Double is any object or component that we install in place of the real component specifically so that we can run a test. Depending on the reason for why we are using it, it can behave in one of four basic ways:
A Dummy Object is a placeholder object that is passed to the SUT as a parameter but is never actually used.
A Test Stub is an object that is used by a test to replace a real component on which the SUT depends so that the test can control the indirect inputs of the SUT. This allows the test to force the SUT down paths it might not otherwise exercise. A more capable version of a Test Stub, the Recording Test Stub can be used to verify the indirect outputs of the SUT by giving the test a way to inspect them after exercising the SUT.
A Mock Object is an object that is used by a test to replace a real component on which the SUT depends so that the test can verify its indirect outputs. Typically, the Mock Object fakes the implementation by either returning hard-coded results or results that were pre-loaded by the test.
A Fake Object (or just "Fake" for short) is an object that replaces the functionality of the real depended-on component with an alternate implementation of the same functionality.
Check out the nice diagram on that page, which includes "Eager Mock Object", "Lazy Mock Object", and "Recording Test Stub", as well as the other types of dummy objects mentioned above.