Analysing UML Active Classes and Associated State Machines

Total Page:16

File Type:pdf, Size:1020Kb

Analysing UML Active Classes and Associated State Machines Analysing UML Active Classes and Asso ciated State Machines A Lightweight Formal Approach G Reggio E Astesiano C Choppy and H Hussmann DISI Universita di Genova Italy LIPN Institut Galilee Universite Paris XI I I France Department of Computer Science Dresden University of Technology Germany Abstract We consider the problem of precisely dening UML active classes with an asso ciated state chart We are convinced that the rst step to make UML precise is to nd an underlying formal mo del for the systems mo delled by UML We argue that lab elled transition systems are a sensible choice indeed they have worked quite successfully for languages as Ada and Java Moreover we think that this mo delization will help to understand the UML constructs and to improve their use in practice Here we present the lab elled transition system asso ciated with an active class using the algebraic sp ecication language CASL The task of making precise this fragment of UML raises many questions ab out b oth the precise meaning of some constructs and the soundness of some allowed combination of constructs Intro duction The Unied Mo deling Language UML is an industry standard language for sp eci fying software systems This language is unique and imp ortant for several reasons UML is an amalgamation of several in the past comp eting notations for ob ject oriented mo delling For a scientic approach it is an ideal vehicle to discuss funda mental issues in the context of a language used in industry Compared to other pragmatic mo delling notations in Software Engineering UML is very precisely dened and contains large p ortions which are similar to a formal sp ecication language as the OCL language used for the constraints It is an imp ortant issue in Software Engineering to nally close the gap b etween prag matic and formal notations and to apply metho ds and results from formal sp ecication to the more formal parts of UML This pap er presents an approach contributing to this goal and has b een carried out within the Europ ean Common Framework Initiative CoFI for the algebraic sp ecication of software and systems partially supp orted by the EU ESPRIT program Within the CoFI initiative which brings together research institutions from all over Europ e a sp ecication language called Common Algebraic Sp ecication Language CASL was develop ed which intends to set a standard unifying the various approaches to algebraic sp ecication and sp ecication of abstract data typ es It is a goal of the CoFI group to closely integrate its work into the world of practical engineering As far as sp ecication languages are concerned this means an integration with UML which may form the basis for extensions or exp erimental alternatives to the use of OCL That would allow for instance to sp ecify userdened data typ es that just have values but do not b ehave like ob jects to use algebraic axioms as a constraints These new constraints may cover also b ehavioural asp ects b ecause there exist extensions of algebraic languages that are able to cover with them whereas OCL do es not seem to have any supp ort for concurrency The longterm p ersp ective of this work is to build a bridge b etween UML sp ecications and the p owerful animation and verication to ols that are available for algebraic sp ecications To this end we need to precisely understanding formally dening the most relevant UML features In this pap er we present the results of such formalization work which was guided by the following ideas Real UML Our concern is the real UML ie all or b etter almost all its features without simplications and or idealizations We are not going to consider a small OO language with a UML syntax but just what it is presented in the ocial OMG do cu mentation shortly UML from now on Based on an underlying mo del We are convinced that the rst step to make UML precise is to nd an underlying formal mo del for the systems mo delled by UML in the following called UMLsystems Our conviction also comes from a similar exp erience the two rst authors had many years ago when tackling the problem of the full formal denition of Ada within the ocial EU pro ject see There to o an underlying mo del was absolutely needed to clarify the many ambiguities and unanswered questions in the ANSI Manual We argue that lab elled transition systems could b e a sensible mo del choice indeed they were used quite successfully to mo del concurrent languages as Ada but also a large part of Java Lightweight formalization By lightweight we mean made by using the most simple formal to ols and techniques precisely lab elled transition systems algebraically sp ecied using a small subset of the sp ecication language CASL conditional sp ecica tion with initial semantics Integrated with the formalization of the other fragments of UML In contrast to many other pap ers on UML semantics we more or less ignore the issue of class diagram 1 semantics here and concentrate on the state machines However the ultimate goal of this work is to have an approach by which it is easily p ossible to integrate semantically the most relevant diagram typ es For this reason we are using an algebraic approach to the semantics of state machines since it is well known that class diagrams can b e mapp ed relatively easily onto algebraic sp ecications The algebraic semantics describ ed here enables an algebraic access to the semantics also of active not only of passive classes Usually an active class is statically describ ed in the class diagram and dynamically describ ed in an asso ciated statechart diagram The formalization of active classes and state machines has lead to p erform a thor ough analysis of them uncovering many problematic p oints Indeed the ocial informal semantics of UML rep orted in UML is in some p oints either incomplete or ambigu ous or inconsistent or dangerous ie the semantics is clearly formulated but the allowed usages seem problematic from a metho dological p oint of view To stress this asp ect and PROBLEM to highlight them to help the reader we have used the mark pattern In Sect we dene the subset of the active classes with state machines that we con sider Then in Sect and we intro duce the used formal techniques lab elled transition 1 Following UML terminology state machine is the abstract name of the construct whereas state chart is the name of the corresp onding diagram here we always use the former systems and algebraic sp ecications and present step after step how we have built the lts mo delling the ob jects of an active class with an asso ciated state machine Due to lack of ro om part of the denition is rep orted in App endix A while the complete formal mo del rather short and simple is in Intro ducing UML Active Classes and State Machines The UML denes a visual language consisting of several diagram typ es These diagrams are strongly interrelated by a common abstract syntax and are also related in their semantics The semantics of the diagrams is currently dened by informal text only The most imp ortant diagram typ es for the direct description of ob jectoriented soft ware systems are the following Class diagrams dening the static structure of the software system ie essentially the used classes their attributes and op erations p ossible asso ciations relationships b etween them and the inheritance structure among them Classes can b e passive in which case the ob jects are just data containers For this pap er we are interested in active classes where each ob ject has its own threads of control Statechart diagrams state machines dening the dynamic b ehaviour of an individ ual ob ject of a class over its lifetime This diagram typ e is very similar to traditional Statecharts However UML has mo died syntax and semantics according to its over all concepts Interaction diagrams illustrating the interaction among several ob jects when carrying out jointly some use case Interaction diagrams can b e drawn either as sequence diagrams or as collab oration diagrams with almost identical semantics but dierent graphical representation A UML state machine is very similar to a classical nite state machine It depicts states drawn as rounded b oxes carrying a name and transitions b etween the states A transition is decorated by the name of an event p ossibly followed by a sp ecication of some action after a slash symb ol The starting p oint for the state machine is indicated by a solid black circle an end p oint by a solid circle with a surrounding line The complexity of UML state machines compared to traditional nite state machines comes from several origins The states are interpreted in the context of an ob ject state so it is p ossible to make reference eg in action expressions to ob ject attributes There are constructs for structuring state machines in hierarchies and even concur rently executed regions There are many sp ecialized constructs like entry actions which are red whenever a state is entered or state history indicators In order to simplify the semantical consideration in this pap er we assume the follow ing restrictions of dierent kinds Please note that none of these assumptions restricts the basic applicability of our semantics to full UML state machines We do not consider the following UML state machine constructs b ecause they can b e replaced by equivalent combinations of other constructs Submachines We can eliminate submachines by replacing each stub state with the corresp onding submachine as UML p states It is a shorthand that implies a macrolike expansion by another state machine and is semantically
Recommended publications
  • UML Tutorial: Part 1 -- Class Diagrams
    UML Tutorial: Part 1 -- Class Diagrams. Robert C. Martin My next several columns will be a running tutorial of UML. The 1.0 version of UML was released on the 13th of January, 1997. The 1.1 release should be out before the end of the year. This col- umn will track the progress of UML and present the issues that the three amigos (Grady Booch, Jim Rumbaugh, and Ivar Jacobson) are dealing with. Introduction UML stands for Unified Modeling Language. It represents a unification of the concepts and nota- tions presented by the three amigos in their respective books1. The goal is for UML to become a common language for creating models of object oriented computer software. In its current form UML is comprised of two major components: a Meta-model and a notation. In the future, some form of method or process may also be added to; or associated with, UML. The Meta-model UML is unique in that it has a standard data representation. This representation is called the meta- model. The meta-model is a description of UML in UML. It describes the objects, attributes, and relationships necessary to represent the concepts of UML within a software application. This provides CASE manufacturers with a standard and unambiguous way to represent UML models. Hopefully it will allow for easy transport of UML models between tools. It may also make it easier to write ancillary tools for browsing, summarizing, and modifying UML models. A deeper discussion of the metamodel is beyond the scope of this column. Interested readers can learn more about it by downloading the UML documents from the rational web site2.
    [Show full text]
  • Plantuml Language Reference Guide (Version 1.2021.2)
    Drawing UML with PlantUML PlantUML Language Reference Guide (Version 1.2021.2) PlantUML is a component that allows to quickly write : • Sequence diagram • Usecase diagram • Class diagram • Object diagram • Activity diagram • Component diagram • Deployment diagram • State diagram • Timing diagram The following non-UML diagrams are also supported: • JSON Data • YAML Data • Network diagram (nwdiag) • Wireframe graphical interface • Archimate diagram • Specification and Description Language (SDL) • Ditaa diagram • Gantt diagram • MindMap diagram • Work Breakdown Structure diagram • Mathematic with AsciiMath or JLaTeXMath notation • Entity Relationship diagram Diagrams are defined using a simple and intuitive language. 1 SEQUENCE DIAGRAM 1 Sequence Diagram 1.1 Basic examples The sequence -> is used to draw a message between two participants. Participants do not have to be explicitly declared. To have a dotted arrow, you use --> It is also possible to use <- and <--. That does not change the drawing, but may improve readability. Note that this is only true for sequence diagrams, rules are different for the other diagrams. @startuml Alice -> Bob: Authentication Request Bob --> Alice: Authentication Response Alice -> Bob: Another authentication Request Alice <-- Bob: Another authentication Response @enduml 1.2 Declaring participant If the keyword participant is used to declare a participant, more control on that participant is possible. The order of declaration will be the (default) order of display. Using these other keywords to declare participants
    [Show full text]
  • Semantic Based Model of Conceptual Work Products for Formal Verification of Complex Interactive Systems
    Semantic based model of Conceptual Work Products for formal verification of complex interactive systems Mohcine Madkour1*, Keith Butler2, Eric Mercer3, Ali Bahrami4, Cui Tao1 1 The University of Texas Health Science Center at Houston, School of Biomedical Informatics, 7000 Fannin St Suite 600, Houston, TX 77030 2 University of Washington, Department of Human Centered Design and Engineering Box 352315, Sieg Hall, Room 208 Seattle, WA 98195 3 Brigham Young University Computer Science Department, 3334 TMCB PO Box 26576 Provo, UT 84602-6576 4 Medico System Inc. 10900 NE 8th Street Suite 900 Bellevue, WA 98004 * Corresponding author, email: [email protected], phone: (+1) 281-652-7118 Abstract - Many clinical workflows depend on interactive computer systems for highly technical, conceptual work 1. Introduction products, such as diagnoses, treatment plans, care Many critical systems require highly complex user interactions coordination, and case management. We describe an and a large number of cognitive tasks. These systems are automatic logic reasoner to verify objective specifications common in clinical health care and also many other industries for these highly technical, but abstract, work products that where the consequences of failure can be very expensive or are essential to care. The conceptual work products risky to human safety. Formal verification through model specifications serve as a fundamental output requirement, checking could reduce or prevent system failures, but several which must be clearly stated, correct and solvable. There is technical obstacles must be solved first. strategic importance for such specifications because, in We focus here on the abstract products of conceptual work turn, they enable system model checking to verify that that are foundational requirements that must be part of machine functions taken with user procedures are actually verification in a modern health care systems.
    [Show full text]
  • Component Diagrams
    1.COMPONENT DIAGRAMS 2. PACKAGE DIAGRAMS What is a component? – A component is an autonomous unit within a system – UML component diagrams enable to model the high-level software components, and the interfaces to those components – Important for component-based development (CBD) – Component and subsystems can be flexibly REUSED and REPLACED – UML components diagrams are Implementation diagrams i.e., it describe the different elements required for implementing a system Example – When you build a house, you must do more than create blueprints – you've got to turn your floor plans and elevation drawings into real walls, floors, and ceilings made of wood, stone, or metal. – If you are renovating a house, you'll reuse even larger components, such as whole rooms and frameworks. – Same is the case when we develop software…. COMPONENT NOTATION – A component is shown as a rectangle with – A keyword <<component>> – Optionally, in the right hand corner a component icon can be displayed – A component icon is a rectangle with two smaller rectangles jutting out from the left-hand side – This symbol is a visual stereotype – The component name Component types Components in UML could represent – logical components (e.g., business components, process components) – physical components (e.g., EJB components, COM+ and .NET components) Component ELEMENTS – A component can have – Interfaces An interface represents a declaration of a set of operations – Usage dependencies A usage dependency is relationship which one element requires another element for its full
    [Show full text]
  • UML Why Develop a UML Model?
    App Development & Modelling BSc in Applied Computing Produced Eamonn de Leastar ([email protected]) by Department of Computing, Maths & Physics Waterford Institute of Technology http://www.wit.ie http://elearning.wit.ie Introduction to UML Why develop a UML model? • Provide structure for problem solving • Experiment to explore multiple solutions • Furnish abstractions to manage complexity • Decrease development costs • Manage the risk of mistakes #3 The Challenge #4 The Vision #5 Why do we model graphically? " Graphics reveal data.! " Edward Tufte$ The Visual Display of Quantitative Information, 1983$ " 1 bitmap = 1 megaword.! " Anonymous visual modeler #6 Building Blocks of UML " The basic building blocks of UML are:! " model elements (classes, interfaces, components, use cases, etc.)! " relationships (associations, generalization, dependencies, etc.)! " diagrams (class diagrams, use case diagrams, interaction diagrams, etc.)! " Simple building blocks are used to create large, complex structures! " eg elements, bonds and molecules in chemistry! " eg components, connectors and circuit boards in hardware #7 Example : Classifier View #8 Example: Instance View #9 UML Modeling Process " Use Case! " Structural! " Behavioural! " Architectural #10 Use Case Visual Paradigm Help #11 Structural Modeling Visual Paradigm Help #12 Behavioural Modeling Visual Paradigm Help #13 Architectural Modeling Visual Paradigm Help #14 Structural Modeling " Core concepts! " Diagram Types #15 Structural Modeling Core Elements " a view of an system that emphasizes
    [Show full text]
  • UML Diagram Types Architectural Family Component
    UML Diagram Types Dynamic Models Structural Models activity diagrams class diagrams statechart diagrams object diagrams interaction diagrams packages – sequence diagrams Architectural Models – collaboration component diagrams diagrams deployment diagrams use case diagrams Architectural Family Component Diagram: shows the organization and dependencies among a set of components (i.e., software deployment) Deployment Diagram: shows the configuration of run-time processing nodes and the components that live on them (i.e., hardware deployment) Component def’n: physical and replaceable part of a system that conforms to and provides the realization of a set of interfaces physical: bits replaceable: substitutable, conforming to same interfaces part of a system: software partition of a system interfaces: collection of operations to specify service of a class or component Component Convention name – simple name: (e.g. agent) – path name: (e.g. system::dialog) adornments – tagged values symbol – default: rectangle, with two smaller rectangles – iconic representation Components vs. Classes Similarities Differences names physical implementation realize set of vs. logical abstraction interfaces operations reachable relationships only through interfaces vs. attributes and nesting operations directly instances Interface def’n: collection of operations to specify service of a class or component represents seams in systems components realize the interfaces other components access services (dependency) through interfaces Convention short form (dependency) elided form (realization and dependency) fully specified form (expanded interface) Separation of Interface and Component separate what class does from how it interfaces break direct dependency between two components component will function properly as long as it uses given interface permits assembly of systems from binary replaceable parts extension through new services and new interfaces Types of Components Deployment necessary and sufficient to form an executable system e.g.
    [Show full text]
  • On UML's Composite Structure Diagram
    On UML's Composite Structure Diagram Ian Oliver, Vesa Luukkala Nokia Research Center Helsinki, Finland fian.oliver,[email protected] Abstract. The composite structure diagram and related notions have been introduced into UML2.0 to supplement already existing artifacts such as classes. However the usage of these constructs by engineers and/or modellers is not always in the spirit of inventors of these con- structs. A number of additional interpretations develop which are not always consistent with the intended usage of the structure nor with the language itself. Understanding these additional usages assists in under- standing areas of ambiguity, extension, inconsistency and the future de- velopment of the language. 1 Introduction The composite structure diagram's and related structures' uses and semantics are well described in [1{3] while the notions of composition are adequately de- scribed in [4, 5]. Its function is to extend the modelling capabilities of the UML beyond that of classes and their relationships and is primarily aimed to assist the modelling of the internal structures of classes with a more well defined notion of decomposition. Similar notions exist in methods such as ROOM [6] (capsules) and languages such as SDL [7] and SysML [8] for example. As tools become more UML compliant and support more UML constructs, en- gineers and/or modellers start to use these additional constructs. The effect of this is that the semantics of these constructs is often learnt through an implicit process based around the name of the construct and what the tool appears to allow; the semantics are often based on the engineer's expectations and per- ceived meaning [9] rather than on the actual, intended semantics.
    [Show full text]
  • During the Early Days of Computing, Computer Systems Were Designed to Fit a Particular Platform and Were Designed to Address T
    TAGDUR: A Tool for Producing UML Diagrams Through Reengineering of Legacy Systems Richard Millham, Hongji Yang De Montfort University, England [email protected] & [email protected] Abstract: Introducing TAGDUR, a reengineering tool that first transforms a procedural legacy system into an object-oriented, event-driven system and then models and documents this transformed system through a series of UML diagrams. Keywords: TAGDUR, Reengineering, Program Transformation, UML In this paper, we introduce TAGDUR (Transformation from a sequential-driven, procedural structured to an and Automatic Generation of Documentation in UML event-driven, component-based architecture requires a through Reengineering). TAGDUR is a reengineering tool transformation of the original system to an object-oriented, designed to address the problems frequently found in event-driven system. Object orientation, because it many legacy systems such as lack of documentation and encapsulates methods and their variables into modules, is the need to transform the present structure to a more well-suited to a multi-tiered Web-based architecture modern architecture. TAGDUR first transforms a where pieces of software must be defined in encapsulated procedurally-structured system to an object-oriented, modules with cleanly-defined interfaces. This particular event-driven architecture. Then TAGDUR generates legacy system is procedural-driven and is batch-oriented; documentation of the structure and behavior of this a move to a Web-based architecture requires a real-time, transformed system through a series of UML (Unified event-driven response rather than a procedural invocation. Modeling Language) diagrams. These diagrams include class, deployment, sequence, and activity diagrams. Object orientation promises other advantages as well.
    [Show full text]
  • TAGDUR: a Tool for Producing UML Sequence, Deployment, and Component Diagrams Through Reengineering of Legacy Systems
    TAGDUR: A Tool for Producing UML Sequence, Deployment, and Component Diagrams Through Reengineering of Legacy Systems Richard Millham, Jianjun Pu, Hongji Yang De Montfort University, England [email protected] & [email protected] Abstract: A further introduction of TAGDUR, a documents this transformed system through a reengineering tool that first transforms a series of UML diagrams. This paper focuses on procedural legacy system into an object-oriented, TAGDUR’s generation of sequence, deployment, event-driven system and then models and and component diagrams. Keywords: UML (Unified Modeling Language), Reengineering, WSL This paper is a second installment in a series [4] accommodate a multi-tiered, Web-based that introduces TAGDUR (Transformation and platform. In order to accommodate this Automatic Generation of Documentation in remodeled platform, the original sequential- UML through Reengineering). TAGDUR is a driven, procedurally structured legacy system reengineering tool that transforms a legacy must be transformed to an object-oriented, event- system’s outmoded architecture to a more driven system. Object orientation, because it modern one and then represents this transformed encapsulates variables and procedures into system through a series of UML (Unified modules, is well suited to this new Web Modeling Language) diagrams in order to architecture where pieces of software must be overcome a legacy system’s frequent lack of encapsulated into component modules with documentation. The architectural transformation clearly defined interfaces. A transfer to a Web- is from the legacy system’s original based architecture requires a real-time, event- procedurally-structured to an object-oriented, driven response rather than the legacy system’s event-driven architecture.
    [Show full text]
  • 1 Class Diagrams and Entity Relationship Diagrams (ERD) Class Diagrams and Erds Both Model the Structure of a System
    Tutorial Week 7 - Class and Entity-Relationship Diagrams 1 Class Diagrams and Entity Relationship Diagrams (ERD) Class diagrams and ERDs both model the structure of a system. Class diagrams represent the dynamic aspects of a system: both the structural and behavioural features. ERDs, depicting only structural features provide a static view of the system. 2 Class Diagrams 2.1 Elements of a class diagram: 2.1.1 class A class is a general concept (represented as a square box). Class Name A class defines the structural attributes and behavioural characteristics of that concept. Shown as a rectangle labeled with the class name. 2.1.2 association Class 1 Association Class 2 A (semantic) relationship between classes. A line that joins two classes. 2.1.2.1 binary Simple association between two classes. A Person Eats Food solid triangle with the association name indicates the direction in which the association is meant to be read. 2.1.2.2 n-ary Class 1 Class 2 n-ary Association expresses an association n-ary between multiple classes Class 3 2.1.2.3 Aggregation Team Member “has-a” relationship page 1 of 14 Tutorial Week 7 - Class and Entity-Relationship Diagrams 2.1.2.4 Composition Car Engine “is-composed-of” relationship 2.1.2.5 Generalization Car Volvo “is-a-kind-of” relationship 2.1.2.6 Dependency Project The source class depends on (uses) the target class. (not used for requirements analysis) Project Manager Team 2.1.2.7 Realization «datatype» Class supports all operations of target Human Resources class but not all attributes or associations.
    [Show full text]
  • Telelogic AB
    Developing Test Specifications Through a Developing Test Specifications Model-Driven Approach Through Model-Driven Approach Irv Badr Senior Manager of Product Marketing © Telelogic AB Quality Improvement by Users • Major telecommunications handset maker: “Model Driven Development reduced the design errors in our application by 64%. We found 97% of all errors during the Coding and Unit Test phase of our project.” • Major telecommunications infrastructure provider: – 90% of coding errors removed – 30-50% of logical errors removed Telelogic AB 1 The Vision: Agile MDD approach for Test Development Requirements Document Requirements System Capture & (validation) Analysis Testing Accept Increment Integration & Regression Testing Define Increment Unit test Architect & Increment Design Increment Build Increment Development Testing Operational = Feedback trace System Telelogic AB Modeling Driven Development The Basics © Telelogic AB 2 Model-based Testing • Tests should be modeled together with the system architecture and functionality – systems and their tests tie in with the same system requirements – changes to requirements affect both system and tests – systems and tests are made consistent and coherent • Automatically generate the information that is necessary to execute the tests UML System Model Test Model code generation code generation Source code Telelogic AB Existing MDDTesting Framework • When modeling - a standard approach to express tests, which: – works with models at different levels of abstraction – supports source code – can be
    [Show full text]
  • Real Time UML
    Fr 5 January 22th-26th, 2007, Munich/Germany Real Time UML Bruce Powel Douglass Organized by: Lindlaustr. 2c, 53842 Troisdorf, Tel.: +49 (0)2241 2341-100, Fax.: +49 (0)2241 2341-199 www.oopconference.com RealReal--TimeTime UMLUML Bruce Powel Douglass, PhD Chief Evangelist Telelogic Systems and Software Modeling Division www.telelogic.com/modeling groups.yahoo.com/group/RT-UML 1 Real-Time UML © Telelogic AB Basics of UML • What is UML? – How do we capture requirements using UML? – How do we describe structure using UML? – How do we model communication using UML? – How do we describe behavior using UML? • The “Real-Time UML” Profile • The Harmony Process 2 Real-Time UML © Telelogic AB What is UML? 3 Real-Time UML © Telelogic AB What is UML? • Unified Modeling Language • Comprehensive full life-cycle 3rd Generation modeling language – Standardized in 1997 by the OMG – Created by a consortium of 12 companies from various domains – Telelogic/I-Logix a key contributor to the UML including the definition of behavioral modeling • Incorporates state of the art Software and Systems A&D concepts • Matches the growing complexity of real-time systems – Large scale systems, Networking, Web enabling, Data management • Extensible and configurable • Unprecedented inter-disciplinary market penetration – Used for both software and systems engineering • UML 2.0 is latest version (2.1 in process…) 4 Real-Time UML © Telelogic AB UML supports Key Technologies for Development Iterative Development Real-Time Frameworks Visual Modeling Automated Requirements-
    [Show full text]