Download as ppt, pdf, or txt
Download as ppt, pdf, or txt
You are on page 1of 43

TE2104

Software Requirements
Engineering

Topic 9:
Requirements Analysis III
Contents
1. Activity Diagrams
2. Statechart
Activity Diagram
UML Activity Diagram:
•Often called as “Object-oriented Flowcharts”.
•Model a process as an activity that consists of a collection of
nodes connected by edges.
•It is a behavioral diagram that illustrates the flow of activities
through a system.
•Can also be used to depict a flow of events in a business process.
•Helps to visualize a certain use case at a more detailed level.
• Most commonly used in the following ways:
– Business Modelling: To model business process processes and
workflows.
– Analysis: To model the flow in a use case and between use cases.

– Design: To model the details of an operation or algorithm.

• Usually are easily understood by stakeholders, provided they


are simple.
• An activity starts with an initial node to indicate the place
where execution begins when the activity is invoked.

• One or more final nodes indicate places where the activity


terminates.

• Activities can have preconditions and postconditions:

– Preconditions: Things that must be true before the activity can start.
– Postconditions: Things that will be true after the activity has
finished.

• Actions within the activity can also have their own local
preconditions and postconditions.
Example:
• A common use of activity diagrams is to model a use case as a series of
actions.
• Use cases express system behaviour as an interaction between an actor
and the system whereas activity diagrams express it as a series of actions.
• Activities are networks of nodes connected by edges.

• Edges represent flow through the activity.


There are two edge categories:
– Control flows: Represent the flow of control through the activity.
– Object flows: Represent the flow of objects through the activity.
Example of the flow of “Order” object from “Fill Order” action
to “Review Order” action:

Object Flow

Object node
• There are three node categories:
– Action: Represent discrete units of work that are atomic within the
activity.
– Control: Control the flow through the activity.
– Object: Represent objects used in the activity.
Action nodes
• Call action nodes:
• Send signal action node, and Accept event action nodes:
• Accept time event action nodes:
– Respond to time.
– Has a time expression, and it generates a time event
when this expression becomes true.
Control nodes
• Initial node and final nodes (i.e. activity final node, flow final
node):
– Initial node is the point which the flow starts.

– May have more than one initial node (i.e. flows start at all of the
initial nodes simultaneously and execute concurrently).

– Activity final node stops all flows within an activity.

– May have many final nodes (i.e. the first one to be activated
terminates all other flows and the activity itself).

– The flow final node stops one of the flows within the activity, the
other flows continue.
• Decision nodes:
– Has one input edge and two or more alternate output edges.

– The input edge is offered to all of the output edges but traverses at
most one of them.

– Each of the output edges is protected by a guard condition such that


the edge traverses if and only if the guard condition evaluates to
true.

– The guard conditions must be mutually exclusive so that only one of


them can be true at any point in time.

– The keyword else can be used to specify the edge traversed if none
of the guard conditions are true.
• Merge nodes:

– Have two or more input edges and a single output edge.

– They merge all their incoming flows into a single outgoing flow.
• Fork and join nodes:
– Concurrent flows within an activity can be shown by using a fork
node to split a single flow into multiple concurrent flows.

– Often need to show concurrent activities when modelling business


processes.

– A fork node has one incoming edge and two or more outgoing edges.
This splits the single incoming flow into multiple parallel outgoing
flows. Each outgoing edge may have a guard condition, which the
outgoing edge can only transverse if the guard condition is true.

– Join nodes have multiple incoming edges and a single outgoing edge.
They synchronise flows and perform a logical AND on their input
edges.
Note:
1.The product is designed first;
2.The product is marketed and manufactured concurrently;
3.The product is sold only after both the marketing and manufacturing
processes are complete.
Example:

Fork Node
Swimlanes
•Swimlanes group related activities into one column or one row.
Swimlanes can be vertical and horizontal.

•Commonly used to represent:


– Classes and Components (in design modelling)
– Organisational units (in business modelling)
– Roles (in workflow modelling)
Example:
Example:
Example
Statecharts
Statechart Diagram:
•Shows different states of an object during its lifetime and these
states are changed by events.
•Statechart diagrams are useful to model the reactive systems.
– Reactive systems can be defined as a system that responds to external
or internal events.
State and Transitions

•A state represents the conditions of an object at certain points


in time.
•Transition changes one state into another state, and is caused
by an event.
Conditional Transitions

•Transition only occurs when an event occurs and the


corresponding condition is satisfied.
Activities and Actions of States and Transitions

Actions system shall execute:


•../action - When performing a state transition
•entry - On entering a state
•exit - When leaving a state
•throughout - While being in a state
Initial/Default and Final States

•Initial/default state is the state in which the system execution


starts.
•Final state is the state in which the system execution
terminates.
Initial/Default State

•Default state is the initial state in which the system execution


starts.
Superstate

•Superstate encapsulates several states.


Referring to another statechart
Default State in Superstate
History State
Entry and Exit Points

•Entry point defines a particular meaning of entering a


superstate.
•Exit point defines a particular meaning of leaving a superstate.
•Can be more than one entry/exit points.
Condition State

Conditional transitions can be replaced by:

Condition state
Concurrent States
THANK YOU
• Question?
• Tutorial (this week):
– Conduct analysis (group project)
• Draw Use Case Diagrams & Specifications
• Draw Sequence Diagrams

• Lecture (next week):


– Requirements Validation & Negotiation
RECAP - Group Project (Phase 2):
Requirements Analysis & Modelling
Based on the requirements that you elicited in Phase 1:
•Draw a Goal Diagram
— To illustrate the goals of stakeholders.

•Draw a Use Case Diagram and Use Case Templates/Specifications


— To illustrate and elaborate the functional requirements.

•Draw Sequence Diagrams/Charts


— To illustrate the interactions between actors and system.

•Draw a Context Diagram and Data Flow Diagrams


— To illustrate system boundary and data flows between functions/processes.

Include the above in the report. Submit at the end of the semester
(Phase 1 + 2 + 3).
Use Case
Diagram
Example:
Sequence
Diagram
Example:
Register for Exam

You might also like