What is API Virtualization?


Below we use API Virtualization and API Simulation interchangeably, as synonyms.

Nowadays it is a cliché that APIs are proliferating everywhere. Everybody is talking about the API Economy, IoT (Internet-of-Things), digital and mobile revolution…all fueled by APIs.

A simple way to explain APIs is that APIs (Application Programming Interfaces) enable software components to interact with each other; APIs are the contract between the software components that define what data they exchange and under what conditions.

API Virtualization creates stand-in simulations of real APIs or APIs not built yet. We call those API simulations “API simlets”. The application or component using an API simlet “thinks” that it is interacting with the actual application or component behind the API. For the purpose of a test or suite of tests the API simlet behaves and outputs data if it were “the real deal”.

When people, even hard-core technologists, think of APIs, they usually think of Web APIs – APIs running over the HTTP protocol, using JSON or XML-formatted messages, and operating in a request/response fashion. With API Virtualization/API Simulation, we have to broaden our view:

  • API simlets can simulate APIs that use all of the basic Message Exchange Patterns (MEPs) – in-out, out-in, in-only, and out-only.
  • API simlets can simulate APIs over protocols other than HTTP. That includes text and binary protocols as well. Such APIs enable applications to interact with components like databases, message-oriented middleware (MOM), mail servers, directory services, etc. as well as with other applications. For example, API simlets can mimic databases and message queues for testing purposes!

More advanced API simlets are capable of producing not only static but dynamic output as well, allow the injection of slowness, latency, and failures, even adding business logic…all to make the simulation more realistic.

It is important to understand another aspect of API Simulation. Applications are becoming increasingly interconnected – it is common for an application to depend on the APIs of a dozen or more other applications and components, which in turn have their own API dependencies, and so on. API simlets imitate APIs of first-degree dependencies only.

From historical perspective, simulation of behavior and data is not anything new. It has actually been around since the time of writing software programs and tests for them. The means to simulate APIs have evolved: from local only to local and remote simulations; from the application’s view of the interactions to going down to the communication protocol level; from always writing code to mimic behavior and data to achieving the same result via simple configuration. This can be very powerful!

Why Use API Virtualization? >>