R R R CSE870: Advanced Software Engineering: Extending and Using UML (Cheng, Sp2003) Supplementary:...
-
date post
20-Dec-2015 -
Category
Documents
-
view
221 -
download
1
Transcript of R R R CSE870: Advanced Software Engineering: Extending and Using UML (Cheng, Sp2003) Supplementary:...
![Page 1: R R R CSE870: Advanced Software Engineering: Extending and Using UML (Cheng, Sp2003) Supplementary: Using and Extending UML.](https://reader035.fdocuments.us/reader035/viewer/2022062714/56649d4a5503460f94a27946/html5/thumbnails/1.jpg)
CSE870: Advanced Software Engineering: Extending and Using UML (Cheng, Sp2003)
R
R
R
Supplementary:
Using and Extending UML
![Page 2: R R R CSE870: Advanced Software Engineering: Extending and Using UML (Cheng, Sp2003) Supplementary: Using and Extending UML.](https://reader035.fdocuments.us/reader035/viewer/2022062714/56649d4a5503460f94a27946/html5/thumbnails/2.jpg)
CSE870: Advanced Software Engineering: Extending and Using UML (Cheng, Sp2003)
R
R
RExtensibility Mechanisms
• Stereotypes
• Tagged Values
• Constraints ActionQueue
<<container>>
{version = 3.2}
add(a: Action)remove(n: Integer)
{add runs in O(1) time}
![Page 3: R R R CSE870: Advanced Software Engineering: Extending and Using UML (Cheng, Sp2003) Supplementary: Using and Extending UML.](https://reader035.fdocuments.us/reader035/viewer/2022062714/56649d4a5503460f94a27946/html5/thumbnails/3.jpg)
CSE870: Advanced Software Engineering: Extending and Using UML (Cheng, Sp2003)
R
R
RStereotypes
• Extends the UML vocabulary
• Create new building blocks derived from existing ones,– specific to problem domain– Example: Sensors for embedded systems,
<<sensor>>
thermometer
temp
read
<<sensor>>
Voltage meter
volt
read
![Page 4: R R R CSE870: Advanced Software Engineering: Extending and Using UML (Cheng, Sp2003) Supplementary: Using and Extending UML.](https://reader035.fdocuments.us/reader035/viewer/2022062714/56649d4a5503460f94a27946/html5/thumbnails/4.jpg)
CSE870: Advanced Software Engineering: Extending and Using UML (Cheng, Sp2003)
R
R
RTagged Values
• Extends properties of UML building block
• Create new information in that element’s spec
• Example: {version, author values for Software Class} <<sensor>>
Voltage meter
volt
read
{reader=J. Smith}
![Page 5: R R R CSE870: Advanced Software Engineering: Extending and Using UML (Cheng, Sp2003) Supplementary: Using and Extending UML.](https://reader035.fdocuments.us/reader035/viewer/2022062714/56649d4a5503460f94a27946/html5/thumbnails/5.jpg)
CSE870: Advanced Software Engineering: Extending and Using UML (Cheng, Sp2003)
R
R
RConstraint
• Extends the semantics of a UML building block
• Add new rules or modify existing ones– Example: {ordered constraint on a add
operation for a Queue}
<<sensor>>
Voltage meter
volt
read
{reader=J. Smith}
{read before thermostat check}
![Page 6: R R R CSE870: Advanced Software Engineering: Extending and Using UML (Cheng, Sp2003) Supplementary: Using and Extending UML.](https://reader035.fdocuments.us/reader035/viewer/2022062714/56649d4a5503460f94a27946/html5/thumbnails/6.jpg)
CSE870: Advanced Software Engineering: Extending and Using UML (Cheng, Sp2003)
R
R
RInterface
• Interface: collection of operations that specify a service of a class or component– Externally visible behavior of that element– Set of operation specs (signatures)– Not a set of operation implementations
![Page 7: R R R CSE870: Advanced Software Engineering: Extending and Using UML (Cheng, Sp2003) Supplementary: Using and Extending UML.](https://reader035.fdocuments.us/reader035/viewer/2022062714/56649d4a5503460f94a27946/html5/thumbnails/7.jpg)
CSE870: Advanced Software Engineering: Extending and Using UML (Cheng, Sp2003)
R
R
RInterface Example
• Interface specifies desired behavior of an abstraction independent of implementation
• Specifies contract• May also create
stereotype to further define behavior– No attributes– Only operations
• (visibility, concurrency, stereotypes, etc.)
Wordsmith.dll
ISpellIThesaurus
IUnknown
<<interface>>URLStreamHandler
openConnection()Parse URL()setURL()toExternalForm()
Operations
![Page 8: R R R CSE870: Advanced Software Engineering: Extending and Using UML (Cheng, Sp2003) Supplementary: Using and Extending UML.](https://reader035.fdocuments.us/reader035/viewer/2022062714/56649d4a5503460f94a27946/html5/thumbnails/8.jpg)
CSE870: Advanced Software Engineering: Extending and Using UML (Cheng, Sp2003)
R
R
RDependency Relationship
• Definition: – some set of model elements requires presence of another set
of model elements – for semantic completeness or correctness
• Examples: – <<realize>>: between type and class– <<trace>>: analysis class and design class– <<create>>: source class creates a target class instance– <<access>>: permission of one pkg to access public elements
of another– <<bind>>: reln between parameterized model elt with formal
parameter list and that model elt bound to actual parameters. (e.g., templates in C++)
![Page 9: R R R CSE870: Advanced Software Engineering: Extending and Using UML (Cheng, Sp2003) Supplementary: Using and Extending UML.](https://reader035.fdocuments.us/reader035/viewer/2022062714/56649d4a5503460f94a27946/html5/thumbnails/9.jpg)
CSE870: Advanced Software Engineering: Extending and Using UML (Cheng, Sp2003)
R
R
RDependency Example
QueueBasetype, size
QueueString, 400
Integer Queue
<<bind> <integer, 1000>
Explicit Parameterization
Formal parameter list
Actual parameter list
![Page 10: R R R CSE870: Advanced Software Engineering: Extending and Using UML (Cheng, Sp2003) Supplementary: Using and Extending UML.](https://reader035.fdocuments.us/reader035/viewer/2022062714/56649d4a5503460f94a27946/html5/thumbnails/10.jpg)
CSE870: Advanced Software Engineering: Extending and Using UML (Cheng, Sp2003)
R
R
R
Metamodels
![Page 11: R R R CSE870: Advanced Software Engineering: Extending and Using UML (Cheng, Sp2003) Supplementary: Using and Extending UML.](https://reader035.fdocuments.us/reader035/viewer/2022062714/56649d4a5503460f94a27946/html5/thumbnails/11.jpg)
CSE870: Advanced Software Engineering: Extending and Using UML (Cheng, Sp2003)
R
R
RClass Diagram Metamodel
![Page 12: R R R CSE870: Advanced Software Engineering: Extending and Using UML (Cheng, Sp2003) Supplementary: Using and Extending UML.](https://reader035.fdocuments.us/reader035/viewer/2022062714/56649d4a5503460f94a27946/html5/thumbnails/12.jpg)
CSE870: Advanced Software Engineering: Extending and Using UML (Cheng, Sp2003)
R
R
RObject ModelObject Model
• Creation Tips– understand the problem– keep it simple at first, then refine later– choose class names carefully– try to have only binary relations– do not worry about multiplicities on first draft– do not feel you have to use all constructs– concentrate on WHAT– document reasons behind the model– refine until complete and correct
![Page 13: R R R CSE870: Advanced Software Engineering: Extending and Using UML (Cheng, Sp2003) Supplementary: Using and Extending UML.](https://reader035.fdocuments.us/reader035/viewer/2022062714/56649d4a5503460f94a27946/html5/thumbnails/13.jpg)
CSE870: Advanced Software Engineering: Extending and Using UML (Cheng, Sp2003)
R
R
RDynamic ModelDynamic Model
• Creation Tips– only construct state diagrams for object classes with meaningful
dynamic behavior– verify consistency between diagrams for shared events– use scenarios to begin the construction of diagrams– let application decide on granularity and distinguish between
actions and activities– make use of entry and exit actions for multiple transitions– use nested states to improve understanding/readability– distinguish state diagrams for super and subclasses– watch for race conditions in the diagrams
![Page 14: R R R CSE870: Advanced Software Engineering: Extending and Using UML (Cheng, Sp2003) Supplementary: Using and Extending UML.](https://reader035.fdocuments.us/reader035/viewer/2022062714/56649d4a5503460f94a27946/html5/thumbnails/14.jpg)
CSE870: Advanced Software Engineering: Extending and Using UML (Cheng, Sp2003)
R
R
R
Approaching a Problem
Where do we start?
How do we proceed?
![Page 15: R R R CSE870: Advanced Software Engineering: Extending and Using UML (Cheng, Sp2003) Supplementary: Using and Extending UML.](https://reader035.fdocuments.us/reader035/viewer/2022062714/56649d4a5503460f94a27946/html5/thumbnails/15.jpg)
CSE870: Advanced Software Engineering: Extending and Using UML (Cheng, Sp2003)
R
R
RWhere Do We Start?
• Start with the requirements– Capture your goals and possible constraints– Environmental assumptions
• Use-case analysis to better understand your requirements– Find actors and a first round of use-cases
• Start conceptual modeling– Conceptual class diagram– Interaction diagrams to clarify use-cases– Activity diagrams to understand major processing
Requirements Elicitation and Analysis
![Page 16: R R R CSE870: Advanced Software Engineering: Extending and Using UML (Cheng, Sp2003) Supplementary: Using and Extending UML.](https://reader035.fdocuments.us/reader035/viewer/2022062714/56649d4a5503460f94a27946/html5/thumbnails/16.jpg)
CSE870: Advanced Software Engineering: Extending and Using UML (Cheng, Sp2003)
R
R
RHow Do We Continue?
• Refine use-cases– Possibly some “real” use-cases
• Using interface mockups
• Refine (or restructure) your class diagram– Based on your hardware architecture
• For instance, client server
• Refine and expand your dynamic model– Until you are comfortable that you understand the
required behavior
• Identify most operations and attributes
High-Level Design
![Page 17: R R R CSE870: Advanced Software Engineering: Extending and Using UML (Cheng, Sp2003) Supplementary: Using and Extending UML.](https://reader035.fdocuments.us/reader035/viewer/2022062714/56649d4a5503460f94a27946/html5/thumbnails/17.jpg)
CSE870: Advanced Software Engineering: Extending and Using UML (Cheng, Sp2003)
R
R
RHow Do We Wrap Up?
• Refine the class diagram based on platform and language properties– Navigability, public, private, etc– Class libraries
• Identify all operations– Not the trivial get, set, etc.
• Write a contract for each operation• Define a collection of invariants for each class• Implement
Detailed Design and Implementation
![Page 18: R R R CSE870: Advanced Software Engineering: Extending and Using UML (Cheng, Sp2003) Supplementary: Using and Extending UML.](https://reader035.fdocuments.us/reader035/viewer/2022062714/56649d4a5503460f94a27946/html5/thumbnails/18.jpg)
CSE870: Advanced Software Engineering: Extending and Using UML (Cheng, Sp2003)
R
R
RWhy is requirements analysis difficult?
• Communication: misunderstandings between the customer and the analyst– Analyst doesn’t understand the domain– Customer doesn’t understand alternatives and
trade-offs
• Problem complexity– Inconsistencies in problem statement– Omissions/incompleteness in problem statement– Inappropriate detail in problem statement
![Page 19: R R R CSE870: Advanced Software Engineering: Extending and Using UML (Cheng, Sp2003) Supplementary: Using and Extending UML.](https://reader035.fdocuments.us/reader035/viewer/2022062714/56649d4a5503460f94a27946/html5/thumbnails/19.jpg)
CSE870: Advanced Software Engineering: Extending and Using UML (Cheng, Sp2003)
R
R
RWhy is requirements analysis difficult?
• Need to accommodate change– Hard to predict change– Hard to plan for change– Hard to predict the impact of change
![Page 20: R R R CSE870: Advanced Software Engineering: Extending and Using UML (Cheng, Sp2003) Supplementary: Using and Extending UML.](https://reader035.fdocuments.us/reader035/viewer/2022062714/56649d4a5503460f94a27946/html5/thumbnails/20.jpg)
CSE870: Advanced Software Engineering: Extending and Using UML (Cheng, Sp2003)
R
R
RFirst Law of Software Engineering
“No matter where you are in the
system lifecycle, the system will
change, and the desire to change it
will persist throughout the lifecycle.”
![Page 21: R R R CSE870: Advanced Software Engineering: Extending and Using UML (Cheng, Sp2003) Supplementary: Using and Extending UML.](https://reader035.fdocuments.us/reader035/viewer/2022062714/56649d4a5503460f94a27946/html5/thumbnails/21.jpg)
CSE870: Advanced Software Engineering: Extending and Using UML (Cheng, Sp2003)
R
R
RReasons for changing requirements
• Poor communication• Inaccurate requirements
analysis• Failure to consider
alternatives• New users• New customer goals
• New customer environment
• New technology
• Competition
• Software is seen as malleable
Changes made after the requirements are approved increase cost and schedule
![Page 22: R R R CSE870: Advanced Software Engineering: Extending and Using UML (Cheng, Sp2003) Supplementary: Using and Extending UML.](https://reader035.fdocuments.us/reader035/viewer/2022062714/56649d4a5503460f94a27946/html5/thumbnails/22.jpg)
CSE870: Advanced Software Engineering: Extending and Using UML (Cheng, Sp2003)
R
R
RRequirements Products
• Specification document– Agreement between customer and developer– Validation criteria for software
• Preliminary users manual
• Prototype– If user interaction is important– If resources are available
• Review by customer and developer – Iteration is almost always required
![Page 23: R R R CSE870: Advanced Software Engineering: Extending and Using UML (Cheng, Sp2003) Supplementary: Using and Extending UML.](https://reader035.fdocuments.us/reader035/viewer/2022062714/56649d4a5503460f94a27946/html5/thumbnails/23.jpg)
CSE870: Advanced Software Engineering: Extending and Using UML (Cheng, Sp2003)
R
R
RAnalysis: Steps to follow
• Obtain a problem statement• Develop use cases (depict scenarios of use)• Build an object model and data dictionary• Develop a dynamic model
– state and sequence diagrams
• Verify, iterate, and refine the models• Produce analysis document
![Page 24: R R R CSE870: Advanced Software Engineering: Extending and Using UML (Cheng, Sp2003) Supplementary: Using and Extending UML.](https://reader035.fdocuments.us/reader035/viewer/2022062714/56649d4a5503460f94a27946/html5/thumbnails/24.jpg)
CSE870: Advanced Software Engineering: Extending and Using UML (Cheng, Sp2003)
R
R
RUse Cases
• High-level overview of system use• Identify scenarios of usage• Identify actors of the system:
– External entities (e.g., users, systems, etc.)
• Identify system activities• Draw connections between actors and
activities• Identify dependencies between activities (i.e.,
extends, uses)
![Page 25: R R R CSE870: Advanced Software Engineering: Extending and Using UML (Cheng, Sp2003) Supplementary: Using and Extending UML.](https://reader035.fdocuments.us/reader035/viewer/2022062714/56649d4a5503460f94a27946/html5/thumbnails/25.jpg)
CSE870: Advanced Software Engineering: Extending and Using UML (Cheng, Sp2003)
R
R
RAnalysis: Object Model
• Organization of system into classes
connected by associations
– Shows the static structure
– Organizes and decomposes system into
more manageable subsystems
– Describes real world classes and
relationships
![Page 26: R R R CSE870: Advanced Software Engineering: Extending and Using UML (Cheng, Sp2003) Supplementary: Using and Extending UML.](https://reader035.fdocuments.us/reader035/viewer/2022062714/56649d4a5503460f94a27946/html5/thumbnails/26.jpg)
CSE870: Advanced Software Engineering: Extending and Using UML (Cheng, Sp2003)
R
R
RAnalysis: Object Model
• Object model precedes the dynamic model
because
– static structure is usually better defined
– less dependent on details
– more stable as the system evolves
![Page 27: R R R CSE870: Advanced Software Engineering: Extending and Using UML (Cheng, Sp2003) Supplementary: Using and Extending UML.](https://reader035.fdocuments.us/reader035/viewer/2022062714/56649d4a5503460f94a27946/html5/thumbnails/27.jpg)
CSE870: Advanced Software Engineering: Extending and Using UML (Cheng, Sp2003)
R
R
RAnalysis: Object Model
• Information comes from– The problem statement and use cases– Expert knowledge of the application
domain• Interviews with customer• Consultation with experts• Outside research performed by analyst
– General knowledge of the real world
![Page 28: R R R CSE870: Advanced Software Engineering: Extending and Using UML (Cheng, Sp2003) Supplementary: Using and Extending UML.](https://reader035.fdocuments.us/reader035/viewer/2022062714/56649d4a5503460f94a27946/html5/thumbnails/28.jpg)
CSE870: Advanced Software Engineering: Extending and Using UML (Cheng, Sp2003)
R
R
RObject Model: Steps to follow
• Identify classes and associations
– nouns and verbs in a problem description
• Create data dictionary entry for each
• Add attributes
• Combine and organize classes using
inheritance
![Page 29: R R R CSE870: Advanced Software Engineering: Extending and Using UML (Cheng, Sp2003) Supplementary: Using and Extending UML.](https://reader035.fdocuments.us/reader035/viewer/2022062714/56649d4a5503460f94a27946/html5/thumbnails/29.jpg)
CSE870: Advanced Software Engineering: Extending and Using UML (Cheng, Sp2003)
R
R
RAnalysis: Dynamic model
• Shows the time dependent behavior of the system and the objects in it
• Expressed in terms of– states of objects and activities in states– events and actions
• State diagram summarizes permissible event
sequences for objects with important dynamic
behavior
![Page 30: R R R CSE870: Advanced Software Engineering: Extending and Using UML (Cheng, Sp2003) Supplementary: Using and Extending UML.](https://reader035.fdocuments.us/reader035/viewer/2022062714/56649d4a5503460f94a27946/html5/thumbnails/30.jpg)
CSE870: Advanced Software Engineering: Extending and Using UML (Cheng, Sp2003)
R
R
RDynamic Model: Steps to follow
• Use cases provide scenarios of typical interaction
sequences
• Identify events between objects (Sequence
Diagram)
• Prepare an event trace for each scenario
• Build state diagrams
• Match events between objects to verify
consistency
![Page 31: R R R CSE870: Advanced Software Engineering: Extending and Using UML (Cheng, Sp2003) Supplementary: Using and Extending UML.](https://reader035.fdocuments.us/reader035/viewer/2022062714/56649d4a5503460f94a27946/html5/thumbnails/31.jpg)
CSE870: Advanced Software Engineering: Extending and Using UML (Cheng, Sp2003)
R
R
RAnalysis: Iteration
• Analysis model will require multiple passes to complete
• Look for inconsistencies and revise
• Look for omissions/vagueness and revise
• Validate the final model with the customer