M.RIFAD.PRIYANKA PERERA.
Model–driven System Testing
of Service Oriented Systems.
Outline
IntroductionBasic concepts.Testing Methodology.Test Meta Model.Test code generation.
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.
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.
Basic concepts
Basic structure of the TTS artifacts.
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.
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.
Testing Methodology
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 .
Platform Independent model.
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.
System meta model
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.
The stereotype Actor represents the roles which can invoke a service.
The abstract stereotype Parameter generalizes the stereotypes for input and output parameters.
Sample Booking system.
Test Meta model
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
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.
Sample Test story
Test-code generation• Consistency and coverage checks
• Adapter
• Code generation
• Test execution
• Architecture
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.
Consistency and coverage checks contd.
• Coverage rules – e.g.: compare the scenarios covered in the test model wrt system model.
• Consistency rules – e.g.:
Adapter• Adapter invokes the services in SUT.
• Test runner passes the arguments and calls the generated Adapter.
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
Adapter contd.
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.
Test execution• Test runner parses the TestSequence in the
test-model invokes the test stories in order.
Test execution contd.• TestData stored in a repository.
• Test-model or test runner should reference the repository.
Architecture
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.
Architecture contd. • TestSequence
– Execution order of the test stories.
• TestLog
– Logging API
• TestReport
– Result reporting framework
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 ?
Thank you
Top Related