Reason for Topic
Modern apps and distributed systems are quite complex, with many back-end services and components involved in ensuring a great user experience. Often many are external 3rd parties or legacy systems and platforms, huge data sets and infrastructure stacks, and tightly monitored and controlled SLAs. These are not things that software teams can replicate completely when developing and testing, either before first release or afterward continuously as changes are made. But what else is there…how do you integrate to or test something that doesn’t exist?
Introduction / Definition
Service Virtualization is a technique used in software engineering that helps to create a simulated environment to test software applications that are not yet completed or may have dependencies on other applications that are not yet available. This technique was first introduced in the early 2000s, and since then, it has become an integral part of the software development process. The idea of Service Virtualization originated from the need to simulate the behavior of complex systems in a controlled environment.
In the early days of software development, testing was done on the actual system itself. However, as systems grew in complexity, it became difficult to test them in the actual environment due to dependencies on other systems that were not yet available or were undergoing changes. This led to the concept of Service Virtualization, which enabled developers to simulate the behavior of these systems and test the application in a controlled environment.
In modern enterprise application delivery, Service Virtualization is used to create a simulated environment that closely resembles the actual production environment. This helps to reduce the risks associated with testing and speeds up the overall development process. Service Virtualization is especially useful in cases where a component of the system is not yet available or is undergoing changes. By simulating the behavior of this component, the application can be tested in a controlled environment without any dependencies on the actual system.
Benefits & Examples
Service Virtualization is especially useful when having to deal with legacy systems, such as mainframes and older or proprietary database solutions, where standing up real implementations of these legacy components for additional development and testing is impractical in terms of cost, skills, or resources.
Drawbacks / Gotchas
While Service Virtualization offers several benefits in software development, there are also some drawbacks that need to be considered, and ultimately have led to the industry more precisely approaching the problem domain that service virtualization originated from (example: API Simulation).
Service Virtualization can only simulate the behavior of the actual system to a certain extent. The simulation may not capture all the complexities and nuances of the actual system, which can result in inaccurate test results. Even a mature service virtualization practice often does not cover all the possible scenarios that could occur in the actual system. This can result in missed defects that may only surface in the production environment.
Implementing Service Virtualization often requires a significant initial investment in terms of infrastructure, resources, and training. This can be a deterrent for smaller teams or organizations that may not have the resources to invest in Service Virtualization. Similarly, Service Virtualization requires ongoing maintenance and updates to keep the simulations up-to-date with the changes in the actual system. This can create additional overhead for the development team.
The value of having somewhat-real stand-ins at the right times in development and advanced testing cycles is clear: teams that can simulate certain components and 3rd-party services can go faster that having to wait waterfall-style for resources to become available. But Service Virtualization has become a bloated technological approach if taken as a solution to every/any scenario.
This is why ‘API simulation’ is quickly becoming the successor to Service Virtualization. API simulation is a more precise approach to the vast majority of what teams need to accelerate their delivery process than having to deal with many bloated implementations of service virtualization on the market today. Even if there are legacy systems involved, such as mainframe processes and data, many enterprises have abstracted them using modern APIs. Once abstracted, APIs can be mocked, especially easy if using machine-readable specifications such as OpenAPI. Most 3rd-party services, SaaS platforms, and cloud-based infrastructure providers expose their capabilities through APIs as well. So no matter how you look at it, the vast majority of modern surface area for virtualization is represented as APIs.
Overall, Service Virtualization has become an essential part of software engineering practices, especially when dealing with legacy systems. However, as the industry evolves, it is less and less a suitable carte-blanche solution as compared to modern approaches such as code-based mocking and API simulation.