Pages Navigation Menu

Coding is much easier than you think

SOAP UI – MockServices – Getting Started…

SOAP UI – MockServices – Getting Started…





Before we actually go into how to mock a service, let’s get to know some basic concepts of mocking.


You would have few questions in your mind such as,

  • What is mocking all about?
  • When should I mock a service?
  • What are the advantages in mocking a service?
  • Best practices involved in mocking?


Let’s find the answers for the above questions.


First of all, what is mocking a service?

A definition from a book can be given as Service Mocking, or simulation, is the practice of creating a facsimile environment that works similar to the environment you’€™re facsimileing€.

In simple words, mocking is nothing but Isolation, Simulation, or Virtualization, but those are term basically created to move the lowly practice of mocking higher into the value chain. So, for all purposes Isolation, Simulation, and Virtualization are the same as mocking, just much more expensive.

Now we know what is mocking.

Next, when should I use a mock service?

The answer to the above question is simple. You should use mocks when you can’t use the real thing. Of course it’€™s not that easy when you look into it more carefully. The detailed answer for this question is available in the next question.

What are the uses of mock services?

  • You can create tests in advance
  • Teams can work in parallel
  • Create proof of concepts or demos
  • Write test for resource not accessible
  • Mock can be delivered to the customer
  • Save yourself from the money pit
  • Isolate systems
  • Test the Live Environments before you have the service in it

Not that it has the above advantages; there are also few disadvantages that you need to know when you are mocking a service.

  • Double work
  • Deployment constraints
  • Mocks gets bugs
  • It’s not live
  • Enter the Uncanny Valley

The drawbacks above aside, Mocking is extremely powerful used correctly, and can save a lot of time and money for you. Let’s see some of the best practices of the mock services.

  • Start small and expand.
  • Only Deep Mock what you need to Deep Mock.
  • Agree on what the scope is and how real it should be
  • Think of reuse
  • Get a buy in.
  • Go deep. Really deep!
  • Consider the cloud
  • Skunk it!
  • WAR – Deploy

Now we are a little bit familiar about mock services concepts. Let’€™s see how to work with mock services in the next tutorials.

%d bloggers like this: