You are on page 1of 37

SE201-SOFTWARE REQUIREMENTS

ANALYSIS
LECTURE 10
Student Council Elections
Candidates have to visit the following link for details.

https://sks.uskudar.edu.tr/duyuru/ogrenci-temsilcisi-secim-duyurusu
HOMEWORK 2

• Homework 2: User Interface Design of your system


• Submission Date: 25/12/2020
• Presentation Schedule: 28/12/2020 (Lecture 13) and 4/01/2021 (Lecture 14)
ACTIVITY DIAGRAMS
ACTIVITY DIAGRAMS (1)

 To model the dynamic aspects of a system

 It is essentially a flowchart
 Showing flow of control from activity to activity

 Purpose
 Model business workflows

 Model operations

Lecture Notes of Prof. M.E. Fayad


ACTIVITY DIAGRAMS (2)

 Activity diagrams commonly contain

 Activity states and action states

 Transitions

 Objects

Lecture Notes of Prof. M.E. Fayad


System Analysis and Design with UML 5th edition
Dennis, Wixon and Tegarden
NOTATION

2. Transition

Activity1() Activity2()

1. Activities

Lecture Notes of Prof. M.E. Fayad


TRANSITIONS (1)

 When the action or activity of a state completes, flow of control passes immediately to
the next action or activity state

 A flow of control has to start and end some place


 initial state -- a solid ball
 stop state -- a solid ball inside a circle

Lecture Notes of Prof. M.E. Fayad


NOTATION - 2

[x>0]
[x>0]

Activity1()
[x=0] [x=0]

[x<0] [x<0]

3. Decision Diamond

Lecture Notes of Prof. M.E. Fayad


ACTIVITY DIAGRAMS ALLOW TO MODEL
DECISIONS

Decision
[lowPriority]
Open Allocate
Incident Resources

[fire & highPriority]

[not fire & highPriority]


Notify
Fire Chief

Notify
Police Chief

Object-Oriented Software Engineering Using UML,


Patterns, and Java, by Bernd Bruegge and Allen H.
Dutoit
BRANCHING (1)
 A branch specifies alternate paths taken based on some Boolean expression

 A branch may have one incoming transition and two or more outgoing ones

Lecture Notes of Prof. M.E. Fayad


NOTATION - 3

4.1 Synch. Bar (Join) 4.2 Splitting Bar (Fork)

{AND}
{OR}
{XOR}

Lecture Notes of Prof. M.E. Fayad


FORKING AND JOINING

 Use a synchronization bar to specify the forking and joining of parallel flows of control

 A synchronization bar is rendered as a thick horizontal or vertical line

Lecture Notes of Prof. M.E. Fayad


FORK

 A fork may have one incoming transitions and two or more outgoing transitions
 each transition represents an independent flow of control

 conceptually, the activities of each of outgoing transitions are concurrent (at the same time)
 either truly concurrent (multiple nodes)

 or sequential (consecutive) yet interleaved (one node)

Splitting Bar (Fork)

Lecture Notes of Prof. M.E. Fayad


JOIN

 A join may have two or more incoming transitions and one outgoing transition
 above the join, the activities associated with each of these paths continues in parallel

 at the join, the concurrent flows synchronize

 each waits until all incoming flows have reached the join, at which point one flow of control continues on
below the join

Synch. Bar (Join)

Lecture Notes of Prof. M.E. Fayad


ACTIVITY DIAGRAMS CAN MODEL CONCURRENCY

 Synchronization of multiple activities


 Splitting the flow of control into multiple threads

Splitting (fork) Synchronization


Allocate (join)
Resources

Open Coordinate Archive


Incident Resources Incident

Document
Incident

Object-Oriented Software Engineering Using UML,


Patterns, and Java, by Bernd Bruegge and Allen H.
Dutoit
Example
The activity diagram executes the “Check Inventory”
task and the “Validate Customer Standing” task in
parallel.

The join bar waits until both activities are completed


before it allows the next activity to start.

The next activity verifies the results of both steps –


do we have inventory and is the customer in good
standing?

If both conditions are fulfilled, the process goes on to


fulfill the order (ship goods, send invoice).
Otherwise, we transition to an exception handling
activity.
NOTATION - 4

Initial Node or Start Marker Stop Marker

The initial node indicates where the The diagram also contains an activity
execution of an activity begins. final node that represents the end of an
activity.
It does not have any incoming edges but
has at least one outgoing edge and is We will look at the activity final node,
noted as a solid black circle. noted by a solid black circle within
another circle

5. Start & Stop Markers

Lecture Notes of Prof. M.E. Fayad


UML @ Classroom, An Introduction to Object-Oriented Modeling.
Martina Seidl, Marion Scholz, Christian Huemer, Gerti Kappel
EXAMPLE WITH MULTIPLE INITIAL NODES

The example in Figure shows two concurrent subpaths of the activity Conduct lecture.

If the activity Conduct lecture is activated, a token is placed at each of the two initial nodes and thus both subpaths are activated.

One subpath relates to the actions of students and the other subpath refers to the actions performed by a lecturer.

In the action Write exam, both paths are merged. A token must be present at both incoming edges for the action Write exam to be
executed.

UML @ Classroom, An Introduction to Object-Oriented Modeling.


Martina Seidl, Marion Scholz, Christian Huemer, Gerti Kappel
NOTATION - 5

Developers Testers Markers

Partitions make the diagram


clearer, enabling you to see the
areas of responsibility quickly,
thus introducing more detailed
information into the model.

Swimlane Swimlane Swimlane

