Business Integration Technologies © 2006 IBM Corporation Zurich Research Laboratory - BIT Validation of Model Transformations - First Experiences using a White Box Approach Jochen Küster 1, Mohamed Abd-El-Razik 2 1 IBM Research, 2 IBM Cairo Technology Development Center
Validation of Model Transformations © 2006 IBM Corporation 2 Zurich Research Laboratory - BIT Outline of the talk Model Transformations for Business Process Models Testing Techniques for Model Transformations Conclusions
Validation of Model Transformations © 2006 IBM Corporation 3 Zurich Research Laboratory - BIT IT Solution Business Process Model Business Requirements Business Model Technology BPEL, WSDL, J2EE, WebSphere Model refinement Model transformation business process monitoring, change of strategy Business-driven development comprises: Modeling of business processes Transformation and refinement of business process models Mapping of processes to Service-oriented Architecture Background: Business-Driven Development
Validation of Model Transformations © 2006 IBM Corporation 4 Zurich Research Laboratory - BIT Model Transformations on Business Process Models Cycle Removal Transformation Transformations for Abstraction and Refinement Transformations into a Normal Form (Control Action To Pinset) Control Action To Pinset transformation
Validation of Model Transformations © 2006 IBM Corporation 5 Zurich Research Laboratory - BIT Conceptual Rules for Transformation Design A B1B1 BnBn A B1B1 BnBn.. Conceptual rules capture the main concepts of the transformation Conceptual rules are refined into concrete rules by: –Replacing abstract node types with concrete ones –Replacing abstract edges with possible instantiations –Replacing abstract pin sets with possible instantiations large meta model and elaborate OCL constraints model transformation is implemented in Java using a transformation framework A Abstract node type: Abstract pinset: Abstract edge:
Validation of Model Transformations © 2006 IBM Corporation 6 Zurich Research Laboratory - BIT Outline of the talk Model Transformations for Business Process Models Testing Techniques for Model Transformations Conclusions
Validation of Model Transformations © 2006 IBM Corporation 7 Zurich Research Laboratory - BIT Motivation for Testing Model Transformations Statement: “Model Transformations are software too.” need to be properly tested in order to ensure their quality have specific characteristics that require special test case generation approaches Testing challenges: Generation of test cases from model transformation specifications Generation of test oracles for determining expected result of test
Validation of Model Transformations © 2006 IBM Corporation 8 Zurich Research Laboratory - BIT Fault Model for Model Transformations Fault Model: what errors are we looking for? Meta model coverage: Some input models are not transformed because conceptual rule has not been refined completely Syntactically incorrect models: Output model is not syntactically correct (e.g. OCL constraint violated) Semantically incorrect models: Output model is not semantically correct (e.g. Fork has been replaced by an implicit decision) Confluence errors: Transformation produces different outputs on the same (or equivalent) input model Correctness of transformation semantics: Transformation does not preserve a desired property
Validation of Model Transformations © 2006 IBM Corporation 9 Zurich Research Laboratory - BIT Meta model coverage testing (1) Goal: Ensure meta model coverage of a conceptual rule Approach: Convert conceptual rule into a template Make selected abstract elements concrete Parameterize remaining abstract elements by meta classes Conceptual rule: A B1B1 BnBn A B1B1 BnBn.. Y Z X Template(X,Y,Z): X={StartNode, Fork, Join, Decision, Merge, Task, Subprocess, LoopNode, Broadcast, AcceptSignal} Y={FinalNode, Fork, Join, Decision, Merge, Task, Subprocess, LoopNode, Broadcast, AcceptSignal, Map} Z={FinalNode, Fork, Join, Decision, Merge, Task, Subprocess, LoopNode, Broadcast, AcceptSignal, Map} Abstract pins and pin sets Concrete elements
Validation of Model Transformations © 2006 IBM Corporation 10 Zurich Research Laboratory - BIT Meta model coverage testing (2) Benefits: can be used for ensuring meta model coverage of implemented rules can be used for finding selected syntactic and semantic errors Drawbacks: properties that are not restricted to one rule cannot be validated Test Cases: Template can be used to generate test cases automatically Test cases can be used for automated testing
Validation of Model Transformations © 2006 IBM Corporation 11 Zurich Research Laboratory - BIT Constraint-based testing Goal: Ensure that the model transformation does not violate constraints (e.g. OCL constraints) Approach: Identify model elements changed by the transformation (automatable) Identify constraints that may be violated (automatable) Construct a test case for each constraint (manually) Constraint: A Loopnode has one regular output pin set Test case:
Validation of Model Transformations © 2006 IBM Corporation 12 Zurich Research Laboratory - BIT Rule Pair Testing (1) Goal: Find confluence errors by testing Background: confluence requires that application of rules on the same model always yields the same result rules can be analysed and verified whether they are confluent or not (see J. Küster, Definition and Validation of Model Transformations, SOSYM 5(3), September 2006 ) absence of complete specification of rules: Testing for confluence using suitable test cases
Validation of Model Transformations © 2006 IBM Corporation 13 Zurich Research Laboratory - BIT Rule Pair Testing (2) Approach: test cases obtained by constructing models by overlapping the left sides of two rules throw away incorrect models A B1B1 BnBn.. A2A2 C1C1 CnCn Rule r 3 Rule r 1 Possible test case obtained by overlapping: A 2 = Fork, B 1 = Decision
Validation of Model Transformations © 2006 IBM Corporation 14 Zurich Research Laboratory - BIT Conclusions and Future Work Model transformations need appropriate testing techniques in order to ensure their quality Testing techniques need to take into account fault model and implementation environment Meta model coverage, constraint-based and rule pairs for test cases proposed Future work: Automatic generation of test cases for constraints Tool support
Validation of Model Transformations © 2006 IBM Corporation 15 Zurich Research Laboratory - BIT Business Integration Zurich Research The Business Integration Technologies group is part of a world-wide research initiative on Model-Driven Business Transformation. BIT focuses on technologies for business-driven development. Integrate Transform Manage Monitor Model Process modeling methodologies Reference model customization Process model quality assurance Flow-driven and state-driven modeling Process Model Refinement Top-down and Bottom-up transformations - Analysis to Design model transformations - Capturing of IT requirements & architectural mismatches