ABSTRACT an OCL-Based Verification Approach to Analyzing
Total Page:16
File Type:pdf, Size:1020Kb
ABSTRACT An OCL-based Verification Approach to Analyzing Static Properties of a UML Model Wuliang Sun, M.S. Mentor: Eunjee Song, Ph.D. There is a need for more rigorous analysis techniques that developers can use for verifying the critical properties in UML models. The UML-based Specification Environment (USE) tool supports verification of invariants, preconditions, and post- conditions specified in the Object Constraint Language (OCL), which is useful when checking critical properties. However, the USE requires one to specify a model using its own textual language and does not allow one to import any model specification files created by other UML modeling tools. Hence, we often create a model with OCL constraints using a modeling tool such as the IBM Rational Software Architect (RSA) and then use the USE for the model verification. This approach, however, requires a manual transformation between two different specification formats, which diminishes the benefit of model-level verification. In this thesis, we describe our own implementation of a specification transformation engine based on the Model-Driven Architecture (MDA) framework. An OCL-based Verification Approach to Analyzing Static Properties of a UML Model by Wuliang Sun, B.S. A Thesis Approved by the Department of Computer Science Donald L. Gaitros, Ph.D., Chairperson Submitted to the Graduate Faculty of Baylor University in Partial Fulfillment of the Requirements for the Degree of Master of Science Approved by the Thesis Committee Eunjee Song, Ph.D., Chairperson Paul C. Grabow, Ph.D. Randal L. Vaughn, Ph.D. Accepted by the Graduate School May 2010 J. Larry Lyon, Ph.D., Dean Page bearing signatures is kept on file in the Graduate School. Copyright c 2010 by Wuliang Sun All rights reserved TABLE OF CONTENTS LIST OF FIGURES vii LIST OF TABLES x ACKNOWLEDGMENTS xi DEDICATION xii 1 Introduction 1 1.1 Managing Complexity with Model-Driven Architecture Framework . 1 1.2 Using UML/OCL for Model Verification . 2 1.3 Research Overview. 6 1.4 Structure of Thesis . 8 2 Background and Related Work 10 2.1 Model Driven Architecture . 11 2.1.1 MDA Framework . 11 2.1.2 Transformation . 13 2.2 Eclipse Modeling Framework . 14 2.3 Modeling Tools . 15 2.3.1 Acceleo . 16 2.3.2 ArgoUML . 16 2.3.3 Fujaba . 17 2.3.4 MOSKitt . 17 2.3.5 Objecteering . 18 iii 2.3.6 Rational Software Architect . 18 2.3.7 Rational Software Modeler . 19 2.3.8 Rhapsody . 19 2.3.9 Together 2008 . 20 2.3.10 Comparison of the Nine Modeling Tools . 20 2.4 Model Analysis Tools . 21 2.4.1 OCL-Based Model Analysis Tools . 22 2.4.2 Other Model Analysis Tools . 25 2.4.3 Summary Model Analysis Tools . 28 3 Model-based Property Verification Overview 30 3.1 Specifying a Motivation Model Example using RSA . 31 3.2 Transforming a Model for Verification . 36 3.3 Verifying a Model using the USE Tool . 37 3.4 Summary . 45 4 XMI to USE Transformation 47 4.1 XMI to USE Transformation Overview . 49 4.2 A Transformation Example . 50 4.3 Defining Transformation . 53 4.3.1 Generating the USE Specification Metamodel . 53 4.3.2 UML Metamodels Supported by RSA and USE . 57 4.3.3 Transformation Rules . 61 4.3.4 Mapping Completeness. 63 4.3.5 Issues in Defining Transformation . 64 4.4 Transforming Sequence Diagrams for the USE Tool . 68 4.5 Transformation Summary . 71 iv 5 Evaluation 73 5.1 Case Study . 73 5.1.1 An Introduction to EU-Rent Car Rentals . 73 5.1.2 Static Model of EU-Rent Car Rentals . 77 5.1.3 Dynamic Model of EU-Rent Car Rentals . 78 5.1.4 Case Study Summary . 83 5.2 Evaluation According to Criteria from Related Model Verification Approaches . 84 5.3 Evaluation Conclusions . 86 6 Future Work and Conclusion 87 6.1 Further XMI2USE Exploration . 88 6.1.1 Combined Fragment Support . 88 6.1.2 Message Type Support . 88 6.1.3 Stereotype Support . 88 6.2 Further XMI2USE Implementation Enhancement . 89 6.2.1 XMI Specification Enhancement . 89 6.2.2 Modeling Tools Support . 89 6.2.3 From USE to XMI Transformation . 90 6.3 Conclusion . 90 A XMI2USE Tool Implementation 93 A.1 Packages Structure . 93 A.2 Main Classes . 93 A.3 User Manual . 95 B Transformation Details based on MDA 97 v C Class Diagrams and OCL Constraints of EU-Rent Car Rental for Events Modeling 99 C.1 Existence Events . 99 C.2 Customer Management Events . 99 C.3 Pricing and Discounting Management Events . 101 C.4 Car Allocation Events . 101 C.5 Car Preparation and Maintenance Events . 102 C.6 Car Management Events. 102 C.7 Branch, Car Group and Models Management Events . 104 C.8 Performance Indicators Events . 105 C.9 Car Return Events . 105 BIBLIOGRAPHY 107 vi LIST OF FIGURES 1.1 UML Diagrams . 4 1.2 Class Model with OCL Constraints . 5 1.3 Object Model . 6 3.1 Hierarchical RBAC Class Model . 32 3.2 An Object Model based on the RBAC Policy . 33 3.3 Behavior of User Role Assignment with Control Flow . 34 3.4 Three Independent Interactions without Control Flow from Fig. 3.3 . 38 (a) .................................... 38 (b) .................................... 38 (c) .................................... 38 3.5 Sequence Diagram in USE generated for Fig. 3.4a . 39 3.6 Sequence Diagram in USE generated for Fig. 3.4b . 40 3.7 Sequence Diagram in USE generated for Fig. 3.4c . 41 3.8 Revised User Role Assignment Model from Fig. 3.3 . 43 3.9 One Sequence Branch from Fig. 3.8 . 44 3.10 Revised User Role Assignment Model from Fig. 3.8 . 46 4.1 XMI to USE Transformation Overview . 49 4.2 Company Model . 50 4.3 A Portion of the XMI Specification Exported from RSA . 51 4.4 USE Specification of Company Model . 52 4.5 Metamodel of the USE Specification . 53 4.6 Grammarware-to-Modelware Framework Overview (from [WK06]) . 54 4.7 Scope of the Transformation . 58 4.8 UML 1.3 Metamodel of Class Models . 59 vii 4.9 UML 2.1 Metamodel of Class Models . 59 4.10 A Mapping Rule for the Class Element . 63 4.11 Metamodel for OCL Types . 65 4.12 UML Metamodel of Sequence Models (from [spe06b]) . 68 4.13 A Sequence Diagram Example with an Alternative Combined Fragment (from [spe06b]) . ..