Test Virtualization

Test virtualization is about virtualizing the dependencies of a component to other components and resources. In Non-virtualized Test (Functional Test), test virtualization can be used for simulating component responses. A virtual component, also called a stub, can be used when creating tests of a component that has not yet been implemented. The stub then acts as the real component and a developer or tester is able to create the tests simultaneous with the development of the real component. A stub can also be used for simulating the response of a sub module to the component under test. Simulating sub modules allow us to go from black-box testing where we only know about the interface of the program to white-box testing where we know about the internals of the component under test. We are able to achieve much higher code coverage when we use test virtualization and can control the responses of sub modules in a test.

In Non-virtualized Test (Functional Test) it is possible to create stubs for a component. A stub represents a static response from the component. The module does not have to exist, but it must be defined in the repository. The static response is called a Stub because it represents one dummy response from a component with specific data. Stubs can be used when executing a component. If the stub is of the component itself, the component will not be executed. Instead the stub result will be returned. If the stub is of another component, it will be used by Non-virtualized Test (Functional Test) to virtualize any sub module calls to that component that might exist for the component under test. We also say that we are stubbing the sub module with a stub.

Stubs can be created and used in Eclipse and the web client and they can be saved and reused in the repository. The following sections will explain the use of stubs in details using the two clients.