ArticleslgStudy

computer science

Service virtualization

Service virtualization is a computer science topic covered in the lgStudy science library. This page brings together a partial reference excerpt, illustrations, worked examples, real-world applications and a short study plan, so you can understand Service virtualization rather than just read about it. In short: In software engineering, service virtualization or service virtualisation is a method to emulate the behavior of specific components in heterogeneous component-based applications such as API-driven applications, cloud-based applications and service-oriented architectures. It is used to provide software development and QA/testing teams access to dependent system components that are needed to exercise an application u…

Key takeaways

  • Service virtualization belongs to computer science; place it in that map before memorising details.
  • Learn the definition first, then one example that makes the definition concrete.
  • Connect Service virtualization to a quantity you can measure, compute or draw — that is where exam questions come from.
  • Reproduce the core statement of Service virtualization from memory before moving on to harder problems.

Reference excerpt

In software engineering, service virtualization or service virtualisation is a method to emulate the behavior of specific components in heterogeneous component-based applications such as API-driven applications, cloud-based applications and service-oriented architectures. It is used to provide software development and QA/testing teams access to dependent system components that are needed to exercise an application under test (AUT), but are unavailable or difficult-to-access for development and testing purposes. With the behavior of the dependent components "virtualized", testing and development can proceed without accessing the actual live components. Service virtualization is recognized by vendors, industry analysts, and industry publications as being different than mocking. See here for a Comparison of API simulation tools.

Overview Service virtualization emulates the behavior of software components to remove dependency constraints on development and testing teams. Such constraints occur in complex, interdependent environments when a component connected to the application under test is:

Not yet completed Still evolving Controlled by a third-party or partner Available for testing only in limited capacity or at inconvenient times Difficult to provision or configure in a test environment Needed for simultaneous access by different teams with varied test data setup and other requirements Restricted or costly to use for load and performance testing Although the term "service virtualization" reflects the technique's initial focus on virtualizing web services, service virtualization extends across all aspects of composite applications: services, databases, mainframes, ESBs, and other components that communicate using common messaging protocols. Other similar tools are called API simulators, API mocking tools, over the wire test doubles. Service virtualization emulates only the behavior of the specific dependent components that developers or testers need to exercise in order to complete their end-to-end transactions. Rather than virtualizing entire systems, it virtualizes only specific slices of dependent behavior critical to the execution of development and testing tasks. This provides just enough application logic so that the developers or testers get what they need without having to wait for the actual service to be completed and readily available. For instance, instead of virtualizing an entire database (and performing all associated test data management as well as setting up the database for every test session), you monitor how the application interacts with the database, then you emulate the related database behavior (the SQL queries that are passed to the database, the corresponding result sets that are returned, and so forth).

Application Service virtualization involves creating and deploying a "virtual asset" that simulates the behavior of a real component which is required to exercise the application under test, but is difficult or impossible to access for development and testing purposes. A virtual asset stands in for a dependent component by listening for requests and returning an appropriate response—with the appropriate performance. For a database, this might involve listening for a SQL statement, then returning data source rows. For a web service, this might involve listening for an XML message over HTTP, JMS, or MQ, then returning another XML message. The virtual asset's functionality and performance might reflect the actual functionality/performance of the dependent component, or it might simulate exceptional conditions (such as extreme loads or error conditions) to determine how the application under test responds under those circumstances. Virtual assets are typically created by:

Recording live communication among components as the system is exercised from the application under test (AUT) Providing logs representing historical communication among components Analyzing service interface specifications (such as a WSDL) Defining the behavior manually with various interface controls and data source values They are then further configured to represent specific data, functionality, and response times. Virtual assets are deployed locally or in the cloud (public or private). With development/test environments configured to use the virtual assets in place of dependent components, developers or testers can then exercise the application they are working on without having to wait for the dependent components to be completed or readily accessible. Industry analysts report that service virtualization is best suited for "IT shops with significant experience with 'skipping' integration testing due to 'dependent software', and with a reasonably sophisticated test harness.

