This is an example of the Temporary deployment scenarios.
Service virtualization is “the ability to simulate service components” (e.g. dependencies of your SUT) “so that you are able to validate the behavior and performance of each of the components and how they interact as part of a composite application”. - ibm.com
That is, if you have a system under test (SUT) with dependencies that are expensive to use or difficult to deploy, then you can create virtual services (that are cheaper to use and easier to set up) to replace those dependencies during testing, to making testing cheaper, faster, more controllable, and more automatable.
This is the deployment that drove my requirement for a “teardown” of a deployed resource.
Actors: A User (a human) uses a Testing system (e.g. test automation provider) to perform automated testing (or management of execution of manual tests). This system consumes a Service Virtualization system in order to start up Virtual Services to virtualize dependencies of the SUT that are required by each test. The testing system can have test runs triggered by a Build system.
Set-up phase:
- The User sets up their tests in the Testing system.
- The User configures each test with the Virtual Service(s) that will be used to virtualize their dependencies.
- The Testing system observes that the Virtual Services require teardown when they are completed, and asks the user to confirm that this is what they intend.
- The User confirms this.
- The Testing system records the Virtual Services and the teardown requirement against the appropriate tests.
Execution phase:
- Automated Build system completes a build
- Automated Testing system starts preparing test environment to test that build
- Testing system reads its tests’ configuration to determine which virtual services need to be started
- Testing system requests that Virtualization system starts the appropriate virtual service(s)
- Virtualization system starts the virtual service(s) deploying
- Once that deployment has completed, the virtualization system indicates to the testing system that the deployment has completed
- Testing system runs the test(s)
- Testing system indicates to the virtualization system that the testing has completed (i.e. the virtual service instances are no longer required)
- Virtulization system tears down the virtual services
- Once the teardown has completed, the virtualization system frees up those resources for other clients
- (If there are more tests to be run, Testing system returns to step 3 for the next test.)
Having a client that can start virtual services but not stop them is not desirable, as otherwise we do not know when we can free up those resources.