Requirements Modelling with UML 2

Slides:



Advertisements
Similar presentations
SEG3101 (Fall 2010) Structural Modeling
Advertisements

UML (Sequence Diagrams, Collaboration and State Chart Diagrams) Presentation By - SANDEEP REDDY CHEEDEPUDI (Student No: ) - VISHNU CHANDRADAS (Student.
A Brief Introduction. Acknowledgements  The material in this tutorial is based in part on: Concurrency: State Models & Java Programming, by Jeff Magee.
Nicolò Carissimi in UML 2.0. Summary what’s behind UML: MDA UML 2.0 and MDA key concepts.
1 © Wolfgang Pelz UML2 UML Part Two. 2 © Wolfgang Pelz UML2 Chapters Four & Twelve Interaction Diagrams.
© Copyright Eliyahu Brutman Programming Techniques Course.
THE OBJECT-ORIENTED DESIGN WORKFLOW Statechart Diagrams.
SE-565 Software System Requirements More UML Diagrams.
[ §6 : 1 ] 6. Basic Methods II Overview 6.1 Models 6.2 Taxonomy 6.3 Finite State Model 6.4 State Transition Model 6.5 Dataflow Model 6.6 User Manual.
Basic Concepts The Unified Modeling Language (UML) SYSC System Analysis and Design.
CIT UPES | Sept 2013 | Unified Modeling Language - UML.
Gregor v. Bochmann, University of Ottawa Based on Powerpoint slides by Gunter Mussbacher with material from: K.E. Wiegers, D. Leffingwell & D. Widrig,
Systems Analysis and Design in a Changing World, Fifth Edition
1 UML Basic Training. UML Basic training2 Agenda  Definitions: requirements, design  Basics of Unified Modeling Language 1.4  SysML.
1 Devon M. Simmonds University of North Carolina, Wilmington CSC450 Software Engineering WorkFlow Modeling with Activity Diagrams.
Sommerville 2004,Mejia-Alvarez 2009Software Engineering, 7th edition. Chapter 8 Slide 1 System models.
Miguel Garzón, University of Ottawa Based on Powerpoint slides by Gunter Mussbacher with material from: K.E. Wiegers, D. Leffingwell & D. Widrig, M. Jackson,
UML diagrams What is UML UML diagrams –Static modeoing –Dynamic modeling 1.
Fall 2010 CS4310 Requirements Engineering A Brief Review of UML & OO Dr. Guoqiang Hu Department of Computer Science UTEP 1.
7 Systems Analysis and Design in a Changing World, Fifth Edition.
Course Instructor: Kashif Ihsan 1. Chapter # 3 2.
Introduction to UML CS A470. What is UML? Unified Modeling Language –OMG Standard, Object Management Group –Based on work from Booch, Rumbaugh, Jacobson.
Karolina Muszyńska Based on: S. Wrycza, B. Marcinkowski, K. Wyrzykowski „Język UML 2.0 w modelowaniu SI”
Systems Analysis and Design in a Changing World, Fourth Edition
Lecture 9-1 : Intro. to UML (Unified Modeling Language)
CS3773 Software Engineering Lecture 06 UML State Machines.
1 Technical & Business Writing (ENG-715) Muhammad Bilal Bashir UIIT, Rawalpindi.
Winter 2011SEG Chapter 11 Chapter 1 (Part 1) Review from previous courses Subject 1: The Software Development Process.
Chapter 3: Introducing the UML
CSCI 3428: Software Engineering Tami Meredith UML Unified Modeling Language.
Requirement Analysis SOFTWARE ENGINEERING. What are Requirements? Expression of desired behavior Deals with objects or entities, the states they can be.
Daniel Amyot, University of Ottawa Based on Powerpoint slides by Gunter Mussbacher (2009) with material from: Jo Atlee, Dan Berry (both University of Waterloo);
1 CEN 4020 Software Engineering PPT4: Requirement analysis.
Miguel Garzón, University of Ottawa Based on Powerpoint slides by Gunter Mussbacher (2009) with material from: Jo Atlee, Dan Berry (both University of.
Miguel Garzón, University of Ottawa Based on Powerpoint slides by Gunter Mussbacher with material from: K.E. Wiegers, D. Leffingwell & D. Widrig, M. Jackson,
© 2009 Artisan Software Tools. All rights reserved. Testing Solutions with UML/SysML Andrew Stuart, Matthew Hause.
UML (Unified Modeling Language)
Defects of UML Yang Yichuan. For the Presentation Something you know Instead of lots of new stuff. Cases Instead of Concepts. Methodology instead of the.
Laurea Triennale in Informatica – Corso di Ingegneria del Software I – A.A. 2006/2007 Andrea Polini VII. System Specification (I)
Requirements Specification
Introduction to UML.
Systems Analysis and Design in a Changing World, Fourth Edition
Analysis Classes Unit 5.
Object-Oriented Analysis and Design
UML Diagrams By Daniel Damaris Novarianto S..
The Movement To Objects
Evolution of UML.
Main issues: • What do we want to build • How do we write this down
Course Outcomes of Object Oriented Modeling Design (17630,C604)
Object-Oriented Analysis and Design
SysML v2 Formalism: Requirements & Benefits
Unified Modeling Language
Introduction to Unified Modeling Language (UML)
Advanced state modeling
UML Diagrams Jung Woo.
Abstract descriptions of systems whose requirements are being analysed
Daniel Amyot and Jun Biao Yan
UML dynamic Modeling (Behavior Diagram)
Chapter 10: Process Implementation with Executable Models
Lecture Software Process Definition and Management Chapter 3: Descriptive Process Models Dr. Jürgen Münch Fall
CS/CPE 426 Senior Projects
Introduction to UML.
Chapter 20 Object-Oriented Analysis and Design
An Introduction to Software Architecture
CS/CPE 426 Senior Projects
Dynamic Modeling Lecture # 37.
Advanced state modeling
CS 791Z State Machines & Advanced State Machines
UML  UML stands for Unified Modeling Language. It is a standard which is mainly used for creating object- oriented, meaningful documentation models for.
Presentation transcript:

Requirements Modelling with UML 2 SEG3101 (Fall 2017) Requirements Modelling with UML 2 Daniel Amyot, University of Ottawa Based on Powerpoint slides by Gunter Mussbacher with material from: B. Selic, Brugge & Dutoit, developpez.com, S. Somé 2008, D. Amyot 2008-2017, et G.v. Bochmann 2010

Overview Models and Analysis UML for Requirements Engineering UML Class Diagrams for Domain Models UML State Diagrams for lifecycles

All models are false, but some models are useful… George Edward Pelham Box (1919-2013)

Models According to Bran Selic, a model is a reduced representation (simplified, abstract) of (one aspect of) a system used to: Help understand complex problems and / or solutions Communicate information about the problem / solution Direct implementation (especially in software) Qualities of a good model Abstract Understandable Accurate Predictive Inexpensive

Modeling Representations Natural language (English) No special training required Ambiguous, verbose, vague, obscure ... No automation Ad hoc notation (bubbles and arrows) No syntax formally defined meaning not clear, ambiguous Semi-formal notation (URN, UML...) Syntax (graphics) well defined Partial common understanding, reasonably easy to learn Partial automation Meaning only defined informally Still a risk of ambiguities Formal notation (Logic, SDL, Petri nets, FSM ...) Syntax & semantics defined Great automation (analysis and transformations) More difficult to learn & understand

Model Analysis By construction By inspection By formal analysis We learn by questioning and describing the system By inspection Execute/analyze the model in our minds Reliable? By formal analysis Requires formal semantics (mathematical) and tools Reliable (in theory), but expensive (for certain modeling approaches) By testing Execution, simulation, animation, test... Requires well-defined semantics and execution/simulation tools More reliable than inspection for certain aspects Possible to interact directly with the model (prototype)

UML and Requirements Engineering

History of UML (http://www.omg.org/uml/) Rumbaugh Booch Jacobson http://www.omg.org/uml/ Official Version 2.5 (June 2015) “Simplified”… only 794 pages! Source: http://en.wikipedia.org/wiki/Unified_Modeling_Language

Dilbert on Standards

Thirteen Diagram Types in UML 2.x According to UML Reference Manual Structural Class, object, composite structure, component, and use case diagrams Dynamic (that is, describing dynamic behavior) State machine, activity, sequence, communication, timing, and interaction overview diagrams Physical Deployment diagrams Model Management Package diagram

Most Relevant for Requirements Engineering Use case diagram Use cases structuring Activity diagram Workflow and process modeling Concepts much related to concepts of Use Case Maps Sequence diagram Modeling of message exchange scenarios Class diagram Domain modeling State machine diagram Detailed behavioral specification (of objects, protocols, ports…) System behaviour (black box) Object/document lifecycles

Basic Notational Elements of Activity Diagrams Describe the dynamic behavior of a system as a flow of activities (workflow) Flow Sequence Alternative Parallel Note: in this diagram, the data flow objects are not shown. They may be shown as boxes on the control flow lines.

UCM or UML Activity Diagrams? UCM and Activity Diagrams have many concepts in common Responsibility  action, start/end points, alternatives, concurrency Stub / plug-in  action / sub-activity diagram Association between elements and components / partition Unique to Activity Diagrams Data flow modeling, with rich data Integration with UML (including class diagrams and OCL) Unique to UCM Dynamic stubs with several plug-ins Plug-ins can continue in parallel with their parent model 2D graphical layout of components Definitions of scenarios (integrated testing capabilities) Integration with GRL in URN

Basic Notational Elements of Sequence Diagrams Describe the dynamic behavior as interactions between so- called “participants” (e.g. agents, actors, the system, system components). For each participant, there is a “lifeline” http://fox.wikis.com/graphics/sequence.gif

Combined Fragments Allow multiple sequences to be represented in compact form (may involve all participants or just a subset) Combined fragment operators alt, for alternatives with conditions opt, for optional behavior loop(lower bound, upper bound), for loops par, for concurrent behavior critical, for critical sections break, to show a scenario will not be covered assert, required condition ignore/consider(list of messages), for filtering messages neg, for invalid or mis-use scenarios that must not occur strict or seq, for strict/weak sequencing ref, for referencing other sequence diagrams

Concurrency Quiz Is the interaction on the right a valid sequential trace that can be generated from the interaction with the par combined fragment on the left? No! The sequences of the two operands may be interleaved but the ordering defined for each operand must be maintained.

Class Diagrams and Domain Models

From ER to Class Diagrams Based on Entity-Relationship modeling Originally proposed by Peter Chen in 1976 Concepts: Entity/Class: represents a type of entity instances, defines the properties that hold for all such instances. Relationship/Association: represents relationship that hold between certain pairs of entities. The related entity types are also called roles. Multiplicity information indicate how many instances of the “other” side may be related to a given instance of “this” side. Attribute: An entity may have attributes. Each attribute is identified by a name and its (data/class) type

UML Class Diagrams

Class Diagrams for Domain Modeling It is important to define The concepts that exist in a domain where requirements are being specified Provides the basic terminology/vocabulary The particular attributes of these concepts The relationships that exist between these concepts Generalization, aggregation, others more domain-specific… Class diagrams are ideal to capture this information! But a precise subset is useful here…

Class Diagrams for Precise Domain Modeling No operations! Attributes with types Use associations when types are other classes Associations with precise multiplicities Beware of fixed numbers… and of 1..1 associations! Names for association ends (roles) must be used instead of a simple association name Less confusing, especially for expressing constraints Enumerations are also useful Beware of generalization Yes, patterns are useful here too! Supplement with constraints for precision wherever needed In natural language (using the names of classes, attributes, and association ends in the model) or in OCL (Object Constraint Language)

Exercise… Design a simple domain model for a genealogy software application What are the relevant classes, attributes and associations? Do you see some constraints that are difficult to express with UML class diagrams?

Modularity Problems with Class Diagrams (Info) Scattering: design elements to support R1 in many components Requirement1 (R1) Requirement2 (R2) Requirement3 (R3) RequirementN (RN) … ComponentA R1 elements ComponentF R2 elements R3 elements RN elements ComponentE ComponentD ComponentB ComponentC Tangling: single component has elements for many requirements

A Partial Solution – Aspects (info) intertype declaration Aspect ClassA R1 elements F.R1 R1 elements ClassG R1 elements Triggered behavior (code) R1 elements advice ClassC R1 elements Predicate R1 elements ClassB R1 elements pointcut R1 elements ClassF R1 elements R2 elements R3 elements RN elements R1 elements (identifies joinpoints where advice is executed) Terminology based on AspectJ: www.eclipse.org/aspectj

State Machine Diagrams

Basic Notational Elements of State Machine Diagrams Describe the dynamic behavior of an individual object (with states and transitions)

Types of State Machines UML allows both types to be mixed on off Lamp On Lamp Off on/print(”on”) Mealy Automaton on off Lamp On print(”on”) Lamp Off Moore Automaton

Variables (“Extended” States) off on Lamp On Lamp Off on/ctr := ctr + 1 ctr : Integer

Modeling Behavior In general, state machines are suitable for describing reactive systems based or events Not appropriate to describe continuous systems (e.g., spacecraft trajectory control, stock market predictions) time threshold

UML State Machine Diagrams – Summary Composite State State Initial Pseudostate top Trigger Ready Transition stop /ctr := 0 Done Final State Action stop

Entry and Exit Actions LampOn e2 entry/lamp.on(); exit/lamp.off(); e1

Action Ordering LampOn LampOff off/printf(“to off”); Output actions: transition prefix Input actions: transition postfix off/printf(“to off”); LampOff entry/lamp.off(); exit/printf(“exiting”); LampOn entry/lamp.on(); off/printf(“needless”); Resulting action sequence: printf(“exiting”); printf(“to off”); lamp.off(); printf(“exiting”); printf(“needless”); lamp.off();

entry/printf(“error!”) State Activity (Do) Creates a concurrent process that will execute until The action terminates, or We leave the state via an exit transition “do” activity Error entry/printf(“error!”) do/alarm.ring()

Guards (Conditions) Conditional execution of transitions Selling Happy Guards must not have side effects bid [(value >= 100) & (value < 200)] /sell bid [value >= 200] /sell bid [value < 100] /reject Selling Unhappy Happy

Hierarchical State Diagrams Composed states, to manage complexity off/ LampOff entry/lamp.off() LampOn entry/lamp.on() on/ LampFlashing flash/ 1sec/ FlashOff entry/lamp.off() FlashOn entry/lamp.on() on/

Group Transitions LampFlashing flash/ off/ 1sec/ on/ on/ Default transition to Initial pseudostate off/ LampOff entry/lamp.off() LampOn entry/lamp.on() on/ LampFlashing flash/ 1sec/ FlashOff entry/lamp.off() FlashOn entry/lamp.on() on/ Group transition

Completion Transition Triggered by a completion event Automatically generated when an embedded state machine terminates Completion transition (without trigger) Committing Phase1 Phase2 CommitDone

Triggering Rules Many transitions can share the same triggering event When leaving, the most deeply embedded one takes precedence The event disappears whether it triggers a transition or not LampFlashing FlashOn on/ off/ FlashOff

Action Ordering – Composite States exit/exS1 S2 entry/enS2 /initS2 E/actE S11 exit/exS11 S21 entry/enS21 Action sequence on transition E: exS11  exS1  actE  enS2  initS2  enS21

Exercise I – Describe this Behavior What should be added to this state machine to more fully describe the dialing behavior?

Orthogonal Regions Combine many concurrent perspectives – interactions across regions typically done via shared variables Child Adult Retiree age Poor Rich financialStatus Poor Rich financialStatus Child Adult Retiree age

Semantics of Orthogonal Regions All mutually orthogonal regions detect the same events and respond simultaneously (possibly interleaved) Outlaw LawAbiding Poor Rich financialStatus legalStatus robBank/

Exercise II – Describe this Behaviour CourseAttempt Studying Lab1 Lab2 lab done Term Project Final Test project done pass fail Failed Passed

Exercise III In requirements engineering, state machines are quite popular for describing the lifecycle of documents and other artefacts. Simpler subset of the notation needed States, transitions with events [and conditions] Fewer actions than for conventional behaviour descriptions Hierarchical states and orthogonal regions used only if they simplify the model Simple but still VERY useful! Using a UML state machine diagram, describe the lifecycle of: A software bug in a bug management system such as Bugzilla or Jira. An prerequisite exemption request for a course at the University of Ottawa.

Conclusion…

Quiz! Is formal logic always better than natural language? Why do we need domain models in requirements engineering? Why must class diagrams be sometimes supplemented by constraints? Why are Hierarchical State Diagrams useful? Why spend time documenting lifecycles of documents and objects?