Relation to stubbing and mocking An alternative approach to working around the test environment access constraints outlined in this article's introduction is for team members to develop method stubs or mock objects that substitute for dependent resources. The shortcoming of this approach became apparent in the early 2000s with the rise of Service-oriented architecture. The proliferation of Composite applications that rely on numerous dependent services, plus the rise of Agile software development following the 2001 publication of the Agile Manifesto, made it increasingly difficult for developers or testers to manually develop the number, scope, and complexity of stubs or mocks required to complete development and testing tasks for modern enterprise application development. The first step in the evolution from stubbing to service virtualization was the technology packaged in SOA testing tools since 2002. The earliest implementations of service virtualization were designed to automate the process of developing simple stub-like emulations so that composite applications could be tested more efficiently. As enterprise systems continued to grow increasingly complex and distributed, software tool vendors shifted focus from stubbing to the more environment-focused service virtualization. While stubbing can still be completed through manual development and management of stubs, what has become known as "service virtualization" is completed by using one of the available commercial off the shelf (COTS) service virtualization technologies as a platform for the development and deployment of their "service virtualization assets".

… excerpt ends here. Continue reading the full article.

Worked examples

Example 1 — a first encounter with Service virtualization

Start with the simplest possible case. Write down what Service virtualization claims or describes in one sentence, then invent the smallest concrete situation in which that sentence is true. In computer science, the smallest case is usually a single object, a single equation or a single measurement. Check that every symbol or term in your sentence has a meaning in that case.

Example 2 — changing one variable

Take the situation from Example 1 and change exactly one quantity: double it, halve it, or set it to zero. Predict what should happen to Service virtualization before you calculate. Comparing your prediction with the result is the fastest way to find out whether you understand the idea or only the words.

Example 3 — an exam-style question

Typical questions about Service virtualization ask you to (a) state it precisely, (b) apply it to given data, and (c) explain a limitation. Practise writing all three answers in under five minutes; the third part is what separates a full-mark answer from an average one.

Applications of Service virtualization

In research
Service virtualization appears in computer science research whenever the underlying quantities have to be modelled precisely. Papers usually cite it as a starting assumption and then explore where it breaks down.
In technology and industry
Engineering practice reuses Service virtualization in design rules, simulations and safety margins. Knowing the idea lets you read a specification sheet and understand why the numbers look the way they do.
In the classroom
Service virtualization is common in secondary-school and first-year university syllabi. It links to neighbouring topics Quality assurance, Software testing, so understanding it makes those chapters shorter.
In everyday life
Look for Service virtualization outside the textbook — in sport, cooking, traffic, electronics or the sky above you. An example you found yourself is remembered far longer than one you were given.
Ask Teacher Smith questions about this articleOpens your AI tutor with a question about “Service virtualization” →

How to study Service virtualization in 20 minutes

  1. Read the reference excerpt below once, without taking notes.
  2. Close the page and write down what Service virtualization means in your own words.
  3. Compare your version with the excerpt and mark what you missed.
  4. Work through the three examples above with pen and paper.
  5. Explain Service virtualization out loud to somebody else — or to Teacher Smith in the lgStudy chat.

Frequently asked questions

What is Service virtualization in simple terms?

In software engineering, service virtualization or service virtualisation is a method to emulate the behavior of specific components in heterogeneous component-based applications such as API-driven applications, cloud-based applications and service-oriented architectures. It is used to provide soft…

Why does Service virtualization matter?

Because it connects several computer science ideas at once: it gives you a definition you can apply, a quantity you can calculate, and a way to check whether a result is plausible.

How should I study Service virtualization?

Read the excerpt, restate it from memory, then work through the examples and applications listed on this page. The five-step study plan above takes about twenty minutes.

What does this page cover?

It gives you a compact reference excerpt plus original lgStudy explanations, examples, applications and study material on Service virtualization.

Tags

  • Quality assurance
  • Software testing

Keep exploring