While API virtualization is already over a decade old, many developers, testers, and decision-makers still misunderstand it.
Virtual APIs create an environment that teams can use to mimic the characteristics of the production environment and create simulated responses from all APIs the application relies on.
API virtualization is a single technique that pays off in several distinct roles. Let’s take a look at a few examples to help illustrate the benefits attached to virtual APIs.
Why API Virtualization?
We don’t talk about API virtualization with our investors or family members. API virtualization doesn’t show up in the architectural diagrams seen at most conferences or customer presentations.
API virtualization just helps us do what we were already doing faster, more reliably, and at lower cost. That’s all.
And that’s more than enough for most of us. We can develop and/or test our services without help from API virtualization; more of our time, attention, and talent then go to hand-written mocks and stubs, maintenance demands new rounds of hand-coded tests, and the whole product cycle exhibits the fragility of excessive coupling.
Choosing Good API Virtualization Techniques Liberates All That Expert Energy
With API virtualization, team members can focus on solving real product-specific problems, rather than wasting them on building and re-building scaffolding. API virtualization allows a move to the fast lane of development and testing.
Think through a simple example: the service you’re developing and testing relies on an external API for sending out SMS (small message service — telephone texts) content.
Virtualization of the real service brings you these benefits:
- No incremental use charges
- Consistent, controllable responses, including error conditions
- 100% availability
- Testing edge cases without licensing threat: you can test your own software under overloads and with hostile data, confident that nothing will leak to your provider
- Measurement of strategic indexes eases without the need to subtract out the provider’s own performance
A virtualized API helps developers and testers “lock in” on their own responsibilities.
Teams that test against “live” services for anything other than final integration tests inevitably dissipate crippling amounts of their own efforts in tracking down otherwise-minor variations of the service. The inconsistencies of real-world services — minor changes in diagnostic messages, fluctuations in response latency, and so on — are incredibly distracting to working developers.
Manage Product Development Smarter
A virtualized API provides a controlled baseline that can be crucial for business reasons, too. Comparison of behavior of the true and virtualized APIs makes it practical to negotiate with the provider. The provider might, for instance, boast that it has 99.999% uptime; if your own measurements show, though, that the API’s latency causes your own product to have acceptable performance only 98.9% of the time, you’re in a position to have a meaningful conversation.
Similarly, a properly virtualized API gives a basis for strategic investigation of the impact of a competitor’s API, or a new release of the real API, or the advantages of a CDN (content delivery network). Measurements with a virtualized API provide an independent perspective on the provider’s performance. Often that’s all it takes to transform business conversations from dependence and subordination to a more equitable negotiation.
All these examples illustrate the difference between speculating, “We think the provider’s API is performing adequately, for the most part”, and measuring, “Our logs show that the provider’s API falls outside our acceptable threshold X% of the time.” Product managers and executives much prefer the latter.
Exception Handling and Compliance
A final aspect of control that virtualized APIs bring has to do with exceptional conditions. Developers and managers are well-trained to think about scalability: many of them have a good feel for what it takes to grow a service to ten or a thousand or a million times its previous performance.
Less common is expertise in dealing with exceptions and risks. On an operational basis, managers spend vast amounts of their daily time on the few failed runs, because typical automations already perform adequately for successful ones. Everything slows down by an enormous factor when things go wrong, though.
This is another domain where API virtualization helps. A virtualized API is one that can be configured to fail in controlled ways. Instead of managing a product by effectively writing “monsters here!” in the vicinity of errors in the API, testing of error handling becomes possible.
There are a number of commanding advantages of API virtualization, including the ability to:
- Accelerate development
- Make development more reliable and management
- Provide testability
In 2016, “manual” mocking should be a last resort only for exceptional circumstances. Learn a good API virtualization tool, and concentrate on what makes your own product unique, rather than wasting excessive effort re-doing and verifying tests.
Build APIs Better, Faster, Stronger With ServiceV
The big question still remains: How do you implement an API virtualization program that delivers results? That is the question we plan to answer in our upcoming webinar: Build APIs Better, Faster, Stronger: 3 Real-World Examples of API Virtualization in Action.
This webinar will cover three practical examples of virtualization in action. We’ll cover:
- How organizations speed time-to-market by reducing dependencies between API development and testing teams
- How companies have lowered delivery costs by overcoming third party rate limits
- How organizations achieve expanded testing capabilities by controlling API conditions
- A live demonstration of ServiceV
We’re offering two sessions of the webinar on Tuesday, June 14 at 10am and 2pm.