20CS2050L Software Engineering Labmanuel
20CS2050L Software Engineering Labmanuel
20CS2050L Software Engineering Labmanuel
Lab Manual
Lab Manual
2
INDEX
6 Syllabus … 15
7 List of Exercises … 16
3
VISION
MISSION
4
PEO, PO & PSO - B.Tech. Computer Science and Engineering
Programme Outcomes
Graduates will have the ability to
5
9. Individual and Team Work: Function effectively as an individual and
as a member or leader in diverse teams and in multi-disciplinary
settings.
10. Communication: Communicate effectively on complex engineering
activities with the engineering community and with society at large
such as being able to comprehend and write effective reports and
design documentation make effective presentations and give and
receive clear instructions.
11. Project Management and Finance: Demonstrate knowledge and
understanding of the engineering and management principles and
apply this to one’s own work, as a member and leader in a team, to
manage projects and in multi-disciplinary environments.
12. Life – Long Learning: Recognize the need for and have the
preparation and ability to engage in independent and lifelong leaning
in the broadest context of technological change.
6
PEO, PO & PSO - B.Tech. Artificial Intelligence and Data Science
8
B.Tech. Computer Engineering
9
10. Communication: Communicate effectively on complex engineering
activities with the engineering community and with society at large
such as being able to comprehend and write effective reports and
design documentation make effective presentations and give and
receive clear instructions.
11. Project Management and Finance: Demonstrate knowledge and
understanding of the engineering and management principles and
apply this to one’s own work, as a member and leader in a team, to
manage projects and in multi-disciplinary environments.
12. Life – Long Learning: Recognize the need for and have the
preparation and ability to engage in independent and lifelong leaning
in the broadest context of technological change.
10
B.Tech. Computer Science and Engineering (Artificial Intelligence)
11
10. Communication: Communicate effectively on complex engineering
activities with the engineering community and with society at large
such as being able to comprehend and write effective reports and
design documentation make effective presentations and give and
receive clear instructions.
11. Project Management and Finance: Demonstrate knowledge and
understanding of the engineering and management principles and
apply this to one’s own work, as a member and leader in a team, to
manage projects and in multi-disciplinary environments.
12. Life – Long Learning: Recognize the need for and have the
preparation and ability to engage in independent and lifelong leaning
in the broadest context of technological change.
12
B.Tech. Computer Science and Engineering (Artificial Intelligence and
Machine Learning)
13
9. Individual and Team Work: Function effectively as an individual and
as a member or leader in diverse teams and in multi-disciplinary
settings.
10. Communication: Communicate effectively on complex engineering
activities with the engineering community and with society at large
such as being able to comprehend and write effective reports and
design documentation make effective presentations and give and
receive clear instructions.
11. Project Management and Finance: Demonstrate knowledge and
understanding of the engineering and management principles and
apply this to one’s own work, as a member and leader in a team, to
manage projects and in multi-disciplinary environments.
12. Life – Long Learning: Recognize the need for and have the
preparation and ability to engage in independent and lifelong leaning
in the broadest context of technological change.
14
20CS2050L Software Engineering
Syllabus
Course Objectives
Course Outcomes
List of Exercises
1. Problem Analysis and Project Planning -Thorough study of the problem - Identify Project
scope, Objectives and Infrastructure.
2. Software Requirement Analysis - Describe the individual Phases/modules of the project
and Identify deliverables. Identify functional and non-functional requirements.
3. Data Modeling - Use work products - data dictionary. Software Designing - Develop use
case diagrams and activity diagrams, build and test class diagrams, sequence diagrams and
add interface to class diagrams.
4. Estimation of project size using Function Point(FP) for calculation.
5. Design Test Script/Test Plan(both Black box and White Box approach
6. Prototype model - Develop the prototype of the product.
Applications
15
LIST OF EXERCISE
Design test script and test plan using both black box and white box
9 43
approaches
16
Experiment No: 1
Problem analysis and project planning -thorough study of the problem - identify project
scope, objectives and infrastructure.
The problem statement is the initial starting point for a project. It is basically a one to three
page statement that everyone on the project agrees with that describes what will be done at a
high level. The problem statement is intended for a broad audience and should be written in
nontechnical terms. It helps the non-technical and technical personnel communicate by
providing a description of a problem. It doesn't describe the solution to the problem. The
input to requirement engineering is the problem statement prepared by customer. It may give
an overview of the existing system along with broad expectations from the new system.
The first phase of requirements engineering begins with requirements elicitation i.e. gathering
of information about requirements. Here, requirements are identified with the help of
customer and existing system processes. So from here begins the preparation of problem
statement. So, basically a problem statement describes what needs to be done without
describing how.
Business case
The Business Case is a reference point before, during, and after a project.
Creating the Business Case draws the discussion from “What do we want to
build?” to “Why do we want to build it? ” This provides the justification for
starting the project.
17
A written and agreed Business Case makes expectations explicit
As the project progresses, the Business Case becomes the “guiding light”—the beacon
toward which everyone knows the project is directed.
With a clear Business Case the project's stakeholders can monitor both the project and
the project's environment
PROJECT
In bullet points, describe the problem this project aims to solve or the opportunity it aims to
develop.
HISTORY
LIMITATIONS
List what could prevent the success of the project, such as the need for expensive equipment,
bad weather, lack of special training, etc.
APPROACH
BENEFITS
In bullet points, list the benefits that this project will bring to the organization.
19
Experiment No:2
Software Requirement Analysis - Describe the individual Phases/modules of the project and
Identify deliverables. Identify functional and non-functional requirements
Requirements Analysis is perhaps the most difficult, most error-prone and most
communication intensive software development. It can be successful only through an
effective customer-developer partnership. It is needed to know what the users really need.
There are a number of requirements elicitation methods. Few of them are listed below.
1. Interviews
2. Brainstorming Sessions
3. Facilitated Application Specification Technique (FAST)
4. Quality Function Deployment (QFD)
5. Use Case Approach
The success of an elicitation technique used depends on the maturity of the analyst,
developers, users and the customer involved.
FEASIBILITY STUDY
1. Executive summary
2. Description of product/service
3. Technology considerations
4. Product/service marketplace
5. Marketing strategy
6. Organization/staffing
7. Schedule
8. Financial projections
9. Findings and recommendations
FUNCTIONAL REQUIREMENTS
20
Functional software requirements help you to capture the intended behavior of the system.
This behavior may be expressed as functions, services or tasks or which system is required to
perform.
Services the system should provide
What the system should do or not in reaction to particular situations
Example: “If a patient is known to be allergic to a particular medication, then
prescription of that medication shall result in a warning message being issued to the
prescriber”
NON-FUNCTIONAL REQUIREMENTS
SYSTEM REQUIREMENTS
22
Experiment No: 3
Develop use case diagram
OBJECTIVE
Use case diagrams identify the functionality provided by the system (use cases), the users
who interact with the system (actors), and the association between the users and the
functionality. Use cases are used in the Analysis phase of software development to articulate
the high level requirements of the system. The primary goals of Use case diagrams include:
TOOLS DESCRIPTION
The basic components of Use case diagrams are the Actor, the Use case and the Association.
Actor
An Actor, as mentioned, is a user of the system, and is depicted using a stick figure. The role
of the user is written beneath the icon. Actors are not limited to users. If a system
communicates with another application and expects input or delivers output then that
application can also be considered an actor.
Use Case
A Use Case is functionality provided by the system, typically described as verb + object (eg:
Register Car, Delete User). Use cases are depicted with an ellipse. The name of the use case
is written within the ellipse.
23
Association
Associations are used to link Actors with Use cases, and indicate that an Actor participates in
the Use case in some form. A line connecting the Actor and Use case depicts associations.
The following image shows how these three basic elements work together to form a use case
diagram.
ALGORITHM
Step 1: Define the actors like member, circulation clerk and supplier for the Library
Information System.
Step 2: Determine the events that are necessary for developing a system.
Step 3: Represent the communication relationship of an actor in the system by connecting the
actor symbol to the Use-Case symbol with a solid path.
Step 5: Use the necessary tools for developing the Library Information System.
24
SAMPLE OUTPUT
<<USES>>
<<EXTENDS>>
<<USES>>
MEMBER
Interlibrary Loan
Circulation Clerk
Return Books
Do Research
Read Books
Supplier
Purchase Supply
25
Experiment No:4
Build and test class diagram
OBJECTIVE
Class diagrams identify the class structure of a system, including the properties and methods
of each class. It specifies the various relationships that can exist between classes, such as an
inheritance. The Class diagram is one of the most widely used diagrams from the UML
specification. Part of the popularity of Class diagrams is the fact that many CASE tools, such
as Rationale Rose, will provide clarity of the designing process.
TOOLS DESCRIPTION
The basic components on a Class diagram are classes and the relationships between them.
Class
A class is depicted using a rectangle divided into 3 sections. The top section is the name of
the class. The middle section defines the properties of the class. The bottom section lists the
methods of the class.
Association
An Association is a generic relationship between two classes, and is modeled by a line
connecting the two classes. This line can be qualified with the type of relationship, and can
26
also feature multiplicity rules (for eg. One-to-one, one-to-many, many-to-many) for the
relationship.
Composition
If a class cannot exist by itself, and instead must be a member of another class, then that class
has a Composition relationship with the containing class. A composition relationship is
indicated by a line with a filled diamond.
Dependency
A Dependency relationship is indicated by a dotted arrow.
Aggregation
Aggregations indicate a whole-part relationship and are known as “has-a” relationships. An
Aggregation relationship is indicated by a line with a hollow diamond.
Generalization
A Generalization relationship is the equivalent of an inheritance relationship in object-
oriented terms. (“is-a” relationship). A Generalization relationship is indicated by an arrow
with a hollow arrow head pointing to the base or “parent” class.
Association
Object diagrams can contain associations as well. Often, the constraints, relationship details
and multiplicity rules found in the Class diagram are left out to concentrate the diagram on
27
the objects and their properties. Associations between objects are simply diagrammed using a
line joining the two objects
ALGORITHM
Step 1: Identify the various classes that behave as main to perform various functions in the
system.
Step 2: Define all its attributes and what operations they perform.
Step 4: The relationship between a class and its subclass is represented by generalization.
Step 5: Design the class diagram for the Library Information System using the tools provided.
28
SAMPLE OUTPUT
Library
Member
CirculationClerk
MemberId : integer
name : string Staff Name : string
dept : string returnstatus : string
status : string
bookname : string borrowBooks()
bookid : int returnBooks()
interlibraryLoan()
borrowBooks()
returnBooks()
interlibraryLoan()
readBooks()
Supplier
Bookname : string OrderDetails
author : string order_no : integer
No of copies : integer order_dt : date
supplydate : date order_qty : integer
supplier id : integer supplier id : integer
supplier name : string
supplier address : string purchase Books()
received qty()
supplybooks()
29
Experiment No:5
Software design using sequence diagram
OBJECTIVE
Sequence diagrams demonstrate the behavior of objects in a use case by describing the
objects and the messages they pass. The diagrams are read left to right and descending. The
example below shows an object of class 1 start the behavior by sending a message to an
object of class 2. Messages pass between the different objects until the object of class 1
receives the final message.
TOOLS DESCRIPTION
In a Sequence diagram, classes and actors are listed as columns with vertical lifelines
indicating the lifetime of the object over time.
Object
Objects are instances of classes, and are arranged horizontally. The pictorial representation
for an object is a class (a rectangle) with the name prefixed by the object name (optional) and
a semi-colon.
Actor
Actors can also communicate with objects, so they too can be listed as a column. An Actor is
modeled using the ubiquitous symbol, the stick figure.
30
Lifeline
The Lifeline identifies the existence of the object over time. The notation for a Lifeline is a
vertical dotted line extending from an object.
Activation
Activations, modeled as rectangular boxes on the lifeline, indicate when the object is
performing an action.
Message
Messages, modeled as horizontal arrows between Activations, indicate the communications
between objects.
31
ALGORITHM
Step 1: Identify the objects in the diagram according to the system to be drawn.
Step 3: Determine how the messages are passed between two objects and how other objects
respond.
Step 4: Create the sequence diagram based on the information from step 1 and step 2 with the
tools provided.
SAMPLE OUTPUT
Scan Id
Check Id
Enter Book Id
Show Book Id
Scan book Id
Validate Book Id
Enter User Id
Validate User Id
Show in Details
32
Experiment No: 6
Software design using activity diagram
OBJECTIVE
Activity diagrams are used to document workflows in a system, from the business level down
to the operational level. When looking at an Activity diagram, you’ll notice elements from
state diagrams. In fact, the Activity diagram is a variation of the state diagram where the
“states” represent operations, and the transitions represent the activities that happen when the
operation is complete. The general purpose of Activity diagrams is to focus on flows driven
by internal processing vs. external events.
TOOLS DESCRIPTION
Activity states
Activity states mark an action by an object. The notation for these states are rounded
rectangles, the same notation as found in Statechart diagrams.
Transition
When an Activity state is completed, processing moves to another Activity state. Transitions
are used to mark this movement. Transitions are modeled using arrows.
Swimlane
33
Swimlanes divide activities according to objects by arranging objects in column
format and placing activities by that object within that column. Objects are listed at the top of
the column, and vertical bars separate the columns to form the swimlanes.
Initial State
The Initial State marks the entry point and the Initial Activity State. The notation for the
Initial State is the same as in Statechart diagrams, a solid circle. There can only be one Initial
State on a diagram.
Final State
Final States mark the end of the modeled workflow. There can be multiple Final States on a
diagram, and these states are modeled using a solid circle surrounded by another circle.
Synchronization Bar
Activities often can be done in parallel. To split processing (“fork”), or to resume processing
when multiple activities have been completed (“join”), Synchronization Bars are used. These
are modeled as solid rectangles, with multiple transitions going in and/or out
34
ALGORITHM
Step 1: Identify the operations and transformations that are triggered by the completion of an
operation, which is referred as activities.
Step 4: If needed a decision which is represented by a diamond with many transitions coming
out of it.
Step 5: Design the Activity diagram using the information obtained from the above steps
using the tools provided.
SAMPLE OUTPUT
VERIFY ID
INVALID ID
VALID ID
DO
ACTIVITIES
INTERLIBRARY
LOAN
TAKE
BOOKS
35
Experiment No: 7
COMPONENT DIAGRAM
OBJECTIVE
TOOLS DESCRIPTION
Component
A component represents a software entity in a system. Examples include source code files,
programs, documents and resource files. A component is represented using a rectangular box,
with two rectangles protruding from the left side
Dependency
A Dependency is used to model the relationship between two components. The notation for a
dependency relationship is a dotted arrow, pointing from a component to the component it
depends on.
36
ALGORITHM
Step 2: The Dependency relationship is drawn according to the system set up.
SAMPLE OUTPUT
Library Components.dll
(Assembly)
DEPLOYMENT DIAGRAM
OBJECTIVE
Deployment diagrams are another model in the implementation diagram category. The
Deployment diagram models the hardware used in implementing a system and the association
between those hardware components. Components can also be shown on a Deployment
diagram to show the location of their deployment. Deployment diagrams can also be used
early on in the design phase to document the physical architecture of a system.
TOOLS DESCRIPTION
Component
A Component represents a software entity in a system. Examples include source code files,
programs, documents, and resource files. On a deployment diagram, components are placed
37
within nodes to identify their deployed location. A component is represented using a
rectangular box, with two rectangles protruding from the left.
Node
A node represents a piece of hardware in the system. This entity is represented by a three-
dimensional cube.
Association
An association, drawn as a solid line between two nodes, indicates a line of
communication between the hardware elements.
ALGORITHM
Step 1: Identify the Processors and devices used in the Deployment Diagram.
Step 2: The processors are connected according to the office set up.
38
SAMPLE OUTPUT
Database
Server
Application
Printer
Server
Client 2
Client 1
39
Experiment No: 8
OBJECTIVE
Estimation Of Project Size Using Function Point(Fp) For Calculation
METHODOLOGY
Here we have the following scenarios:
1. Much relevant project data are available for the current project but not much information
about previous projects.
2. Previous project data are available for the project but not much information about the
current project.
3. Project data are available for the current project as well as that of previous projects.
4. Some project data are available for the current project.
5. No project data are available for both current as well as previous projects.
40
COCOMO MODEL
Calculation of effort for the project using COCOMO model calculation method.
41
BASIC COCOMO MODEL
42
Experiment No:9
Design test script and test plan using both black box and white box approaches
OBJECTIVE
The objective of the experiment is to perform automation testing on a web page using
selenium framework on different browsers using Java.
DESCRIPTION
PROCEDURE
Server side
Load the designed Webpage to be tested in the server. (IIS Server- C:\inetpub\wwwroot)
(Apache Server.............................................................)
Client side
Download all the necessary selenium packages based on the host machine requirement
(windows/mac/linux, x86/x64)
Download the corresponding browser’s (Chrome/opera/firefox) web driver to integrate
the IDE & browser.
Using the IDE (Eclipse/Jupyter) create a new Java/Python program.
Import all the required selenium packages in the java program.
43
Using setProperty(), provide the name and location of the browser’s webdriver.
And a WebDriver class instances of the browser is created and it is used to access the
webpage.
The method navigate().to(“URL”) launches the website in the test browser.
Every component in a webpage is accessed by the method findElement() and specific
entities using the following
findElement(By.id("identifier value"))
findElement(By.name("name"))nd
findElement(By.linkText(“Link text”))
findElement(By.className(“class name”))
Values are passed on using the method sendKeys(“value”).
Inner HTML values are obtained using the method getText().
Values from forms are obtained using the method getAttribute("value").
Browser events such as click, clear, back, forward, refresh, and close are performed
using the methods click(), clear(), back(), forward(), refresh(), quit() respectively.
Also, moving between windows and frames are performed using the methods
switchTo().window("windowName") and switchTo().frame("frameName");
Javascript method is invoked by the method executeScript() of the class
JavascriptExecuter
import org.openqa.selenium.By;
import org.openqa.selenium.JavascriptExecutor;
import org.openqa.selenium.WebDriver;
import org.openqa.selenium.WebElement;
// Chrome packages
import org.openqa.selenium.chrome.ChromeDriver;
import org.openqa.selenium.chrome.ChromeOptions;
import com.sun.org.apache.bcel.internal.generic.Select;
// System.out.print("hi");
System.setProperty("webdriver.chrome.driver", "C:\\Users\\Titus\\Documents\\
KITS\\2021-22\\01 odd sem\\20CS2050 L-Software Engineering Lab-2021-1-BIV\\09 Ex\\
chromedriver.exe");
// WebDriver driver=new ChromeDriver();
ChromeOptions opt = new ChromeOptions();
opt.addArguments("disable-extensions");
44
opt.addArguments("--start-maximized");
WebDriver driver = new ChromeDriver(opt);
// Launch website
driver.navigate().to("http://localhost/test.html");
//Test case 1
System.out.print("\n\n Test Case 1: Content checking");
String o1 = driver.findElement(By.id("HText")).getText();
System.out.print("\n Test Outcome:"+o1);
System.out.print("\n Desired Outcome:"+"Online Banking solution");
String o2=driver.findElement(By.id("efname")).getAttribute("value");
System.out.print("\nTest Outcome:"+o2);
System.out.print("\n Desired Outcome:"+"Name field cant be empty");
//Test case 3:
System.out.print("\n\n\n Test case 3");
driver.findElement(By.id("fname")).sendKeys("1234567890000");
System.out.print("\n Given input for textbox (Name):"+"1234567890000");
jse.executeScript("tbox()");
String o3=driver.findElement(By.id("efname")).getAttribute("value");
45
System.out.print("\n Test Outcome:"+o3);
System.out.print("\n Desired Outcome:"+"First name cannot be more than 10 chars");
46
Experiment No: 10
Software Requirments Specification - Develop the product prototype
OBJECTIVE
The objective of the experiment is to generate a detailed SRS for the project.
TABLE OF CONTENTS
1. Introduction
1.1 Purpose
2. Overall Description
47