
On Formalizing UML and OCL Features and Their Employment to Runtime Verification Lars Hamann, M. Sc. 27.02.2015 Kumulative Dissertation zur Erlangung des Grades eines Doktors der Ingenieurswissenschaften – Dr.-Ing. – Vorgelegt im Fachbereich 3 (Mathematik und Informatik) Universität Bremen Gutachter Prof. Dr. Martin Gogolla (Universität Bremen) Prof. Dr. Hans-Jörg Kreowski (Universität Bremen) Prof. Antonio Vallecillo Moreno (Universidad de Malaga) Datum des Promotionskolloquiums: 25. Februar 2015 In Memorial of Wilfried Nübel Hans-Jürgen Hamann 15. Mai 1927 20. Februar 1953 6. August 2013 23. März 1996 Abstract Model-driven development (MDD) has been identified as a promising approach for de- veloping software. By using abstract models of a system and by generating parts of the system out of these models, one tries to improve the efficiency of the overall development process and the quality of the resulting software. In the context of MDD the Unified Modeling Language (UML) and its related textual Object Constraint Language (OCL) have gained a high recognition. To be able to generate systems of high quality and to allow for interoperability between modeling tools, a well-defined semantics for these languages is required. This thesis summarizes published work in this context that employs an endogenous metamodeling approach to define the semantics of newer elements of the UML. While the covered elements are exhaustively used to define relations between elements of the metamodel of the UML, the UML specification leaves out a precise definition of their semantics. Our proposed approach uses models, not only to define the abstract syntax, but also to define the semantics of UML. By using UML and OCL for this, existing modeling tools can be used to validate the definition. The second part of this thesis covers work on the usage of UML and OCL models for runtime verification. It is shown how models can still be used at the end of a software development process, i. e., after an implementation has manually been added to generated parts, even though they are not used as central parts of the development process. This work also influenced the integration of protocol state machines into a modeling tool, which lead to publications about the runtime semantics of state machines and the capabilities to declaratively specify behavior using state machines. v Zusammenfassung Die modellgetriebene Entwicklung wird als ein vielversprechender Ansatz für die Soft- wareentwicklung angesehen. Durch die Verwendung von abstrakten Modellen als Grund- lage für die Codegenerierung wird versucht die Produktivität des Entwicklungsprozesses und die Qualität der erzeugten Produkte zu steigern. Im Kontext der modellgetriebenen Entwicklung haben sich die Unified Modeling Language (UML) als grafische Model- lierungssprache und die dazugehörige textuelle Object Constraint Language (OCL) als de-facto Standard etabliert. Damit qualitativ hochwertige Systeme aus Modellen dieser Sprachen erzeugt werden können und um die Interoperabilität von Modellierungswerkzeu- gen zu erhöhen ist eine wohldefinierte Semantik dieser Sprachen notwendig. Im ersten Teil dieser Arbeit werden Veröffentlichungen zusammmengefasst, die sich mit der modellbasierten Definition der Semantik von neueren UML Sprachelementen beschäftigen. Dieses semantische Modell der UML wird dabei mit Hilfe der UML selbst und zusätzlichen Regeln in OCL beschrieben. Ein Vorteil dieses endogenen Ansatzes ist, dass keine zusätzlichen Sprachen benötigt werden. Weiterhin können vorhandene UML und OCL Werkzeuge verwendet werden, um das erstellte semantische Modell zu validieren. Der zweite Teil dieser Arbeit beschreibt einen UML und OCL basierten Ansatz zur Laufzeitverifikation von Systemen. Die als UML und OCL Modell festgelegte Spezi- fikation eines Systems wird dabei während der Ausführung verifiziert. Dieses Vorgehen erhöht den Wert von Modellen innerhalb des Entwicklungsprozesses, da diese auch dann noch Verwendung finden, sollte das System nicht komplett aus dem Modell generiert wer- den. Die Entwicklung dieses Ansatzes führte darüber hinaus zu einer Integration von Protokollzustandsautomaten in ein Modellierungswerkzeug, da diese die Verifikations- möglichkeiten erhöhen. Dieses führte zu weiteren, in dieser Arbeit zusammengefassten Beiträgen über die Laufzeitsemantik dieser Automaten und über die zusätzlichen Mo- dellierungsmöglichkeiten. vii Acknowledgments I am very grateful to my supervisor Prof. Dr. Martin Gogolla for giving me the oppor- tunity to work in his research group. Not only the fruitful discussions about our work, but also his support in areas not covering our research made him a special person in my life. I also would like to thank Prof. Dr. Hans-Jörg Kreowski for taking the task as my co-supervisor and for examining this theses. Additional thanks go to Prof. Antonio Vallecillo for examining this theses as the third referee. I really enjoyed working in the database systems group where I met many people who influenced this work in several directions. I would like to thank my colleagues (in order of appearance) Dr. Fabian Bütt- ner, Mirco Kuhlmann, Oliver Hofrichter, Frank Hilken and Matthias Sedlmeier for their support and inspiring working atmosphere. A special thanks goes to Frank and Matthias for taking the burden of reviewing this thesis and giving me constructive feedback on how to improve it. I am glad that I had the possibility to discuss my research with people around several conferences, especially the vital community at the MODELS conferences. Finally, I would like to thank my mother Dagmar for supporting me in so many ways during my life, the Loosers for deepening my understanding about rules of games, and last but not least Inger who stayed with me even though she had the burden of getting into my life while I was finishing this thesis. ix Contents 1 Introduction 1 2 Background 5 2.1 The Unified Modeling Language (UML) .................. 5 2.1.1 Language Description ........................ 6 2.1.2 The UML Metamodel ........................ 10 2.2 The Object Constraint Language (OCL) . ................ 12 2.2.1 Language Description ........................ 13 2.3 The UML-based Specification Environment (USE) ............ 14 2.3.1 The USE Approach to Validation .................. 14 2.4 Runtime Verification ............................. 20 2.4.1 Specifying Properties . ...................... 21 2.4.2 Classification of Runtime Verification Techniques ......... 23 3 Formalizing and Applying UML and OCL 25 3.1 Endogenous Metamodeling Semantics . ................ 25 3.2 Static Structure Modeling .......................... 28 3.2.1 Subsetting and Derived Unions ................... 28 3.2.2 Derived Properties . ......................... 34 3.3 Behavior Modeling with Protocol State Machines . .......... 38 3.3.1 Design Time . ............................ 38 3.3.2 Runtime . ............................... 41 3.3.3 State Determination ......................... 45 3.4 Related Work . ............................... 47 4 Runtime Verification using UML and OCL 49 4.1 Platform Aligned Model ........................... 49 4.2 Runtime Snapshots .............................. 50 4.2.1 Snapshot Generation ......................... 50 4.2.2 Snapshot Synchronization ...................... 53 4.3 Runtime Monitoring in USE ......................... 54 4.3.1 Example System ........................... 55 4.3.2 Validating Operation Contracts ................... 55 4.3.3 Validating Protocol Usage ...................... 62 xi Contents 4.3.4 Target Platforms . .......................... 66 4.4 Abstraction Concepts ............................ 68 4.4.1 Abstracted Superclass . ....................... 68 4.4.2 Connected Instances . ....................... 70 4.4.3 Excluding Sub-Calls . ....................... 71 4.5 Limitations and Possible Solutions ..................... 72 4.5.1 Link Retrieval ............................ 72 4.5.2 Monitoring of Interfaces ....................... 73 4.6 Related Work . ................................ 74 5 Summary of Additional Contributions 77 5.1 OCL Community ............................... 77 5.2 Model Validation and Model Finding .................... 77 5.3 USE Applications and Extensions . .................... 78 5.4 Model-Driven Engineering in the Context of eGovernment . ...... 79 6 Conclusion and Future Work 81 6.1 Conclusion .................................. 81 6.2FutureWork................................. 82 Bibliography of the Author 83 Bibliography 87 Attached Publications of the Author 97 A15C Endogenous Metamodeling Semantics for Structural UML 2 Concepts 97 A19W OCL-Based Runtime Monitoring of JVM Hosted Applications .... 117 A21C OCL-Based Runtime Monitoring of Applications with Protocol State Machines.................................. 139 A22C On Integrating Structure and Behavior Modeling with OCL ..... 157 A24C Abstract Runtime Monitoring with USE ................ 177 xii List of Figures 2.1 Example Use Case Diagram ......................... 6 2.2 Use Case Described Using Natural Language . ............. 7 2.3 Class Diagram of the Running Example .................. 8 2.4 Sequence Diagram for a Borrow Scenario .................. 9 2.5 Communication Diagram of a Borrow Scenario .............. 10 2.6 UML Four-Level Metamodel Hierarchy . ................ 11 2.7 Use Case Diagram of the USE Approach to Validation .......... 16 2.8 Overview of Tasks and Artifacts for Model Checking ........... 22 2.9 Overview of Tasks and Artifacts for Runtime Verification ........ 22 3.1 Combined View of
Details
-
File Typepdf
-
Upload Time-
-
Content LanguagesEnglish
-
Upload UserAnonymous/Not logged-in
-
File Pages196 Page
-
File Size-