LP 4 Lab Manual
LP 4 Lab Manual
LP 4 Lab Manual
Vision
Mission
• Generation of national wealth through education and research
• Imparting quality technical education at the cost affordable to all strata of
the society
• Enhancing the quality of life through sustainable development
• Carrying out high-quality intellectual work
• Achieving the distinction of the highest preferred engineering college in theeyes of
the stakeholders
Vision
Mission
• To produce Best Quality Computer Science Professionals by imparting
quality training, hands on experience and value education.
Practical
Assignments
ASSURANCE (STQA)
(OOMD)
Page 4
Assignment No: 1
Group1:
Aim: Write TEST Scenario for Gmail Login Page
Software Requirements:
Ubuntu 18.04
Windows
Hardware Requirements:
Pentium IV system with latest configuration
Theory:
A Test Scenario is defined as any functionality that can be tested. It is also called Test Condition or Test
Possibility. As a tester, you should put yourself in the end user’s shoes and figure out the real-world
scenarios and use cases of the Application Under Test. It is a detailed document of test cases that cover end
to end functionality of a software application in liner statements. The test scenario is a high-level
classification of testable requirements. Before performing the test scenario, the test engineer needs to
consider the test cases for each scenario.
In this section, we are going to discuss the difference between the Test Case and Test Scenario as we
understood that both the test case and test scenario are part of Testing documentation.
As test engineers, we must be aware of these two testing terms as they play a major role in the Software
Test Life Cycle's Test Design and Test Execution phases.
A test Case is a set of actions executed to verify particular features or functionality, whereas a Test
Scenario is any functionality that can be tested.
Test Case is mostly derived from test scenarios, while Test Scenarios are derived from test artifacts
like BRS and SRS.
Test Case helps in exhaustive testing of an application, whereas Test Scenario helps in an agile way of
testing the end-to-end functionality.
Test Cases are focused on what to test and how to test, while Test Scenario is more focused on what to
test.
Test Cases are low-level actions, whereas Test Scenarios are high-level actions.
Test Case requires more resources and time for test execution, while Test Scenario requires fewer
resources and time for test execution.
Test Case includes test steps, data, and expected results for testing, whereas Test Scenario includes an
end-to-end functionality to be tested.
Page 5
TEST Scenario for Gmail Login Page:
Sr.
Test Scenarios
No.
1 Enter the valid email address & click next. Verify if the user gets an option to enter the password.
2 Don’t enter an email address or phone number & just click the Next button. Verify if the user will
get the correct message or if the blank field will get highlighted.
3 Enter the invalid email address & click the Next button. Verify if the user will get the correct message.
4 Enter an invalid phone number & click the Next button. Verify if the user will get the correct message.
5 Verify if a user can log in with a valid email address and password.
6 Verify if a user can log in with a valid phone number and password.
7 Verify if a user cannot log in with a valid phone number and an invalid password.
8 Verify if a user cannot log in with a valid email address and a wrong password.
Conclusion
Wrote test scenarios on Gmail Login page
Page 6
Assignment No: 2
Aim: Write Test cases in excel sheet for Social Media application or website
Objectives:
1. Write cases of social media application or website
Software Requirements:
Ubuntu 18.04
Windows
Hardware Requirements:
Pentium IV system with latest configuration
Theory:
The test case is defined as a group of conditions under which a tester determines whether a software
application is working as per the customer's requirements or not. Test case designing includes
preconditions, case name, input conditions, and expected result. A test case is a first level action and
derived from test scenarios.
It is an in-details document that contains all possible inputs (positive as well as negative) and the
navigation steps, which are used for the test execution process. Writing of test cases is a one-time attempt
that can be used in the future at the time of regression testing.
Test case gives detailed information about testing strategy, testing process, preconditions, and expected
output. These are executed during the testing process to check whether the software application is
performing the task for that it was developed or not.
Test case helps the tester in defect reporting by linking defect with test case ID. Detailed test case
documentation works as a full proof guard for the testing team because if developer missed something,
then it can be caught during execution of these full-proof test cases.
To write the test case, we must have the requirements to derive the inputs, and the test scenarios must be
written so that we do not miss out on any features for testing. Then we should have the test case template
to maintain the uniformity, or every test engineer follows the same approach to prepare the test
document.
Generally, we will write the test case whenever the developer is busy in writing the code.
o When the customer gives the business needs then, the developer starts developing and says that they
need 3.5 months to build this product.
o And In the meantime, the testing team will start writing the test cases.
o Once it is done, it will send it to the Test Lead for the review process.
Page 7
o And when the developers finish developing the product, it is handed over to the testing team.
o The test engineers never look at the requirement while testing the product document because testing is
constant and does not depends on the mood of the person rather than the quality of the test engineer.
1. Open URL :
{website
homepageurl}
2. Click on
Verify Login button
whether a Username from header and
user is able : navigate to User
Same as
TC_0 to login ABCDEF login page should be
Expecte Pass
1 with valid G 3. Enter logged in
d
username Password: registered user’s gracefully
and 123456 username in the
password username field
4. Enter valid
password
5. Click on
Login button
1. It
1. Open URL : should not
{website allow user
homepageurl} tologin
2. Click on 2. It
Verify Login button should
whether it from header and display
Username
allows user navigate to validation
:
to login login page message
TC_0 ABCDEF Same as
with a valid 3. Enter for invalid Pass
2 G expected
username registered user’s credentials
Password:
and an username in the 3.
1233333
invalid username field Incorrect
password. 4. Enter input filed
invalid/incorrec should get
t password highlighte
5. Click on d with
Login button different
color
Page 8
1. It
should not
allow user
tologin
2.
Validation
1. Open URL :
message
Verify the {website
should be
login page homepageurl}
display to
when the 2. Click on
enter
TC_0 fields are Login button Same as
N/A credentials Pass
3 blank and from header and expected
3.
Submit navigate to
Username
button is login page
and
clicked. 3. Click on
Password
Login button
field
should get
highlighte
d with
different
color
Conclusion
Wrote Test cases in excel sheet for Social Media application or website
Assignment No: 3
Objectives:
Page 9
1. Create Defect Report on web application
Software Requirements:
Ubuntu 18.04
Winsows
Hardware Requirements:
Pentium IV system with latest configuration
Theory:
Defect:
A defect in a software product is also known as a bug, error or fault which makes the software produce
an unexpected result as per the software requirements. For example; incorrect data, system hangs,
unexpected errors, missing or incorrect requirements
Defect Report:
A defect report is a document that has concise details about what defects are identified, what action
steps make the defects show up, and what are the expected results instead of the application showing
error (defect) while taking particular step by step actions.
Defect reports are usually created by the Quality Assurance team and also by the end-users
(customers). Often customers detect more defects and report them to the support team of the software
development since the majority of the customers curiously tries out every feature in the application.
Now, you know what actually defect and defect reports are.
So let’s understand, why do they create defect reports ? What do they do with them?
The reason behind why defect reports are created is to help developers to find out the defects easily
and fix them up. A defect report is usually assigned by QA to a developer who then reads the report and
reproduces the defects on the software product by following the action steps mentioned in the report.
After that, the developer fixes the defects in order to get the desired outcome specified in the report.
That is why the defect reports are important and created carefully. Defect reports should be short,
organized, straight to the point and covers all the information that the developer needs to detect the
actual defects in the report by doing what and how the one written the defect report detected the defects.
It is usual for QA teams to get defect reports from the clients that are either too short to reproduce and
rectify or too long to understand what actually went wrong.
For example,
Now, how in the world does a developer or QA know what went wrong which doesn’t meet the client
expectation?
Page 10
In such a case, the developer report to the QA that he couldn’t find any problem or he may have fixed
any other error but not the actual one client detected. So that’s why it’s really important to create a
concise defect report to get bugs fixed.
All right. You have a pretty good idea about what, whys and how’s of a defect report. So it’s time for
what is inside the report.
Now you entered into your application by logging in and navigate to USERS menu > New user,
entered all the information and clicked on SAVE button and now the application crashed and you can
see one error page on the screen, now you would like to report this BUG.
Bug Name: Application crash on clicking the SAVE button while creating a new user.
Bug ID: The BUG Tracking tool will automatically create it once you save this.
Area Path: USERS menu > New Users
Build Number:/Version Number 5.0.1
Severity: HIGH (High/Medium/Low)
Priority: HIGH (High/Medium/Low)
Description:
Application crash on clicking the SAVE button while creating a new user, hence unable to create a
new user in the application.
Steps To Reproduce:
1) Logon into the application
2) Navigate to the Users Menu > New User
3) Filled all the fields
4) Clicked on ‘Save’ button
5) Seen an error page “ORA1090 Exception: Insert values Error…”
6) See the attached logs for more information
Page 11
7) And also see the attached screenshot of the error page.
Expected: On clicking SAVE button should be prompted to a success message “New User has been
created successfully”.
Conclusion
Page 12
Assignment No: 4
Aim: Installation of Selenium grid and selenium Web driver java eclipse (automation tools).
Objectives:
3. To learn Selenium testing tool
4. To study installation steps of
Software Requirements:
Linux 18.04PHP
Hardware Requirements:
Pentium IV system with latest configuration
Theory:
Selenium is an open source umbrella project for a range of tools and libraries aimed at
supporting browser automation. It provides a playback tool for authoring functional tests across most
modern web browsers, without the need to learn a test scripting language.
Selenium Grid is a part of the Selenium Suite that specializes in running multiple tests across
different browsers, operating systems, and machines in parallel. It is achieved by routing the
commands of remote browser instances where a server acts as a hub. A user needs to configure the
remote server in order to execute the tests.
Run your tests against different browsers, operating systems, and machines all at the same time. This
will ensure that the application you are Testing is fully compatible with a wide range of browser-O.S
combinations.
Save time in the execution of your test suites. If you set up Selenium Grid to run, say, 4 tests at a
time, then you would be able to finish the whole suite around 4 times faster.
Step 1
Page 13
Download the Selenium Server from here.
You can place the Selenium Server .jar file anywhere in your HardDrive. But for the purpose of this
tutorial, place it on the C drive of both Machine A and Machine B. After doing this, you are now
done installing Selenium Grid. The following steps will launch the hub and the node.
Step 3
We are now going to launch a hub. Go to Machine A. Using the command prompt, navigate to the
root of Machine A’s – C drive, because that is the directory where we placed the Selenium Server.
On the command prompt, type java -jar selenium-server-standalone-2.30.0.jar -role hub
The hub should successfully be launched. Your command prompt should look similar to the image
below
Selenium Grid Tutorial: Step by Step Guide with Example
Step 4
Another way to verify whether the hub is running is by using a browser. Selenium Grid, by default,
uses Machine A’s port 4444 for its web interface. Simply open up a browser and go to
http://localhost:4444/grid/console
Step 5
Now that the hub is already set up, we are going to launch a node. Go to Machine B and launch a
command prompt there.
Navigate to the root of Drive C and type the code below. We used the IP address 192.168.1.3 because
that is where the hub is running. We also used port 5566 though you may choose any free port
number you desire.
NOTE: You now have to give path to the Gecko driver if using Firefox. Here is updated code that
needs to be used
java -Dwebdriver.gecko.driver="C:\geckodriver.exe" -jar selenium-server-standalone-3.4.0.jar -role
webdriver -hub http://192.168.1.3:4444/grid/register -port 5566
Selenium Grid Tutorial: Step by Step Guide with Example
When you press Enter, your command prompt should be similar to the image below.
Selenium Grid Tutorial: Step by Step Guide with Example
Step 6
Go to the Selenium Grid web interface and refresh the page. You should see something like this.
Page 14
Selenium Grid Tutorial: Step by Step Guide with Example
At this point, you have already configured a simple grid. You are now ready to run a test remotely on
Machine B.
DesiredCapabilites is used to set the type of browser and OS that we will automate
RemoteWebDriver is used to set which node (or machine) that our test will run against.
To use the DesiredCapabilites object, you must first import this package
We will use the platform and the browserName in our WebDriver as shown below (of course you
need to import the necessary packages first).
Selenium Grid Tutorial: Step by Step Guide with Example Selenium Grid Tutorial: Step by Step
Guide with Example
Selenium grid configuration using JSON File:
JSON stands for Javascript Object Notation. It is a standard format used for interchange of data
between browser and the web server. Selenium has an in built JSON config file that can be used to set
up selenium grid.
Below are the steps to configure selenium grid using JSON config file.
Page 15
Step 1) Download the code for JSON config file using the below path
https://github.com/SeleniumHQ/selenium/blob/selenium-
3.141.59/java/server/src/org/openqa/grid/common/defaults/DefaultHub.json
{
"port": 4444,
"newSessionWaitTimeout": -1,
"servlets" : [],
"withoutServlets": [],
"custom": {},
"capabilityMatcher": "org.openqa.grid.internal.utils.DefaultCapabilityMatcher",
"registryClass": "org.openqa.grid.internal.DefaultGridRegistry",
"throwOnCapabilityNotPresent": true,
"cleanUpCycle": 5000,
"role": "hub",
"debug": false,
"browserTimeout": 0,
"timeout": 1800
}
Step 2) Copy and paste the code on a text editor such as Notepad with the extension ‘.json’
Step 3)Launch the hub using the below command using command prompt
Step 4) The below screen will appear which indicates the hub is set up successfully
Step 5) Open web browser and try connecting to the below URL
http://192.168.43.223:4444/grid/console
NOTE: The URL may vary from machine to machine. URL followed by ‘Nodes should register to’
on the above screen must be used.
Step 6) Grid Console screen will appear which indicates the hub is up and running
https://github.com/SeleniumHQ/selenium/blob/selenium-
2.53.0/java/server/src/org/openqa/grid/common/defaults/DefaultNode.json
Page 16
NOTE: IF YOU ARE USING SELENIUM 3.0 OR ABOVE, THE BELOW JSON FILE MUST BE
USED
https://github.com/SeleniumHQ/selenium/blob/selenium-
3.141.59/java/server/src/org/openqa/grid/common/defaults/DefaultNodeWebDriver.json
Step 2) Copy and paste the code into a text editor such as Notepad and save the file with the
extension ‘.json’
Step 3)
Java-Dwebdriver.chrome.driver="chromedriver.exe" -Dwebdriver.ie.driver="IEDriverServer.exe" -
Dwebdriver.gecko.driver="geckodriver.exe" -jar selenium-server-standalone-2.53.1.jar -role node -
nodeConfig node1.json
NOTE: Before running the command, please make sure the drivers for each of the browsers have
been downloaded onto local machine directory
Step 4) The below screen will appear when enter key is pressed
Step 5) Navigate to the grid console to verify if the nodes have been successfully configured
The browsers are displayed on the grid console. Hence we can be sure that nodes are configured
successfully.
package com.objectrepository.demo;
import org.openqa.selenium.*;
import org.openqa.selenium.remote.DesiredCapabilities;
import java.net.MalformedURLException;
import java.net.URL;
import org.openqa.selenium.remote.RemoteWebDriver;
import org.testng.Assert;
import org.testng.annotations.*;
WebDriver driver;
String baseURL, nodeURL;
@BeforeTest
public void setUp() throws MalformedURLException {
baseURL = "http://demo.guru99.com/test/guru99home/";
Page 17
nodeURL = "http://192.168.43.223:5566/wd/hub";
DesiredCapabilities capability = DesiredCapabilities.chrome();
capability.setBrowserName("chrome");
capability.setPlatform(Platform.WIN10);
driver = new RemoteWebDriver(new URL(nodeURL), capability);
}
@AfterTest
public void afterTest() {
driver.quit();
}
@Test
public void sampleTest() {
driver.get(baseURL);
if (driver.getPageSource().contains("MOBILE TESTING")) {
Assert.assertTrue(true, "Mobile Testing Link Found");
} else {
Assert.assertTrue(false, "Failed: Link not found");
}
}
The above code launches chrome browser and navigates to the URL specified in the ‘baseURL’
variable. It verified a link name ‘Mobile Testing’ is displayed on the page
URL on the ‘nodeURL’ variable can be modified to reflect the IP Address of the remote machine.
Test result can be verified on the default TestNG report generated
NOTE: The versions of Java, Eclipse, Selenium will keep updating with time. But the installation
steps will remain the same. Please select the latest version and continue the installation steps below-
This JDK version comes bundled with Java Runtime Environment (JRE), so you do not need to
download and install the JRE separately.
Once installation is complete, open command prompt and type “java”. If you see the following screen
you are good to move to the next step
You should be able to download an exe file named “eclipse-inst-win64” for Setup.
Double-click on file to Install the Eclipse. A new window will open. Click Eclipse IDE for Java
Developers.
After that, a new window will open which click button marked 1 and change path to “C:\eclipse”.
Post that Click on Install button marked 2
After successful completion of the installation procedure, a window will appear. On that window
click on Launch
This download comes as a ZIP file named “selenium-3.14.0.zip”. For simplicity of Selenium
installation on Windows 10, extract the contents of this ZIP file on your C drive so that you would
have the directory “C:\selenium-3.14.0\”. This directory contains all the JAR files that we would later
import on Eclipse for Selenium setup.
Project Name
Location to save project
Select an execution JRE
Select layout project option
Click on Finish button
4. In this step,
5. Create a new Java class under newpackage by right-clicking on it and then selecting- New > Class,
and then name it as “MyClass”. Your Eclipse IDE should look like the image below.
When you click on Class, a pop-up window will open, enter details as
In this step,
When you click on “Add External JARs..” It will open a pop-up window. Select the JAR files you
want to add.
7. Finally, click OK and we are done importing Selenium libraries into our project.
Different Drivers
HTMLUnit and Firefox are two browsers that WebDriver can directly automate – meaning that no
other separate component is needed to install or run while the test is being executed. For other
browsers, a separate program is needed. That program is called as the Driver Server.
A driver server is different for each browser. For example, Internet Explorer has its own driver server
which you cannot use on other browsers. Below is the list of driver servers and the corresponding
browsers that use them.
Conclusion: Hence we learned how to install selenium grid and selenium web driver.
Page 21
Assignment No: 5
Aim: Prepare Software requirement specification for any project or problem statement
Theory:
Objectives:
1. To Prepare Software requirement specification
Software Requirements:
Windows 7
Hardware Requirements:
Pentium IV system with latest configuration
Introduction
In order to form a good SRS, here you will see some points which can be used and should be considered to form a
structure of good SRS. These are as follows :
1. Introduction
(i) Purpose of this document
(ii) Scope of this document
(iii) Overview
2. General description
3. Functional Requirements
4. Interface Requirements
5. Performance Requirements
6. Design Constraints
7. Non-Functional Attributes
8. Preliminary Schedule and Budget
9. Appendices
Software Requirement Specification (SRS) Format as name suggests, is complete specification and description
of requirements of software that needs to be fulfilled for successful development of software system. These
requirements can be functional as well as non-functional depending upon type of requirement. The interaction
between different customers and contractor is done because its necessary to fully understand needs of customers.
Depending upon information gathered after interaction, SRS is developed which describes requirements of
software that may include changes and modifications that is needed to be done to increase quality of product and
to satisfy customer’s demand.
1. Introduction :
(i) Purpose of this Document –
At first, main aim of why this document is necessary and what’s purpose of document is explained and described.
(ii) Scope of this document –
In this, overall working and main objective of document and what value it will provide to customer is described
and explained. It also includes a description of development cost and time required.
(iii) Overview –
In this, description of product is explained. It’s simply summary or overall review of product.
Page 22
2. General description :
In this, general functions of product which includes objective of user, a user characteristic, features, benefits,
about why its importance is mentioned. It also describes features of user community.
3. Functional Requirements :
In this, possible outcome of software system which includes effects due to operation of program is fully
explained. All functional requirements which may include calculations, data processing, etc. are placed in a
ranked order.
4. Interface Requirements :
In this, software interfaces which mean how software program communicates with each other or users either in
form of any language, code, or message are fully described and explained. Examples can be shared memory, data
streams, etc.
5. Performance Requirements :
In this, how a software system performs desired functions under specific condition is explained. It also explains
required time, required memory, maximum error rate, etc.
6. Design Constraints :
In this, constraints which simply means limitation or restriction are specified and explained for design team.
Examples may include use of a particular algorithm, hardware and software limitations, etc.
7. Non-Functional Attributes :
In this, non-functional attributes are explained that are required by software system for better performance. An
example may include Security, Portability, Reliability, Reusability, Application compatibility, Data integrity,
Scalability capacity, etc.
9. Appendices :
In this, additional information like references from where information is gathered, definitions of some specific
terms, acronyms, abbreviations, etc. are given and explained.
Conclusion: Hence we learnt to design and develop custom Application (Mini Project) using Sales force
Cloud
Page 23
Page 24
Group 2:
1. Mini Project :Software Testing and Quality Assurance Mini Project Dynamic website of covid19
information using HTML, CSS, JAVASCRIPT And PHP, MySQL database used to store user account,
comment, and registration form details. Regular Expression testcases for testing purpose.
2. Mini Project : Mini Project :Create a small application by selecting relevant system environment / platform
and programming languages. Narrate concise Test Plan consisting features to be tested and bug taxonomy.
Prepare Test Cases inclusive of Test Procedures for identified Test Scenarios. Perform selective Black-box
and White-box testing covering Unit and Integration test by using suitable Testing tools. Prepare Test Reports
based on Test Pass/Fail Criteria and judge the acceptance of application developed
3. Mini Project : Create a small web-based application by selecting relevant system environment / platform
and programming languages. Narrate concise Test Plan consisting features to be tested and bug taxonomy.
Narrate scripts in order to perform regression tests. Identify the bugs using Selenium WebDriver and IDE and
generate test reports encompassing exploratory testing
Page 25
Lab Assignment No. 01
PROBLEM STATEMENT:
Draw state model for telephone line, with various activities.
OBJECTIVES:
THEORY:
State chart diagrams are used to design interactive systems that respond to either internal or external event.
State chart diagram in UML visualizes the flow of execution from one state to another state of an object.
It represents the state of an object from the creation of an object until the object is destroyed or terminated.
The primary purpose of a state chart diagram is to model interactive systems and define each and every state
of an object. State chart diagrams are designed to capture the dynamic behaviour of an application system.
These diagrams are used to represent various states of a system and entities within the system.
Final state
This symbol is used to indicate the end of a state machine diagram.
Decision box
It contains a condition. Depending upon the result of an evaluated guard condition, a new path is taken for
Page 27
program execution.
Transition
A transition is a change in one state into another state which is occurred because of some event. A transition
causes a change in the state of an object.
State box
It is a specific moment in the lifespan of an object. It is defined using some condition or a statement within the
classifier body. It is used to represent any static as well as dynamic situations.
It is denoted using a rectangle with round corners. The name of a state is written inside the rounded rectangle.
The name of a state can also be placed outside the rectangle. This can be done in case of composite or
submachine states. One can either place the name of a state within the rectangle or outside the rectangle in a
tabular box. One cannot perform both at the same time.
A state can be either active or inactive. When a state is in the working mode, it is active, as soon as it stops
executing and transits into another state, the previous state becomes inactive, and the current state becomes
active.
Types of State
Unified Modelling Language defines three types of states:
Simple state
They do not have any substrate.
Composite state
These types of states can have one or more than one substrate.
A composite state with two or more substates is called an orthogonal state.
Submachine state
These states are semantically equal to the composite states.
Unlike the composite state, we can reuse the submachine states.
CONCLUSION:
State model for telephone line, with various activitiesCreated successfully.
Page 28
State model for telephone line
Page 29
Lab Assignment No. 02
PROBLEM STATEMENT:
Draw basic class diagrams to identify and describe key concepts like classes, types in your system and their
relationships.
OBJECTIVES:
Describe the concepts involved in Object-Oriented modeling class diagrams and their benefits
THEORY:
The class diagram is one of the types of UML diagrams which is used to represent the static diagram by
mapping the structure of the systems using classes, attributes, relations, and operations between the various
objects. A class diagram has various classes; each has three-part; the first partition contains a Class name
which is the name of the class or entity which is participated in the activity, the Second partition contains
class attributes that show the various properties of the class, the third partition contains class operations which
shows various operations performed by the class, relationships show the relation between two classes.
Page 30
Relationships
In a class diagram, it is necessary that there exists a relationship between the classes. Unfortunately, the
similarity of various relationships often makes it difficult to understand them.
1. Association
Between two other classes in an association relationship, an association class forms a part of it. Additional
information about the relationship could be obtained by attaching the association relationship with the
association class. Various operations, attributes, etc., are present in the association class.
2. Multiplicity
The number of elements or cardinality could be defined by multiplicity. It is one of the most misunderstood
relationships which describes the number of instances allowed for a particular element by providing an
inclusive non-negative integers interval. It has both lower and upper bound. For example, a bank would have
many accounts registered to it. Thus near the account class, a star sign is present.
3. Directed Association
This is a one-directional relationship in a class diagram that ensures the flow of control from one to another
classifier. The navigability is specified by one of the association ends. The relationship between two
classifiers could be described by naming any association. An arrow indicates the direction of navigation.
The below example shows an arrowhead relationship between the container and the contained.
Page 31
4. Reflexive Association
The association of a class to itself is known as Reflexive association, which could be divided into Symmetric
and Asymmetric type associations. In Symmetric reflexive association, the semantics of each association end
has no logical difference, whereas, in Asymmetric Reflexive Association, the associated class is the same, but
there is a semantic difference between the ends of the association.
5. Aggregation
In this type of relationship, a more complex object is created by assembling different objects together. The
interaction within the different groups of objects is defined by Aggregation. The integrity of the objects is
protected, and the response of the assembled objects is decided by the control object. In aggregation, the
classes nurture the ‘has a relationship.
6. Composition
It is a form of aggregation which represents the whole-part relationship. Here, the part classifier lifetime is
dependent on the whole classifier lifetime. In a class, a strong life-cycle is represented by the composition
relationship. There is usually a one-direction flow of data here. It is generally indicated by a solid line.
7. Generalization
In this kind of relationship, the child model is based on the parent model. The relationship is used to describe
various use-case diagrams and ensures that the child class receives the properties present in the parent. The
child model could reuse the attributes of the parent model with the help of the generalization relationship.
Hence the distinct attributes need to be defined only in the child; the rest it would inherit from the parent.
There could be single parents, multiple children, or multiple parents, single child characteristics in this
relationship. There are no names in the generalization relationships. It is also known as the ‘is a relationship.
Page 32
8. Realization
The behaviour of one model element is realized by the specified behaviour of another model element. This
type of relationship doesn’t have any names.
Class Diagram provides a static view of the application, and its mapping ability with object-oriented language
makes it ready to be used in construction. Unlike the sequence diagram, activity diagram, etc., the class
diagram is the most popular UML diagram.
The Upper Section consists of the class name and is a mandatory component.
The middle section described the class qualities and used them while describing a class’s specific
instance.
The bottom section describes class interaction with the data.
Moreover, a UML is divided into Behavioural and Structural Diagram with Class Diagram falling under the
Page 33
Structural diagram.
CONCLUSION:
Class diagrams to identify and describe key concepts like classes, types in your system and their
relationshipsCreated successfully.
Page 34
Page 35
Lab Assignment No. 03
Object Oriented Modelling and Design (OOMD), Lab Assignment 3
PROBLEM STATEMENT:
Draw one or more Use Case diagrams for capturing and representing requirements of the
system. Use case diagrams must include template showing description and steps of the Use
Case for various scenarios.
OBJECTIVES:
THEORY:
Use-case:
Use cases are used to represent high-level functionalities and how the user will handle the system. A use case
represents a distinct functionality of a system, a component, a package, or a class. It is denoted by an oval
shape with the name of a use case written inside the oval shape. The notation of a use case in UML is given
below:
Page 36
UML UseCase Notation
Actor:
It is used inside use case diagrams. The actor is an entity that interacts with the system. A user is the best
example of an actor. An actor is an entity that initiates the use case from outside the scope of a use case. It can
be any element that can trigger an interaction with the use case. One actor can be associated with multiple use
cases in the system. The actor notation in UML is given below.
A use case is nothing but a core functionality of any working system. After organizing the use cases, we have
to enlist the various actors or things that are going to interact with the system. These actors are responsible for
invoking the functionality of a system. Actors can be a person or a thing. It can also be a private entity of a
system. These actors must be relevant to the functionality or a system they are interacting with.
After the actors and use cases are enlisted, then you have to explore the relationship of a particular actor with
the use case or a system. One must identify the total number of ways an actor could interact with the system.
A single actor can interact with multiple use cases at the same time, or it can interact with numerous use cases
simultaneously.
Following rules must be followed while drawing use-case for any system:
1. The name of an actor or a use case must be meaningful and relevant to the system.
2. Interaction of an actor with the use case must be defined clearly and in an understandable way.
3. Annotations must be used wherever they are required.
4. If a use case or an actor has multiple relationships, then only significant interactions must be
displayed.
Page 37
Tips for drawing a use-case diagram
CONCLUSION:
Use Case diagrams for capturing and representing requirements of the systemcreated successfully.
Page 38
Lab Assignment No. 05
PROBLEM STATEMENT:
Draw activity diagrams to display either business flows or like flow charts
OBJECTIVES:
THEORY:
Activity diagrams can be used in all stages of software development and for various purposes. And because
they are a lot similar to flowcharts, they are generally more popular than other UML diagram types.
A UML activity diagram helps to visualize a certain use case at a more detailed level. It is a behavioural
diagram that illustrates the flow of activities through a system.
UML activity diagrams can also be used to depict a flow of events in a business process. They can be used to
examine business processes in order to identify its flow and requirements.
Page 39
Conditions
Constraints
Once the above-mentioned parameters are identified, we need to make a mental layout of the entire flow. This
mental layout is then transformed into an activity diagram.
Following is an example of an activity diagram for order management system. In the diagram, four activities
are identified which are associated with conditions. One important point should be clearly understood that an
activity diagram cannot be exactly matched with the code. The activity diagram is made to understand the
flow of activities and is mainly used by the business users
Following diagram is drawn with the four main activities −
Send order by the customer
Receipt of the order
Confirm the order
Dispatch the order
Page 40
CONCLUSION:
Activity diagrams to display either business flows or like flow charts created successfully.
Activity diagram
Page 41
Page 42
Lab Assignment No. 06
PROBLEM STATEMENT:
Draw component diagrams assuming that you will build your system reusing existing components along
with a few new ones.
OBJECTIVES:
THEORY:
While other UML diagrams, which describe the functionality of a system, component diagrams are used to
model the components that help make those functionalities.
In this component diagram tutorial, we will look at what a component diagram is, component diagram
symbols, and how to draw one. You can use a component diagram example below to get a quick start.
Component diagrams are used to visualize the organization of system components and the dependency
relationships between them. They provide a high-level view of the components within a system.
The components can be a software component such as a database or user interface; or a hardware component
such as a circuit, microchip or device; or a business unit such as supplier, payroll or shipping.
Component diagrams
Page 43
Component Diagram Symbols
We have explained below the common component diagram notations that are used to draw a component
diagram.
Component
1) Rectangle with the component stereotype (the text <<component>>). The component stereotype is usually
used above the component name to avoid confusing the shape with a class icon.
2) Rectangle with the component icon in the top right corner and the name of the component.
Page 44
Interfaces in component diagrams show how components are wired together and interact with each other. The
assembly connector allows linking the component’s required interface (represented with a semi-circle and a
solid line) with the provided interface (represented with a circle and solid line) of another component. This
shows that one component is providing the service that the other is requiring.
Port
Port (represented by the small square at the end of a required interface or provided interface) is used when the
component delegates the interfaces to an internal class.
Dependencies
Although you can show more detail about the relationship between two components using the ball-and-socket
notation (provided interface and required interface), you can just as well use a dependency arrow to show the
relationship between two components.
You can use a component diagram when you want to represent your system as components and want to show
their interrelationships through interfaces. It helps you get an idea of the implementation of the system.
Following are the steps you can follow when drawing a component diagram.
Page 45
Step 1: figure out the purpose of the diagram and identify the artifacts such as the files, documents etc. in
your system or application that you need to represent in your diagram.
Step 2: As you figure out the relationships between the elements you identified earlier, create a mental layout
of your component diagram
Step 3: As you draw the diagram, add components first, grouping them within other components as you see
fit
Step 4: Next step is to add other elements such as interfaces, classes, objects, dependencies etc. to your
component diagram and complete it.
Step 5: You can attach notes on different parts of your component diagram to clarify certain details to others.
CONCLUSION:
State model for telephone line, with various activities Created successfully.
Page 46
Page 47
Lab Assignment No. 07
PROBLEM STATEMENT:
Draw deployment diagrams to model the runtime architecture of your system
OBJECTIVES:
THEORY:
Deployment diagram in the Unified Modeling Language models the physical deployment of artifacts on nodes.[1] To
describe a web site, for example, a deployment diagram would show what hardware components ("nodes") exist (e.g., a web
server, an application server, and a database server), what software components ("artifacts") run on each node (e.g., web
application, database), and how the different pieces are connected (e.g. JDBC, REST, RMI).
The nodes appear as boxes, and the artifacts allocated to each node appear as rectangles within the boxes. Nodes may have
subnodes, which appear as nested boxes. A single node in a deployment diagram may conceptually represent multiple
physical nodes, such as a cluster of database servers.
There are two types of Nodes:
1. Device Node
2. Execution Environment Node
Device nodes are physical computing resources with processing memory and services to execute software, such as typical
computers or mobile phones. An execution environment node (EEN) is a software computing resource that runs within an
outer node and which itself provides a service to host and execute other executable software elements.
Page 48
Nodes
A node, represented as a cube, is a physical entity that executes one or more components,
subsystems or executables. A node could be a hardware or software element.
Artifacts
Artifacts are concrete elements that are caused by a development process. Examples of artifacts
are libraries, archives, configuration files, executable files etc.
Communication Association
This is represented by a solid line between two nodes. It shows the path of communication
between nodes.
Devices
Page 49
A device is a node that is used to represent a physical computational resource in a system. An
example of a device is an application server.
Deployment Specifications
Step 1: Identify the purpose of your deployment diagram. And to do so, you need to identify the nodes and
devices within the system you’ll be visualizing with the diagram.
Step 2: Figure out the relationships between the nodes and devices. Once you know how they are connected,
proceed to add the communication associations to the diagram.
Step 3: Identify what other elements like components, active objects you need to add to complete the
diagram.
Page 50
Deployment Diagram for Online Shopping System
Page 51
Deployment Diagram for Library Management System
Page 52