Application/Department/Group/Role Boundaries
Lecture Notes of Prof. M.E. Fayad
UML @ Classroom, An Introduction to Object-Oriented Modeling.
Martina Seidl, Marion Scholz, Christian Huemer, Gerti Kappel
SWIMLANES (1)

 A swimlane specifies a locus/place of activities


 To partition the activity states on an activity diagram into groups
 each group representing the business organization responsible for those activities
 each group is called a swimlane

 Each swimlane is divided from its neighbor by a vertical solid line

Lecture Notes of Prof. M.E. Fayad


SWIMLANES (2)

 Each swimlane has a name unique within its diagram


 Each swimlane may represent some real-world entity
 Each swimlane may be implemented by one or more classes
 Every activity belongs to exactly one swimlane, but transitions may cross lanes

Lecture Notes of Prof. M.E. Fayad


Figure shows an example of the
use of swimlanes (partitions) in
an activity diagram that models
the execution of an exam.

The parties involved are


• a student,
• an assistant, and
• a professor

The use of partitions allows each


of these actors to be assigned the
actions that they have to
perform.

UML @ Classroom, An Introduction to Object-Oriented Modeling.


Martina Seidl, Marion Scholz, Christian Huemer, Gerti Kappel
A partition can itself be subdivided into multiple subpartitions.

Figure shows an example of this. In this example, the institute employees Professor and Secretary are involved in
the execution of an exam.

UML @ Classroom, An Introduction to Object-Oriented Modeling.


Martina Seidl, Marion Scholz, Christian Huemer, Gerti Kappel
Object-Oriented Software Engineering Using UML,
Patterns, and Java, by Bernd Bruegge and Allen H.
Dutoit
EXAMPLE

Lecture Notes of Prof. M.E. Fayad


EXAMPLE

An Approach for Generating Minimal Test Cases for Regression Testing, Sapna P G, Arunkumar Balakrishnan
EXAMPLE

bring back together different Merge


decision paths node

[create] [cancel] [change]

System Analysis and Design with UML 3rd edition


Dennis, Wixon and Tegarden
EXAMPLE

concurrent flows

System Analysis and Design with UML 5th edition Dennis, Wixon and
Tegarden
EXAMPLE

Campus Housing Example - In this example, we are


going to focus on the Maintain Available Rental Unit
Information associated with the apartment owners.
There are two separate activities (subprocesses): one to add
a rental unit and one to delete a rental unit.
To add a rental unit, the apartment owner must provide the
campus housing service with the location of the apartment,
the number of bedrooms in the apartment, and the monthly
rent of the apartment.
To delete an apartment, the apartment owners must tell the
campus housing service that the specific apartment has
been rented and is no longer available.
bring back together different
Using this information, the activity diagram that represents decision paths
the logical description of the Maintain Available Rental
Unit Information use case is portrayed in Figure 4-11. merge node

System Analysis and Design with UML 5th edition Dennis, Wixon and
Tegarden
EXAMPLE

The borrowing activities are built around checking books out and returning books by borrowers.
There are three types of borrowers: students, faculty or staff, and guests.

Regardless of the type of borrower, the borrower must have a valid ID card.
o If the borrower is a student, having the system check with the registrar’s student database validates
the ID card.
o If the borrower is a faculty or staff member, having the system check with the personnel office’s
employee database validates the ID card.
o If the borrower is a guest, the ID card is checked against the library’s own borrower database.

If the ID card is valid, the system must also check to determine whether the borrower has any
overdue books or unpaid fines.
o If the ID card is invalid, the borrower has overdue books, or the borrower has unpaid fines, the
system must reject the borrower’s request to check out a book, otherwise the borrower’s request
should be honor

System Analysis and Design with UML 5th edition Dennis, Wixon and
Tegarden
(penalty)

Activity Diagram for the Borrow Books Use Case

System Analysis and Design with UML 5th edition Dennis, Wixon and
Tegarden
EXAMPLE

Draw a set of activity diagrams for an online university registration system.

 The system should enable the staff of each academic department to examine the courses offered by
their department, add and remove courses, and change the information about them (e.g., the maximum
number of students permitted).

 It should permit students to examine currently available courses, add and drop courses to and from their
schedules, and examine the courses for which they are enrolled.

 Department staff should be able to print a variety of reports about the courses and the students enrolled
in them.

 The system should ensure that no student takes too many courses and that students who have any
unpaid fees are not permitted to register (assume that fees data are maintained by the university’s
financial office, which the registration system accesses but does not change).

System Analysis and Design with UML 5th edition Dennis, Wixon and
Tegarden
EXAMPLE

Draw a set of activity diagrams for an online university registration system.

 The system should enable the staff of each academic department to examine the courses offered by their
department, add and remove courses, and change the information about them (e.g., the maximum number
of students permitted).

 It should permit students to examine currently available courses, add and drop courses to and from their
schedules, and examine the courses for which they are enrolled.

 Department staff should be able to print a variety of reports about the courses and the students enrolled in
them.

 The system should ensure that no student takes too many courses and that students who have any unpaid
fees are not permitted to register (assume that fees data are maintained by the university’s financial office,
which the registration system accesses but does not change).

System Analysis and Design with UML 5th edition Dennis, Wixon and
Tegarden
decision node

Merge
node

decision node

decision node decision node

Merge decision node


node

Merge
node
Merge
node
Merge
node

System Analysis and Design with UML 5th edition Dennis, Wixon and
Tegarden
REFERENCES

 Lecture Notes of Prof. M.E. Fayad


 https://www.enterpriseintegrationpatterns.com/patterns/messaging/Chapter1.html

You might also like