You are on page 1of 32

DEWAN V.

S INSTITUTE OF
ENGINEERING & TECHNOLOGY

DR. A.P.J. ABDUL KALAM TECHNICAL


UNIVERSITY LUCKNOW

KCA352: Software Engineering Lab

Session: 2021-2022 (3rd Semester)

DEPARTMENT OF COMPUTER APPLICATION

Submitted To: Submitted By:

Mr. Gaurav Sharma Aashi Goel (2003110140002)


INDEX
S.No. Name of the Experiment Date Signature

1. Prepare a SRS document in line with the 2/10/2021


IEEE recommended standards.

2. Draw the use case diagram and specify the 2/10/2021


role of each of the actors

3. Prepare state the precondition , post 2/10/2021


condition and function of each use case.

4. Draw the activity diagram 17/10/2021

5. Identify the classes. Classify them as 17/10/2021


weak and strong classes and draw
the class diagram.

6. Draw the sequence diagram for any two 17/10/2021


scenarios

7. Draw the collaboration diagram 4/11/2021

8. Draw the state chart diagram 4/11/2021

9. Draw the component diagram 24/11/2021

10. Draw the deployment diagram 24/11/2021


PROGRAM LAB LIST

1. Prepare a SRS document in line with the IEEE recommended standards.

2. Draw the use case diagram and specify the role of each of the actors.

3. Prepare state the precondition , post condition and function of each use case.

4. Draw the activity diagram.

5. Identify the classes. Classify them as weak and strong classes and draw the class diagram.

6. Draw the sequence diagram for any two scenarios.

7. Draw the collaboration diagram.

8. Draw the state chart diagram.

9. Draw the component diagram.

10. Draw the deployment diagram.


1. Prepare a SRS document in line with the IEEE recommended standards.
A software requirements specification (SRS) is a document that describes what the software will do
and how it will be expected to perform. It also describes the functionality the product needs to fulfill all
stakeholders (business, users) needs.

Your first step is to create an outline for your software requirements specification. This
may be something you create yourself.

1. Introduction

1.1 Purpose

1.2 Intended Audience

1.3 Intended Use

1.4 Scope

1.5 Definitions and Acronyms

2. Overall Description

2.1 User Needs

2.2 Assumptions and Dependencies

3. System Features and Requirements

3.1 Functional Requirements

3.2 External Interface Requirements

3.3 System Features

3.4 Nonfunctional Requirements


2. Draw the use case diagram and specify the role of each of the actors.

What is a Use Case Diagram?

A use case diagram is a dynamic or behavior diagram in UML. Use case diagrams model the
functionality of a system using actors and use cases. Use cases are a set of actions, services, and
functions that the system needs to perform. In this context, a "system" is something being
developed or operated, such as a web site. The "actors" are people or entities operating under
defined roles within the system.

Basic Use Case Diagram Symbols and Notations

Use Case
Draw use cases using ovals. Label the ovals with verbs that represent the system's functions.

Actors
Actors are the users of a system. When one system is the actor of another system, label the actor
system actor stereotype.

Relationships
Illustrate relationships between an actor and a use case with a simple line. For relationships among use
cases, use arrows labeled either "uses" or "extends." A "uses" relationship indicates that one use case is
needed by another in order to perform a task. An "extends" relationship indicates alternative
options under a certain use case.
Example of a Use Case Diagram
A use case diagram depicting the Online Shopping website is given below.
3. Prepare state the precondition, post condition and function of each use case.

Preconditions and Post Condition . A precondition is the state of the system required before
the use case can be started A post condition is the state the system can be in after the use case has
ended Identifying post conditions can help describe use cases themselves First define what the use
case is supposed to achieve, the post condition Then describe how to reach this condition (the flow of
events needed)

Detail Each Use Case Describe functional steps in sufficient detail to … Enable requirement
specification Early design work to begin Achieve stakeholder and user understanding and approval
Steps Structure and detail the flow of events Describe preconditions Describe post conditions
Describe any special requirements of the use case Describe any communication protocols [optional]
Evaluate the results
Use Case Diagram: Class Registration

Schedule

Add
CIas6

Drop
Class

ewWy
Class
es

