Service Stub (i.e., Mock Objects) removes dependence upon problematic services (i.e., credit scoring, tax rate lookups, pricing engines) during testing. Replacing the service during testing results in faster tests and failing tests due to issues related to the services outside the scope of the test.

To define a Service Stub