Introducing the Mock Object Pattern
The key concept of the Mock Object Pattern is in creating and using a dummy object that simulates the behavior of a more complex object that is (or will be) part of an implementation. The Mock Object should have the same API as the actual (or real) object, return similar results using the same data structures, and also operate in a similar manner with regards to how its methods alter its exposed state (the properties).
Mock Objects are usually created during the early development phases of an application. Their primary use case is to enable us to proceed with the development of a Module, even if it depends on others that have not yet been implemented. Mock Objects can also be described as prototypes of the data exchanged between the different parts of the implementation, acting like contracts between the developers and easing the parallel development of interdependent modules.
Tip
In the same way that the principles of the Module Pattern decouple the implementations...