Drexel University
CS 451 Software Engineering
1
CS 451 Software Engineering Yuanfang Cai Room 104, University - - PowerPoint PPT Presentation
CS 451 Software Engineering Yuanfang Cai Room 104, University Crossings 215.895.0298 yfcai@cs.drexel.edu 1 Drexel University Elaboration 2 Drexel University Elaboration: Building the Analysis Model An analysis model provides a
Drexel University
1
Drexel University
2
Drexel University
An analysis model provides a description of the
An analysis model will change during the
There are many ways to represent the model. Software is not visualizable
3
Drexel University
4
Drexel University
Describe what the customer requires Establish a basis for the creation of a software
Define a set of requirements that can be
5
Drexel University
From SRS, e.g. use case scenarios:
What are the entities in the system?
Class diagrams Data-flow diagram
How these entities interact with each other?
Sequence diagram Activity diagram Swim lane diagram
The behavior of a complex object
State diagram
6
Drexel University
7
Drexel University
8
Drexel University
9
Drexel University
Use cases –text Use case diagrams Activity diagram
Visualizing the logic within a use case: scenarios
Swim lane diagram
Split activities among actors.
10
Drexel University
11
Drexel University
Similar to a flowchart:
Round rectangles
imply specific system functions
Arrows represent
flow through the system
Diamonds depict a
branching decision
12
Drexel University
Swim Lane Diagram
Represents flow of activities indicating which actor has responsibility for the action.
Responsibilities are represented as parallel segments that divide the diamond vertically, like the lanes in a swimming pool.
13
Drexel University
Class diagram
Entities Attributes Behaviors
14
Drexel University
Each usage scenario implies a set of “objects”
15
Drexel University
The behavior of a computer- based system can have a
16
Drexel University
Class diagram for the system class
17
Drexel University
Drexel University
A class encapsulates state (attribute) and behavior (operations). Each attribute has a type. Each operation has a signature. The class name is the only mandatory information.
nam e attributes
s
Drexel University
Generalization relationships denote inheritance between classes.
The children classes inherit the attributes and operations of the parent class.
Indicated by a hollow arrow
Drexel University
source class to the target class
without arrow heads
Don’t usually put the association down as an attribute in the class
Drexel University
22
another object (“has-a”), but their lifetimes are independent (they could exist independently).
Employees,” or that “a Faculty contains a set of Teachers.”
at the end of the association next to the aggregate class.
Drexel University
23
composition when an object is contained in another object, and it can exist only as long as the container exists and it only exists for the benefit of the container.
and Drawing-Figure.
association next to the composite class.
stronger form of aggregation.
Drexel University
Drexel University
Drexel University
?? 1.
2.
Drexel University
27
Drexel University
DFD for the SafeHome Security function
28
Drexel University
Level 1 DFD for SafeHome Security Function
29
Drexel University
30
Drexel University
31
Sequence Diagram
How the entities interact with each other For further design analysis
State Diagram
How a complex object behaves
Drexel University
32
Drexel University
To refine use case descriptions To find additional objects (“participating
to refine subsystem interfaces Performance analysis
Drexel University
A player rolls the dice and gets a 6. The player moves 6
Not all nouns become objects such as “turn”
Objects
Player Dice Cell Property
Drexel University
Objects are represented by columns (first column is actor that initiates use case)
Messages are represented by arrows
Activations of an operation are represented by narrow rectangles
No significance to the horizontal orderings of the objects Return values are optionally indicated using a dashed arrow with a label indicating the return value Suggestion: not to indicate the return values when it is obvious what is being returned
Player Dice Cell Property rollDice DiceValue(6) MoveCell(6) isOwnedProperty isOwnedProperty(False)
Drexel University
A player rolls the dice and gets a 6. The player moves 6
Player Dice Cell Property rollDice DiceValue(6) MoveCell(6) isOwnedProperty isOwnedProperty(False)
Not all nouns become objects such as “turn”
Drexel University
Player Dice Cell Property rollDice DiceValue(n) MoveCells(n) [isOwnedProperty] isOwnedProperty(False) isOwnedProperty(True,owner) Owner PayOwner
[else]
player must pay rent to the owner of the property.
Drexel University
38
Drexel University
A state diagram (also called state machine diagram) depict the various states that an object may be in and the transitions between those states. Appropriate to be developed for complex objects.
From UML Distilled (pp. 107-108):
A lock in a haunted house: keep valuables in a safe that’s hard to find To reveal the lock to the safe, I have to remove a strategic candle from its holder, but this will reveal the lock only while the door is closed. In the Wait state, if the candle is removed providing the door is closed, you reveal the lock and move to the Lock state. Once I can see the lock, I can insert my key to open the safe. For extra safety, I make sure that I can open the safe only if I re-place the candle first. If a thief neglects this precaution, I’ll unleash a killer rabbit to him.
Drexel University
From UML Distilled (pp. 107-108):
A lock in a haunted house: keep valuables in a safe that’s hard to find To reveal the lock to the safe, I have to remove a strategic candle from its holder, but this will reveal the lock only while the door is closed. In the Wait state, if the candle is removed providing the door is closed, you reveal the lock and move to the Lock state. Once I can see the lock, I can insert my key to open the safe. For extra safety, I make sure that I can open the safe only if I re-place the candle first. If a thief neglects this precaution, I’ll unleash a killer rabbit to him.
Drexel University
States are represented by the values of the attributes or data members of an object.
Initial state state Terminal state transition
Drexel University
important change in state.
trigger-signature [ guard] / activity candle removed [ door closed] / reveal lock
change of state.
transition to be taken.
Drexel University
trigger-signature: event that causes a potential change of state guard: Boolean condition that must be true for transition to happen activity: behavior that’s executed during the transition
Drexel University
There is one initial state (can be multiple final states). Every state can be reached from the initial state. From each state, there must be a path to a final state. Every transition between states must be labeled with an
When an event occurs, you can take only one transition.
Transitions that are not shown are illegal OR show