Sre Lab 02
Sre Lab 02
SOFTWARE REQUIREMENT
ENGINEERING
Experiment 2
Introduction to Unified Modeling Language
Purpose:
This experiment provides an introduction to Unified Modeling Language. Student will get
basic introduction of the diagrams available for sysrem modeling. Star UML modelling
Objectives:
3. Components of UML.
1. StarUML v2.8.0
2. Microsoft Visio Professional 2013
Before developing a project the system has to be studied carefully. From the day one we
take notes and write everything regarding the system from scratch this is called SRS
Document. SRS includes the scope, purpose, authors, functional requirements, software,
tools, nonfunctional requirements etc.
The Unified Modeling Language (UML) enables system developers to create blueprints
that capture their requirements in a standard, easy-to understand way, and provides a
mechanism to effectively share and communicate these requirements with others.
It does this via a set of symbols and diagrams.
Each diagram plays a different role within the development process.
UML can be used with all processes, throughout the software development life cycle. UML
is not a methodology, it does not require any formal work products .Yet it does provide
several types of diagrams that increase the ease of understanding an application under
development.
The most useful, standard UML diagrams are:
Class diagram
Object diagram
Use case diagram
State-chart diagram
Communication diagram
Sequence diagram
Activity diagram
Component diagram
Deployment diagram
Class Diagram:
A class is a category or group of things that have the same attributes and the same
behaviors.
A rectangle is the icon that represents the class.
It’s divided into three areas. The uppermost area contains the name, the middle
area holds the attributes, and the lowest area holds the operations i.e Anything in
the class of washing machines has attributes such as brand name, model, serial
number, and capacity. Behaviors for things in this class include the operations
“accept clothes,” “accept detergent,” “turn on,” and “turn off.”
In UML, a multiword classname has initial capital letters for all the words and
eliminates white space between each word (for example, WashingMachine).
Attribute names and operation-names follow the same convention, but the first
letter of the first word isn’t capitalized (for example, acceptClothes ()).
Object Diagram:
An object is an instance of a class—a specific thing that has specific values of the class’s
attributes. The icon is a rectangle, just like the class icon, but the name is underlined. In
the icon on the left, the name of the specific instance is on the left side of a colon, and the
name of the class is on the right side of the colon. The name of the instance begins with a
lowercase letter. It’s also possible to have an anonymous object, as the icon on the right of
Software Requirement Engineering UET Taxila
UNIVERSITY OF ENGINEERING AND TECHNOLOGY, TAXILA
FACULTY OF TELECOMMUNICATION AND INFORMATION ENGINEERING
Figure shows. This just means that you don’t supply a specific name for the object,
although you do show the class it belongs to.
State Diagram:
At any given time, an object is in a particular state. This transition from one state to the
next state is represented by state diagram.i.e A person can be a newborn, infant, child,
adolescent, teenager, or adult. An elevator is either moving or stationary. A washing
machine can be either in the soaking, washing, rinsing, spinning, or off state. The symbol
at the top of the figure represents the start state and the symbol at the bottom represents
the end state.
Communication Diagram:
Both the sequence diagram and the communication diagram show interactions among
objects. For this reason, the UML refers to them collectively as interaction diagrams.
Rather than represent time in the vertical dimension, this diagram shows the order of
messages by attaching a number to the message label.
Sequence Diagram:
Objects interact with one another, and these interactions occur over time. The UML
sequence diagram shows the time-based dynamics of the interaction.
Arrow represents a message that goes from one object to another. Time, in this diagram,
proceeds from top to bottom. So the first message is timeSoak (), which the timer sends
to itself. The second message is sendWater (), which the timer sends to the water pipe.
The final message, stopRotating (), goes from the timer to the drum.
Activity Diagram:
The activities that occur within a use case or within an object’s behavior typically occur in
a sequence is represented by the activity diagram.
Deployment Diagram:
The UML deployment diagram shows the physical architecture of a computer based
system. It can depict the computers, show their connections with one another, and show
the software that sits on each machine. Each computer is represented as a cube, with
interconnections between computers drawn as lines connecting the cubes.
Notes:
It often happens that one part of a diagram present an ambiguous explanation of why
it’s there or how to work with it. When that’s the case, the UML note is helpful. Think of
a note as the graphic equivalent of a yellow sticky. Its icon is a rectangle with a folded
corner. Inside the rectangle is explanatory text.
Timing Diagram:
Timing diagram is designed to show how long an object is in a state.
If we were to create a system that deals with information on people—say, a system for a
human resources department—we would likely incorporate some of these attributes and
some of these operations in our software.
Washing Machine
Attributes: brandName, modelName, serialNumber, and capacity
Operations: acceptClothes(), acceptDetergent(), turnOn(), and turnOff()
Class:
In the world of object-orientation, a class is used for categorization.it is used to place all
same types of things under a single name. For example students together makes a class
because they have same education level, same subjects and they do same operation that is
takeclass() etc.
A class is also a template for making objects sort of like a cookie cutter that you use to
stamp out cookies.
Object:
An object is an instance of a class (a category). You and I, for example, are instances of the
Person class. An object has structure. That is, it has attributes (properties) and behavior.
An object's behavior consists of the operations it carries out. You can create new objects
based on WashingMachine class. In a class students are objects of class. For example you
all are objects of 2k22-SE class.
What is StarUML?
StarUML™ is a software modeling platform that supports UML (Unified Modeling
Language).
Installation Steps: Run the setup.
Step 1:
Step 2
Step 3
Step 4
Step 5
Step 6
StarUML Environment
Task 1:
Software Requirement Engineering UET Taxila
UNIVERSITY OF ENGINEERING AND TECHNOLOGY, TAXILA
FACULTY OF TELECOMMUNICATION AND INFORMATION ENGINEERING
a. Identify the classes and objects from the list given above.
b. Write at least 3 attributes and 2 operations of each class found in above list.
c. Name the possible class of objects you found in above list.
Task 2 :
Consider that a student is a class writes its operations and attributes.
Task 3 :
Consider that a bus is a class writes its operations and attributes.