ebook img

Modeling and Analyzing Software Behavior in UML PDF

191 Pages·2001·0.62 MB·English
by  
Save to my drive
Quick download
Download
Most books are stored in the elastic cloud where traffic is expensive. For this reason, we have a limit on daily download.

Preview Modeling and Analyzing Software Behavior in UML

Modeling and Analyzing Software Behavior in UML Ivan Porres To be presented |with the permission of the Faculty of Chemical Engineer- ing at ”Abo Akademi University| for public criticisms in Auditorium 3102 at DataCity in Turku, Finland, on November 23, 2001, at 12 noon. Department of Computer Science ”Abo Akademi University Supervised by Professor Ralph Back Department of Computer Science ”Abo Akademi University Lemmink˜aisenkatu 14A 20520 Turku Finland Reviewed by Professor Michael Butler Declarative Systems & Software Engineering Group University of Southampton Highfleld Southampton SO17 1BJ United Kingdom Professor Wang Yi Department of Computer Science Uppsala University Box 325, SE-75105 Uppsala Sweden ISBN 951-29-2169-3 ISSN 1239-1883 Painosalama Oy, 2001 Turku, Finland To my family The Heart of Gold’s Improbability Drive made it the most powerful and unpredictable ship in existence. There was nothing it couldn’t do, provided you knew exactly how improbable it was the thing you wanted it to do would ever happend. | Douglas Adams, The Hitch Hiker’s Guide to the Galaxy Acknowledgements This thesis is not the product of the work of a single person. After several years on the making, I am now really glad to be able to thank to everybody that has contributed in one or another way to this thesis. I think of researching as a similar experience as steering Douglas Adam’s Heart of Gold: There is nothing impossible, provided you know exactly what you really want to do. Fortunately, I had my supervisor Professor Ralph-Johan Backhelpingmeonthistask. Hehasbeenaconstantsourceofadvice,guidance and support during all this time. I also want to thank Professor Michael Butler of the University Southamp- ton, United Kingdom, and Professor Wang Yi of the University of Uppsala, Sweden, who kindly reviewed the thesis. They provided many constructive comments to improve it and I hope that I have been able to follow and in- tegrate all their suggestions in this manuscript. Damon Tringham patiently corrected all the misuses of beautiful English language. Most of the ideas presented in this thesis appeared in their initial form in several conference proceedings and a journal publication. These publications were coauthored by Professor Ralph-Johan Back and also by Professor Johan Lilius and Luigia Petre. My collaboration with them was not only scientiflcally fruitful but also a warm personal experience. Other colleagues from ”Abo Akademi University have also help me greatly in my research. Christina Cerschi, Professor Hannu Toivonen, Mauno Ro˜nkk˜o and Professor Joakim von Wright provided many interesting comments in our enlighteningdiscussionsonthetopicsdiscussedinthethesis. RobertGyllenberg and Marat Vagapov built the hardware of the digital sound recorder and made the validation of its design possible. The Turku Centre for Computer Science and the Department of Computer Science provided an excellent working environment and generous flnancial sup- port. I want to express my sincere thanks to all my colleagues for contributing toaninspiringworkingatmosphere. Dr. MatsAspn˜asprovidedreliableanswers to the most diverse questions. Dr. Martin Bu˜chi, Dr. Anna Mikhajlova and Dr. LeonidMikhajlovwereanexcellentrolemodeltofollow. Icanonlywishto all my fellow PhD. students and specially to Dag Bjo˜rklund, Luka Milovanov, i Franck Tetard, Vioerel Preoteasa, Seppo Virtanen and of course, Christina, Luigia and Mauno the best for their studies. Finally, I want to thank my family and friends and specially to ”Asa, for their continuous and unconditional love and support, wherever I am. Turku, October 4 2001 Ivan Porres ii Contents 1 Introduction 1 1.1 Introduction . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1 1.2 UML . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2 1.2.1 Semantics of UML . . . . . . . . . . . . . . . . . . . . . . 3 1.2.2 Formal semantics . . . . . . . . . . . . . . . . . . . . . . . 5 1.3 The Quality of UML models . . . . . . . . . . . . . . . . . . . . . 6 1.4 Analyzing UML Models . . . . . . . . . . . . . . . . . . . . . . . 7 1.4.1 Analyzing Use Cases . . . . . . . . . . . . . . . . . . . . . 9 1.4.2 Analyzing Statecharts . . . . . . . . . . . . . . . . . . . . 10 1.4.3 Hybrid Statecharts . . . . . . . . . . . . . . . . . . . . . . 11 1.5 List of Publications . . . . . . . . . . . . . . . . . . . . . . . . . . 11 2 Modeling in UML 13 2.1 Introduction . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 13 2.2 Object-Oriented Software Development . . . . . . . . . . . . . . 14 2.3 UML . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 16 2.3.1 OCL . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 16 2.3.2 Tool Support . . . . . . . . . . . . . . . . . . . . . . . . . 17 2.3.3 Proflles . . . . . . . . . . . . . . . . . . . . . . . . . . . . 18 2.3.4 UML is just a Modeling Language . . . . . . . . . . . . . 19 2.4 Requirements of the Sound Recorder . . . . . . . . . . . . . . . . 19 2.5 Analysis: Object Structure . . . . . . . . . . . . . . . . . . . . . 24 2.5.1 Identifying Objects . . . . . . . . . . . . . . . . . . . . . . 28 2.5.2 Building the Class Diagrams . . . . . . . . . . . . . . . . 29 2.6 Analysis: Deflning Object Behavior . . . . . . . . . . . . . . . . . 38 2.6.1 The User Interface . . . . . . . . . . . . . . . . . . . . . . 39 2.7 Architectural Design . . . . . . . . . . . . . . . . . . . . . . . . . 39 2.7.1 Architectural Patterns . . . . . . . . . . . . . . . . . . . . 42 2.7.2 Concurrency Design . . . . . . . . . . . . . . . . . . . . . 43 2.8 Mechanistic Design . . . . . . . . . . . . . . . . . . . . . . . . . . 43 iii 2.8.1 Collaboration Between the Hardware and the Reactive Objects. . . . . . . . . . . . . . . . . . . . . . . . . . . . . 44 2.8.2 CollaborationBetweentheReactiveObjectsandtheUser Interface . . . . . . . . . . . . . . . . . . . . . . . . . . . . 44 2.8.3 Pattern: Reactive Subject . . . . . . . . . . . . . . . . . . 44 2.8.4 Scheduler . . . . . . . . . . . . . . . . . . . . . . . . . . . 46 2.8.5 Changing the Time . . . . . . . . . . . . . . . . . . . . . . 46 2.8.6 Playing a Message . . . . . . . . . . . . . . . . . . . . . . 47 2.9 Detailed Design . . . . . . . . . . . . . . . . . . . . . . . . . . . . 47 2.9.1 Objects Modeling the Hardware . . . . . . . . . . . . . . 47 2.9.2 Sound Compression Algorithm . . . . . . . . . . . . . . . 49 2.9.3 Using Direct Memory Access Channels . . . . . . . . . . . 49 2.9.4 Memory Allocation . . . . . . . . . . . . . . . . . . . . . . 52 2.10 Comments on the Implementation . . . . . . . . . . . . . . . . . 52 2.11 Conclusions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 53 3 Analyzing Use Case Models as Contracts 57 3.1 Introduction . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 57 3.2 Use Cases . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 59 3.2.1 Why Use Cases? . . . . . . . . . . . . . . . . . . . . . . . 60 3.3 Contracts . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 64 3.4 Example: Library . . . . . . . . . . . . . . . . . . . . . . . . . . . 69 3.5 Analysis . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 76 3.5.1 Proving properties . . . . . . . . . . . . . . . . . . . . . . 77 3.6 Related Work . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 83 3.7 Conclusions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 85 4 Statecharts 87 4.1 Introduction . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 87 4.2 Structure of State Machines . . . . . . . . . . . . . . . . . . . . . 88 4.3 Dynamics of State Machines . . . . . . . . . . . . . . . . . . . . . 94 4.3.1 Calculation of the Step . . . . . . . . . . . . . . . . . . . 95 4.3.2 The Run-To-Completion Step . . . . . . . . . . . . . . . . 99 4.3.3 Other model elements . . . . . . . . . . . . . . . . . . . . 103 4.4 Interaction diagrams . . . . . . . . . . . . . . . . . . . . . . . . . 103 4.4.1 Particular Comments on the Semantics . . . . . . . . . . 104 4.5 Conclusions and Related work . . . . . . . . . . . . . . . . . . . . 105 5 Veriflcation of Collaborations of Statecharts 107 5.1 Introduction . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 107 5.2 Modeling Concurrent Systems with Statecharts . . . . . . . . . . 108 5.2.1 Describing Properties of a Model . . . . . . . . . . . . . . 111 iv 5.2.2 Collaboration of objects . . . . . . . . . . . . . . . . . . . 113 5.3 The vUML Tool . . . . . . . . . . . . . . . . . . . . . . . . . . . 115 5.3.1 Open Models . . . . . . . . . . . . . . . . . . . . . . . . . 116 5.3.2 Structure of the PROMELA Model . . . . . . . . . . . . . 117 5.3.3 Veriflcation with SPIN . . . . . . . . . . . . . . . . . . . . 122 5.3.4 Representation of Counter-Examples . . . . . . . . . . . . 123 5.4 Example: The Production Cell . . . . . . . . . . . . . . . . . . . 124 5.4.1 Modeling the Press . . . . . . . . . . . . . . . . . . . . . . 126 5.4.2 Modeling the robot . . . . . . . . . . . . . . . . . . . . . . 129 5.4.3 Veriflcation . . . . . . . . . . . . . . . . . . . . . . . . . . 130 5.5 Conclusions and Related Work . . . . . . . . . . . . . . . . . . . 133 5.5.1 Evaluation of the tool . . . . . . . . . . . . . . . . . . . . 133 5.5.2 Related work . . . . . . . . . . . . . . . . . . . . . . . . . 135 6 Real-Time and Hybrid Behavior in Statecharts 137 6.1 Introduction . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 137 6.2 Hybrid Statecharts . . . . . . . . . . . . . . . . . . . . . . . . . . 138 6.3 Action Systems . . . . . . . . . . . . . . . . . . . . . . . . . . . . 140 6.4 Continuous Action Systems . . . . . . . . . . . . . . . . . . . . . 143 6.4.1 Semantics of Continuous Action Systems . . . . . . . . . 145 6.4.2 Systems Using Difierential Equations . . . . . . . . . . . . 148 6.4.3 Real-Time Systems . . . . . . . . . . . . . . . . . . . . . . 148 6.4.4 Composition of Continuous Action Systems . . . . . . . . 148 6.5 From Statecharts to Continuous Action Systems . . . . . . . . . 149 6.5.1 Transitions . . . . . . . . . . . . . . . . . . . . . . . . . . 151 6.5.2 Examples . . . . . . . . . . . . . . . . . . . . . . . . . . . 152 6.6 Safety Properties . . . . . . . . . . . . . . . . . . . . . . . . . . . 155 6.6.1 Proving the Safety of the Press . . . . . . . . . . . . . . . 156 6.7 Conclusions and Related Work . . . . . . . . . . . . . . . . . . . 161 7 Conclusions 163 v vi

Description:
analysis stages, even when we still do not have a clear idea of how our system will look. We can refine and .. An action system is a construction in the refinement calculus used to model concurrent and .. stereotype. A tagged value is a piece of additional data that we can add to each model element
See more

The list of books you might like

Most books are stored in the elastic cloud where traffic is expensive. For this reason, we have a limit on daily download.