Obwin I-
4eIp

Time
4. Draw the activity diagram.

ACTIVITY DIAGRAM is basically a flowchart to represent the flow from one activity to another
activity. The activity can be described as an operation of the system. The basic purpose of
activity diagrams is to capture the dynamic behavior of the system.. It is also called object-
oriented flowchart.
This UML diagram focuses on the execution and flow of the behavior of a system instead of
implementation. Activity diagrams consist of activities that are made up of actions that apply to
behavioral modeling technology.

Activity Diagram Notation Summary/ Components


Notation Description UML Notation

Activity
Is used to represent a set of actions

Action
A task to be performed

Control Flow
Shows the sequence of execution

Object Flow
Show the flow of an object from one
activity (or action) to another activity
(or action).

Initial Node
Portrays the beginning of a set of
actions or activities

Activity Final Node


Stop all control flows and object flows
in an activity (or action)

Object Node
Represent an object that is connected to
a set of Object Flows
Decision Node
Represent a test condition to ensure
that the control flow or object flow
only goes down one path

Merge Node
Bring back together different decision
paths that were created using a
decision-node.

Fork Node
Split behavior into a set of parallel or
concurrent flows of activities (or
actions)

Join Node
Bring back together a set of parallel or
concurrent flows of activities (or
actions).

Swimlane and Partition


A way to group activities performed by
the same actor on an activity diagram or
to group activities in a single thread

Activity Diagram - Learn by Examples

A basic activity diagram - flowchart like


Example of Activity Diagram
Let us consider mail processing activity as a sample for Activity Diagram. Following diagram represents activity for
processing e-mails.
open mail

is
important]

decision

read mail delete mail


5. Identify the classes. Classify them as weak and strong classes and draw the class
diagram.

What is Class Diagram?


In software engineering, a class diagram in the Unified Modeling Language (UML) is a type of static structure
diagram that describes the structure of a system by showing the system's classes, their attributes, operations (or
methods), and the relationships among objects.

Class Notation

A class notation consists of three parts:


1. Class Name
 The name of the class appears in the first partition.
2. Class Attributes
 Attributes are shown in the second partition.
 The attribute type is shown after the colon.
 Attributes map onto member variables (data members) in code.
3. Class Operations (Methods)
 Operations are shown in the third partition. They are services the class provides.
 The return type of a method is shown after the colon at the end of the method signature.
 The return type of method parameters is shown after the colon following the parameter name.
 Operations map onto class methods in code

The graphical representation of the class - MyClass as shown above:


 MyClass has 3 attributes and 3 operations
 Parameter p3 of op2 is of type int
 op2 returns a float
 op3 returns a pointer (denoted by a *) to Class6

Class Relationships
A class may be involved in one or more relationships with other classes. A relationship can be one of the following
types: (Refer to the figure on the right for the graphical representation of relationships).

Relationship Type Graphical Representation


Inheritance (or Generalization):
 Represents an "is-a" relationship.
 An abstract class name is shown in italics.
 SubClass1 and SubClass2 are specializations of Super
Class.
 A solid line with a hollow arrowhead that point from
the child to the parent class

Simple Association:
 A structural link between two peer classes.
 There is an association between Class1 and Class2
 A solid line connecting two classes

Aggregation:
A special type of association. It represents a "part of"
relationship.

 Class2 is part of Class1.


 Many instances (denoted by the *) of Class2 can be
associated with Class1.
 Objects of Class1 and Class2 have separate lifetimes.
 A solid line with an unfilled diamond at the
association end connected to the class of composite

Composition:
A special type of aggregation where parts are destroyed when
the whole is destroyed.

 Objects of Class2 live and die with Class1.


 Class2 cannot stand by itself.
 A solid line with a filled diamond at the association
connected to the class of composite

Dependency:
 Exists between two classes if the changes to the
definition of one may cause changes to the other
(but not the other way around).
 Class1 depends on Class2
 A dashed line with an open arrow

Relationship Names

 Names of relationships are written in the middle of the association line.


 Good relation names make sense when you read them out loud:
 "Every spreadsheet contains some number of cells",
 "an expression evaluates to a value"
 They often have a small arrowhead to show the direction in which direction to read the relationship,
