This paper presents a model-driven approach for testing service-oriented systems. A test meta-model is defined using UML profiles for the system and test models. Test models can be checked for consistency and coverage and transformed into executable test code via adapters. Adapters invoke services in the system under test and test runners execute the generated test code in order defined by test sequences. The approach aims to generate test code from models in early stages of development and integrate with IDEs and testing frameworks.
3. Introduction
This paper presents an approach for model–driven
system testing of service oriented systems.
presents test model transformation and adapter
concept.
Testmodels can be statically checked and directly
transformed into executable test code via a
metamodel.
4. The connection to the system services under test is
established via flexible adapters that can be
automatically generated in many cases.
This flexible adapter concept allows for defining
executable test–model integrated with the
requirements specification in a very early stage of the
system development process.
6. The system model: Describes the system
requirements at business level.
The system implementation: Also called the system
under test (SUT) provides services callable by the
test implementation.
The test model: Contains the test case specifications
developed in an incremental process. Test stories can
be seen as high level descriptions of the test
requirements.
7. The test implementation:
Generated by a compiler which transforms test story
files into source code files, so called test code, of the
execution language. Service adapters make the
abstract service calls. Will be discussed in more detail.
9. The first step in the development process is the
iterative design of a test and a system model.
Adapters will be generated.
Test code generation and test execution by test
engine .
11. META MODEL
The metamodel for system and test modeling of
service oriented systems has been defined as UML
profile.
a) System Metamodel.
b) Test meta model.
13. The System stereotype represents the whole test
system including services and actors.
The abstract stereotype Service generalizes System
Service-service with a business functionality.
Configuration Service-Need for testing purposes.
14. The stereotype Actor represents the roles which can
invoke a service.
The abstract stereotype Parameter generalizes the
stereotypes for input and output parameters.
17. The stereotype Servicecall refers to a service invoked
by an actor instance of type Caller with concrete
input and output values of type Value. It also has a
timeout after which it is canceled.
The stereotype Reference refers to other stories
which can be called within a test story
18. The stereotype Assertion allows for defining
assertions for computing the test verdict.
The stereotype ParallelTask allows for executing the
same flow a specific number of times (tasknumber)
in parallel.
21. Consistency and coverage checks
• Schema for test model defined in the meta-
model.
• Consistency and coverage rules are part of the
schema.
• TSChecker component performs the
validation.
• Checks are coded in OCL.
22. Consistency and coverage
checks contd.
• Coverage rules – e.g.: compare the scenarios
covered in the test model wrt system model.
• Consistency rules – e.g.:
23. Adapter
• Adapter invokes the services in SUT.
• Test runner passes the arguments and calls
the generated Adapter.
24. Adapter contd.
• Each service call in invoked asynchronously in
a separate thread.
• Invoke() call in the abstract adapter is a
wrapper around the private adapter methods
in the concrete implementations.
• Service proxies may be generated using WSDL
26. Code generation
• Test-model to test-code transformation.
• Nodes in the test-model are visited and
generates code based on details present in the
nodes, parameters and connections.
• TSCompiler translates test stories defined in
the model to test code.
27. Test execution
• Test runner parses the TestSequence in the
test-model invokes the test stories in order.
28. Test execution contd.
• TestData stored in a repository.
• Test-model or test runner should reference
the repository.
30. Architecture contd.
• TSChecker
Validates the test-model and system-model
against meta-model and each other.
• TSCompiler
Transform test model into programming
language code
• TSTestCotroller
Test executing life cycle handler.
32. Discussion
Authors plan to automate test data generation.
Test mode may be made to generate from the
system model ?
Integration with IDEs and test and logging and
reporting frameworks ?