Mocking in software testing
Before we delve into the details of web service simulation, it will be beneficial to discuss the basic use of mocking in software testing.
If you are familiar with unit testing, mock objects should not be a strange term. Specially, in Test-driven Development (TDD), mock objects are used to test the functionality of a feature without actually calling the complex and real implementation classes. When the objects you are testing rely on other objects or are bound with complex environments, it is not always practical to instantiate them. Instead, a mock object, which conforms to the interface of the real object, can be used to mimic the behavior of the original. For example, when you are building an application, which uses a database, you do not want to wait till the database team implements the database-specific code. Instead, you would use mock objects to simulate the database modules.
Note
The complete explanation of mock objects and TDD is out of the scope of this...