e.g., expressions evaluate to values, but values do not evaluate to expressions.
Access for each of these visibility types is shown below for members of different classes.

Access Right public (+) private (-) protected (#) Package (~)

Members of the same class yes yes yes yes


Members of derived classes yes no yes yes
Members of any other class yes no no in same package

Multiplicity

How many objects of each class take part in the relationships and multiplicity can be expressed as:
 Exactly one - 1
 Zero or one - 0..1
 Many - 0..* or *
 One or more - 1..*
 Exact Number - e.g. 3..4 or 6
 Or a complex relationship - e.g. 0..1, 3..4, 6.* would mean any number of objects other than 2 or 5

Example of Hospital Management System


-d location
t
+dept
+d e pt +’dept details()
details() +dept +dept details() +dept de
details() ”details() taiIs()
6. Draw the sequence diagram for any two scenarios.

Sequence Diagram

The sequence diagram represents the flow of messages in the system and is also termed as an
event diagram. It helps in envisioning several dynamic scenarios. It portrays the communication
between any two lifelines as a time-ordered sequence of events, such that these lifelines took part
at the run time. In UML, the lifeline is represented by a vertical bar, whereas the message flow is
represented by a vertical dotted line that extends across the bottom of the page. It incorporates the
iterations as well as branching.

Notations of a Sequence Diagram


Lifeline

An individual participant in the sequence diagram is represented by a lifeline. It is positioned at the


top of the diagram.

Actor

A role played by an entity that interacts with the subject is called as an actor. It is out of the scope
of the system. It represents the role, which involves human users and external hardware or
subjects. An actor may or may not represent a physical entity, but it purely depicts the role of an
entity. Several distinct roles can be played by an actor or vice versa.
Activation

It is represented by a thin rectangle on the lifeline. It describes that time period in which an
operation is performed by an element, such that the top and the bottom of the rectangle is
associated with the initiation and the completion time, each respectively.

Messages

The messages depict the interaction between the objects and are represented by arrows. They are
in the sequential order on the lifeline. The core of the sequence diagram is formed by messages and
lifelines.

Following are types of messages enlisted below:


o Call Message: It defines a particular communication between the lifelines of an interaction,
which represents that the target lifeline has invoked an
operation.

o Return Message: It defines a particular communication between the lifelines of interaction


that represent the flow of information from the receiver of the corresponding caller
message.

o Self Message: It describes a communication, particularly between the lifelines of an


interaction that represents a message of the same lifeline,
has been invoked.

o Recursive Message: A self message sent for recursive purpose is called a recursive message.
In other words, it can be said that the recursive message is a special case of the self
message as it
represents the recursive calls.

o Create Message: It describes a communication, particularly between the lifelines of an


interaction describing that the target (lifeline) has been
instantiated.

o Destroy Message: It describes a communication, particularly between the lifelines of an


interaction that depicts a request to destroy the lifecycle of the target.
o Duration Message: It describes a communication particularly between the lifelines of an
interaction, which portrays the time passage of the message while modeling a system.

Note

A note is the capability of attaching several remarks to the element. It basically carries useful information
for the modelers.

Sequence Fragments
1. Sequence fragments have been introduced by UML 2.0, which makes it quite easy for the
creation and maintenance of an accurate sequence diagram.
2. It is represented by a box called a combined fragment, encloses a part of interaction inside
a sequence diagram.
3. The type of fragment is shown by a fragment operator.
Types of fragments

Following are the types of fragments enlisted below;

Operator Fragment Type

alt Alternative multiple fragments: The only fragment for which the
condition is true, will execute.

opt Optional: If the supplied condition is true, only then the fragments will
execute. It is similar to alt with only one trace.

par Parallel: Parallel executes fragments.

loop Loop: Fragments are run multiple times, and the basis of interaction
is shown by the guard.
region Critical region: Only one thread can execute a fragment at once.

neg Negative: A worthless communication is shown by the fragment.

ref Reference: An interaction portrayed in another diagram. In this, a


frame is drawn so as to cover the lifelines involved in the
communication. The parameter and return value can be explained.

sd Sequence Diagram: It is used to surround the whole sequence


diagram.
Example of a Sequence Diagram
An example of a high-level sequence diagram for online bookshop is given below.

Any online customer can search for a book catalog, view a description of a particular book, add a
book to its shopping cart, and do checkout.
7. Draw the collaboration diagram.

Collaboration Diagram
The collaboration diagram is used to show the relationship between the objects in a system. Both
the sequence and the collaboration diagrams represent the same information but differently.
Instead of showing the flow of messages, it depicts the architecture of the object residing in the
system as it is based on object-oriented programming. An object consists of several features.
Multiple objects present in the system are connected to each other. The collaboration diagram,
which is also known as a communication diagram, is used to portray the object's architecture in
the system.

Notations of a Collaboration Diagram


Following are the components of a component diagram that are enlisted below:

1. Objects: The representation of an object is done by an object symbol with its name and
class underlined, separated by a colon.
In the collaboration diagram, objects are utilized in the following ways:
o The object is represented by specifying their name and class.
o It is not mandatory for every class to appear.
o A class may constitute more than one object.
o In the collaboration diagram, firstly, the object is created, and then its class is
specified.
o To differentiate one object from another object, it is necessary to name them.
2. Actors: In the collaboration diagram, the actor plays the main role as it invokes the
interaction. Each actor has its respective role and name. In this, one actor initiates the
use case.
3. Links: The link is an instance of association, which associates the objects and actors. It
portrays a relationship between the objects through which the messages are sent. It is
represented by a solid line. The link helps an object to connect with or navigate to another
object, such that the message flows are attached to links.
4. Messages: It is a communication between objects which carries information and
includes a sequence number, so that the activity may take place. It is represented by a
labeled arrow, which is placed near a link. The messages are sent from the sender to the
receiver, and the direction must be navigable in that particular direction. The receiver must
understand the message.
Example of a Collaboration Diagram
8. Draw the state chart diagram.

State Chart Diagram

he name of the diagram itself clarifies the purpose of the diagram and other details. It describes different
states of a component in a system. The states are specific to a component/object of a system.
A Statechart diagram describes a state machine. State machine can be defined as a machine which
defines different states of an object and these states are controlled by external or internal events.
Activity diagram explained in the next chapter, is a special kind of a Statechart diagram. As Statechart
diagram defines the states, it is used to model the lifetime of an object.

How to Draw a Statechart Diagram?


Statechart diagram is used to describe the states of different objects in its life cycle. Emphasis is placed
on the state changes upon some internal or external events. These states of objects are important to
analyze and implement them accurately.
Statechart diagrams are very important for describing the states. States can be identified as the
condition of objects when a particular event occurs.
Before drawing a Statechart diagram we should clarify the following points −
 Identify the important objects to be analyzed.
 Identify the states.
 Identify the events.
Following is an example of a Statechart diagram where the state of Order object is analyzed
The first state is an idle state from where the process starts. The next states are arrived for events like
send request, confirm request, and dispatch order. These events are responsible for the state changes
of order object.
During the life cycle of an object (here order object) it goes through the following states and there may
be some abnormal exits. This abnormal exit may occur due to some problem in the system. When the
entire life cycle is complete, it is considered as a complete transaction as shown in the following figure.
The initial and final state of an object is also shown in the following figure.
9. Draw the component diagram.

Component Diagram

A component diagram is used to break down a large object-oriented system into the smaller
components, so as to make them more manageable. It models the physical view of a system such
as executables, files, libraries, etc. that resides within the node.

Notation of a Component Diagram


a)A component

b) A node

Example of a Component Diagram

A component diagram for an online shopping system is given below:


Paymen
t
Account
details
10. Draw the deployment diagram.

Deployment Diagram

The deployment diagram visualizes the physical hardware on which the software will be deployed.
It portrays the static deployment view of a system. It involves the nodes and their
relationships.

It ascertains how software is deployed on the hardware. It maps the software architecture created
in design to the physical system architecture, where the software will be executed as a node. Since it
involves many nodes, the relationship is shown by utilizing communication paths.

Symbol and notation of Deployment diagram


The deployment diagram consist of the following notations:

1. A component
2. An artifact
3. An interface
4. A node
Deployment Diagram for Library Management System

You might also like