You are on page 1of 36

Ahmedabad Institute of Technology

IT Department
Software Engineering(3161605)

Laboratory Manual
Year: 2020-2021

Prepared By: - Prof. Bhagyshri Lachhwani

IT Department Vision:
To provide quality education and assistance to the students through innovative teaching learning
methodology for shaping young mind technically sound and ethically strong.

IT Department Mission:
1) To serve society by producing technically and ethically sound engineers.
2) To generate groomed and efficient problem solvers as per Industrial needs by adopting
innovative teaching learning methods.
3) To emphasis on overall development of the students through various curricular, co-curricular
and extra-curricular activities.

Page 2 of 36
Prepared By: Prof. Bhagyshri Lachhwani SOFTWARE ENGINEERING[3161605]
INDEX

Page No.
Sr.No. Experiment Date Marks Signature
From To
Study the complete Software
Development Life Cycle (SDLC)
1. and analyze various activities 3 5
conducted as a part of various
phases.
2. Develop Requirement Specification 6 9
for a given problem
3. Case Study on Rational Rose Tool. 10 12

4. Prepare Data dictionary for given 13 14


system.
5. Prepare Use Case Diagram for 15 17
given system.
6. Prepare all the levels of DFD 18 20
diagram for given system.
7. Prepare ER diagram for given 21 24
system.
8. Develop Activity diagram for given 25 28
system.
Calculate FP based Estimation and
9. LOC based Estimation for any 29 32
project.
Consider the any code segment:
1. Guarantees that all independent
10. execution path is exercised at least 33 36
once;
2. Calculate the Cyclomatic
complexity for given code

Page 3 of 36
Prepared By: Prof. Bhagyshri Lachhwani SOFTWARE ENGINEERING[3161605]
EXPERIMENT NO: 1 DATE: / /

AIM: - Study the complete Software Development Life Cycle (SDLC) and
analyze various activities conducted as a part of various phases.

Objectives:
➢ Complete Understanding of Software Development Life Cycle
➢ Importance of SDLC.

Introduction

Software Development Life Cycle, or SDLC is a process used to develop software. It aims to
produce a high-quality system that meets or exceeds customer expectations, works
effectively and efficiently in the current and planned information technology infrastructure,
and is inexpensive to maintain and cost-effective to enhance.

There are different stages or phases within the Software Development Life Cycle and in each
phase, different activities take place.
SDLC creates a structure for the development teams to be able to design, create and deliver
high quality software by defining various tasks that need to happen The life cycle defines a
methodology for improving the quality of software and the overall development process.
The methodology within the SDLC process can vary across organizations, but standards such
as ISO/IEC 12207 represent processes that establish a life cycle for software, and provide a
standard for building and maintaining software.
The intent of a SDLC process it to help produce a product that is cost-efficient, effective, and
of high quality.

Page 4 of 36
Prepared By: Prof. Bhagyshri Lachhwani SOFTWARE ENGINEERING[3161605]
1. Requirement Analysis
Software Development Life Cycle begins with Requirement Analysis phase, where the
stakeholders discuss the requirements of the software that needs to be developed to achieve a
goal. The aim of the requirement analysis phase is to capture the detail of each requirement
and to make sure everyone understands the scope of the work and how each requirement is
going to be fulfilled.
It is a normal practice to also discuss how each requirement will be tested and so testers can
add great value in participating in requirement analysis meetings.Depending on which
software development methodology is used, different approaches are taken in moving from
one phase to another. For example, in the waterfall or V model, the requirement analysis
phase are saved in a SRS (Software Requirement Specification) document and needs to be
finalized before the next phase can take place.

2. Design
The next stage of Software Development Life Cycle is the Design phase. During the design
phase, developers and technical architects start the high-level design of the software and
system to be able to deliver each requirement.
The technical details of the design is discussed with the stakeholders and various parameters
such as risks, technologies to be used, capability of the team, project constraints, time and
budget are reviewed and then the best design approach is selected for the product.The
selected architectural design, defines all the components that needs to be developed,
communications with third party services, user flows and database communications as well
as front-end representations and behaviour of each components. The design is usually kept in
the Design Specification Document (DSD)

3. Development Implementation
After the requirements and design activity is completed, the next phase of the Software
Development Life Cycle is the implementation or development of the software. In this phase,
developers start coding according to the requirements and the design discussed in previous
phases.In this the work is divided in modules/units and actual coding is started. Since, in this
phase the code is produced so it is the main focus for the developer. This is the longest phase
of the software development life cycle.
Database admins create the necessary data in the database, front-end developers create the
necessary interfaces and GUI to interact with the back-end all based on guidelines and
procedures defined by the company.Developers also write unit tests for each component to
test the new code that they have written, review each others code, create builds and deploy
software to an environment. This cycle of development is repeated until the requirements are
met.

Page 5 of 36
Prepared By: Prof. Bhagyshri Lachhwani SOFTWARE ENGINEERING[3161605]
4. Testing
Testing is the last phase of the Software Development Life Cycle before the software is
delivered to customers. During testing, experienced testers start to test the system against the
requirements.The testers aim to find defects within the system as well as verifying whether
the application behaves as expected and according to what was documented in the
requirements analysis phase.
Testers can either use a test script to execute each test and verify the results.It is possible that
defects are identified in the testing phase. Once a defect is found, testers inform the
developers about the details of the issue and if it is a valid defect, developers will fix and
create a new version of the software which needs to be verified again.This cycle is repeated
until all requirements have been tested and all the defects have been fixed and the software is
ready to be shipped.

5. Deployment and Maintenance


Once the software has been fully tested and no high priority issues remain in the software, it
is time to deploy to production where customers can use the system.
Once a version of the software is released to production, there is usually a maintenance team
that look after any post-production issues.If an issue is encountered in the production the
development team is informed and depending on how severe the issue is, it might either
require a hot-fix which is created and shipped in a short period of time or if not very severe,
it can wait until the next version of the software.

EXCERCISE:
1. Why SDLC is important for the development of project?
2. Draw SDLC Diagram in draw.io

EVALUATION:

Understanding /
Involvement
Problem solving Timely Completion Total
(3) (10)
(4) (3)

Signature with date:

Page 6 of 36
Prepared By: Prof. Bhagyshri Lachhwani SOFTWARE ENGINEERING[3161605]
EXPERIMENT NO: 2 DATE: / /

AIM: Develop Requirement Specification for a given problem

Objectives:
➢ To find the requirement specification (functional and Non-functional) of a
given problem.

Introduction
A software requirements specification captures complete description about how the system is
expected to perform. It is usually signed off at the end of requirements engineering phase.
Qualities of SRS:

● Correct
● Unambiguous
● Complete
● Consistent
● Ranked for importance and/or stability
● Verifiable
● Modifiable
● Traceable

Types of Requirements:
The below diagram depicts the various types of requirements that are captured during SRS

Page 7 of 36
Prepared By: Prof. Bhagyshri Lachhwani SOFTWARE ENGINEERING[3161605]
What do you mean by requirement analysis in SDLC?
Functional requirements specifies a function that a system or system component must be able
to perform. It can be documented in various ways. The most common ones are written
descriptions in documents, and use cases.

Use cases can be textual enumeration lists as well as diagrams, describing user actions. Each
use case illustrates behavioral scenarios through one or more functional requirements. Often,
though, an analyst will begin by eliciting a set of use cases, from which the analyst can
derive the functional requirements that must be implemented to allow a user to perform each
use case.

Functional requirements are what a system is supposed to accomplish. It m


● Calculations
● Product details
● Data manipulation
● Data processing
● Other specific functionality

A typical functional requirement will contain a unique name and number, a brief
summary, and a rationale. This information is used to help the reader understand why the
requirement is needed, and to track the requirement through the development of the system.

Non Functional Requirement:-


Non-functional requirements are any other requirement than functional requirements. This
are the requirements that specifies criteria that can be used to judge the operation of a
system, rather than specific behaviors’.

Non-functional requirements are in the form of "system shall be ", an overall property of the
system as a whole or of a particular aspect and not a specific function. The system's overall
properties commonly mark the difference between whether the development project has
succeeded or failed. Non-functional requirements - can be divided into two main categories:

● Execution qualities, such as security and usability, which are observable at run time.
● Evolution qualities, such as test-ability, maintainability, extensibility and scalability,
which are embodied in the static structure of the software system.

Page 8 of 36
Prepared By: Prof. Bhagyshri Lachhwani SOFTWARE ENGINEERING[3161605]
Non-functional requirements place restrictions on the product being developed, the
development process, and specify external constraints that the product must meet.
Some typical non-functional requirements are:

● Performance – for example Response Time, Throughput, Utilization, Static


Volumetric.
● Scalability.
● Capacity.
● Availability.
● Reliability.
● Recoverability.
● Maintainability.
● Serviceability.
Requirement Analysis for Smart shop
Now a day, every person is using android OS. We have made one website named “Smart
shop”. Customer can purchase products. Admin can upload products like wheat, rice etc.
Customer can login from his/her ID & Password. Then they can able to purchase products.
Admin also change his profile & he/she also change personal details but cannot change
his/her id or subject.
● User must have product easily to buy in smart shop.
● User must have identity on understand on appropriate function of website.
● User must have required plug in for this website.
● User must know how to run website.
● User must have good understanding to use the system more efficiently with the
use of appropriate messages given while using the system.
● User must be aware of the terminology used in the system.
● User must have provide different type of searching facilities.
● User must have provide shipping method.
● User must have customer can manage profile.
● User must have online SMS and Email send to the Customer.

Page 9 of 36
Prepared By: Prof. Bhagyshri Lachhwani SOFTWARE ENGINEERING[3161605]
Exercise:
1. Analyse all the functional requirements of Hospital Management system.
2. Analyse all the functional requirements of Time Table Scheduling system.
3. Analyse all the functional requirements of Library management system.
4. Analyse all the functional requirements of Given System

EVALUATION:

Understanding /
Involvement
Problem solving Timely Completion Total
(3) (10)
(4) (3)

Signature with date:

Page 10 of
Prepared By: Prof. Bhagyshri Lachhwani SOFTWARE ENGINEERING[3161605] 36
EXPERIMENT NO: 3 DATE: / /
AIM: Case study on Rational Rose visual modeling Tool.

Objectives:
➢ Study the benefits of visual modeling
➢ Complete understanding of Rational Rose

Visual Modeling
Visual Modeling is a way of thinking about problems using models organized around real-
world ideas. Models are useful for understanding problems, communicating with everyone
involved with the project (customers, domain experts, analysts, designers,etc.), modeling
enterprises, preparing documentation, and designing programs and databases

Visual Modeling
➔ Capture the structure and behavior of architectures and components.
➔ Show how the elements of the system fit together.
➔ Hide or expose details appropriate for the task.
➔ Maintain consistency between a design and its implement.

What is Rational Rose?


● ROSE stands for Rational Object-oriented Software Engineering.
● Rational Rose is developed by Rational Corporation which is under IBM.
● Rational Rose is a tool for modeling software systems.
● Rational Rose supports UML.
● The Rational Rose product family is designed to provide the software developer with
a complete set of visual modeling tools for development of robust, efficient solutions
to real business needs in the client/server, distributed enterprise and real-time systems
environments. Rational Rose products share a common universal standard, making
modeling accessible to non programmers wanting to model business processes as well
as to programmers modeling applications logic.

Rational ROSE DIAGRAMS


● Use Case
● Collaboration
● Sequence
● Class
● State chart
● Activity
● Component
● Deployment

Page 11 of 36
Prepared By: Prof. Bhagyshri Lachhwani SOFTWARE ENGINEERING 2160701
Rational Rose Interface:

Menubar: The menu bar consists of several menus like the file menu, edit menu, view menuetc.
All these menus contain several options.

Toolbar: The toolbar contains the most frequently used actions like New, Open, Save etc…

Statusbar: The status bar at the bottom displays status messages.

Browser Window: The browser window displays the views: Use Case View, Logical View,
Component View and Deployment View. Each of these views contains the diagrams.

Diagram Toolbar: The diagram toolbar displays the symbols of the respective type of
diagram.

Diagram Window: The diagram window is the place where the user draws the diagrams
using the symbols from the diagram toolbar.

Log Window: This window is used to display error messages, warnings and information
messages.

Documentation Window: This window is used to display the documentation related to the
symbols and other aspects.

How to use Rational ROSE


● Selecting a diagram

Page 12 of 36
Prepared By: Prof. Bhagyshri Lachhwani SOFTWARE ENGINEERING 2160701
● Right-clicking as shortcut
● Adding diagram elements from toolbar and browser
● Setting up default stereotypes
● Idea about the Reverse engineering
● Deleting from a diagram and the browser

Operations with Diagram


1. Creating a diagram
2. Linking a diagram
a. Create a note on any diagram.
b. Display the browser if not already visible.
c. In the browser, locate the diagram that you want to link.
d. Drag the diagram icon from the browser onto the note icon on the diagram.A
e. s you position the cursor onto the note, you will see the shortcut symbol (a
dotted square and a curved arrow inside a solid square).
f. The fully qualified name is displayed in an underline font.
Note: You may need to resize the note to see the entire name.
g. Change the text in the note (if desired) to something more meaningful to your
project.
h. Double-click on the note to view the linked diagram.

3. Displaying a diagram.
4. Rename a Diagram.
5. Deleting a diagram

Exercise:
1. How to Create a diagramin draw.io
2. Draw a diagram for flow chart of library management system using draw.io

EVALUATION:
Understanding /
Involvement
Problem solving Timely Completion Total
(3) (10)
(4) (3)

Signature with date:

Page 13 of 36
Prepared By: Prof. Bhagyshri Lachhwani SOFTWARE ENGINEERING 2160701
EXPERIMENT NO: 4 DATE: / /

AIM: Prepare Data dictionary for given project.

Objectives:
➢ Complete Understanding of Data Dictionary.
➢ Importance of Data Dictionary.

What is Data Dictionary?


A data dictionary is a collection of descriptions of the data objects or items in a data model
for the benefit of programmers and others who need to refer to them. A first step in analyzing
a system of objects with which users interact is to identify each object and its relationship to
other objects.The users of the database normally don't interact with the data dictionary, it is
only handled by the database administrators.

The data dictionary in general contains information about the following:

1. Names of all the database tables and their schemas.


2. Details about all the tables in the database, such as their owners, their security
constraints, when they were created etc.
3. Physical information about the tables such as where they are stored and how.
4. Table constraints such as primary key attributes, foreign key information etc.
5. Information about the database views that are visible.

This is a data dictionary describing a table that contains employee details.

Field Name Data Type Field Size Description Example


for display

Employee Integer 10 Unique ID of each 1645000001


Number employee

Name Text 20 Name of the employee David


Heston

Date of Birth Date/Time 10 DOB of Employee 08/03/1995

Phone Number Integer 10 Phone number of employee 6583648648

Page 14 of 36
Prepared By: Prof. Bhagyshri Lachhwani SOFTWARE ENGINEERING 2160701
Data dictionary example:

Exercise:
1. Prepare data dictionary for Hospital Management system.
2. Prepare data dictionary for Time Table Scheduling system.
3. Prepare data dictionary for Payroll system.
4. Prepare data dictionary for Given System

EVALUATION:

Understanding /
Involvement
Problem solving Timely Completion Total
(3) (10)
(4) (3)

Signature with date:

Page 15 of 36
Prepared By: Prof. Bhagyshri Lachhwani SOFTWARE ENGINEERING 2160701
EXPERIMENT NO: 5 DATE: / /
AIM: Prepare Use Case Diagram for given system.

Objectives:
➢ Learn use case diagrams: discovering actors and discovering use cases.
➢ Practice use cases diagrams using Rational Rose.

What is Use Case diagram?


A use case diagram at its simplest is a representation of a user's interaction with the system
that shows the relationship between the user and the different use cases in which the user is
involved.

Use case diagrams are ideal for:

● Representing the goals of system-user interactions


● Defining and organizing functional requirements in a system
● Specifying the context and requirements of a system
● Modeling the basic flow of events in a use case

Use case diagram components


● Actors: The users that interact with a system. An actor can be a person, an
organization, or an outside system that interacts with your application or system.
They must be external objects that produce or consume data.
● System: A specific sequence of actions and interactions between actors and the
system. A system may also be referred to as a scenario.
● Use-cases: sequence of actions.

Basic Use Case Diagram Symbols and Notations

System : Draw your system's boundaries using a rectangle that contains use cases. Place
actors outside the system's boundaries.

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 with the actor stereotype.

Page 16 of 36
Prepared By: Prof. Bhagyshri Lachhwani SOFTWARE ENGINEERING 2160701
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.

Online-shopping use case diagram example

Page 17 of 36
Prepared By: Prof. Bhagyshri Lachhwani SOFTWARE ENGINEERING 2160701
Railway reservation use case diagram example

Exercise:
1. Prepare Use Case diagram for Hospital Management system.
2. Prepare Use Case diagram for Time Table Scheduling system.
3. Prepare Use Case diagram for Payroll system.
4. Prepare Use Case diagram for Given System
5. Prepare Use Case diagram for college Attendance system.

EVALUATION:

Understanding /
Involvement
Problem solving Timely Completion Total
(3) (10)
(4)
(3)

Signature with date:

Page 18 of 36
Prepared By: Prof. Bhagyshri Lachhwani SOFTWARE ENGINEERING 2160701
EXPERIMENT NO: 6 DATE: / /
AIM: Prepare all the levels of DFD diagram for given system.

Objectives:
➢ Learn Data Flow diagrams

Data Flow Diagram.


➢ Data flow diagram is graphical representation of flow of data in an information
system. It is capable of depicting incoming data flow, outgoing data flow and stored
data.
➢ The DFD does not mention anything about how data flows through the system.
➢ There is a prominent difference between DFD and Flowchart. The flowchart depicts
flow of control in program modules. DFDs depict flow of data in the system at
various levels. DFD does not contain any control or branch elements.

DFD Components
DFD can represent Source, destination, storage and flow of data using the following set of
components -

● Entities - Entities are source and destination of information data. Entities are
represented by a rectangles with their respective names.

● Process - Activities and action taken on the data are represented by Circle or Round-
edged rectangles.

● Data Storage - There are two variants of data storage - it can either be represented as
a rectangle with absence of both smaller sides or as an open-sided rectangle with only
one side missing.

● Data Flow - Movement of data is shown by pointed arrows. Data movement is shown
from the base of arrow as its source towards head of the arrow as destination.

Levels of DFD

Level 0 - Highest abstraction level DFD is known as Level 0 DFD, which depicts the entire
information system as one diagram concealing all the underlying details. Level 0 DFDs are
also known as context level DFDs.

Page 19 of 36
Prepared By: Prof. Bhagyshri Lachhwani SOFTWARE ENGINEERING 2160701
Level 1 - The Level 0 DFD is broken down into more specific, Level 1 DFD. Level 1 DFD
depicts basic modules in the system and flow of data among various modules. Level 1 DFD
also mentions basic processes and sources of information.

Level 2 - At this level, DFD shows how data flows inside the modules mentioned in Level
1.Higher level DFDs can be transformed into more specific lower level DFDs with deeper
level of understanding unless the desired level of specification is achieved.

Page 20 of 36
Prepared By: Prof. Bhagyshri Lachhwani SOFTWARE ENGINEERING 2160701
Exercise:
1. Prepare DFD for given system.

EVALUATION:
Understanding /
Involvement
Problem solving Timely Completion Total
(3) (10)
(4) (3)

Signature with date:

Page 21 of 36
Prepared By: Prof. Bhagyshri Lachhwani SOFTWARE ENGINEERING 2160701
EXPERIMENT NO: 7 DATE: / /

AIM: Prepare ER diagram for given system.

Objectives:
➢ Learn ER diagram along with its symbols

What is Entity Relationship diagram?


An entity relationship diagram (ERD) shows the relationships of entity sets stored in a
database. An entity in this context is an object, a component of data. An entity set is a
collection of similar entities. These entities can have attributes that define its properties.

Symbols
An ER diagram is a means of visualizing how the information a system produces is related.
There are five main components of an ERD:

● Entities, which are represented by rectangles. An entity is an object or concept about


which you want to store information.

● A weak entity is an entity that must defined by a foreign key relationship with
another entity as it cannot be uniquely identified by its own attributes alone.

● Actions, which are represented by diamond shapes, show how two entities share
information in the database.

Page 22 of 36
Prepared By: Prof. Bhagyshri Lachhwani SOFTWARE ENGINEERING 2160701
In some cases, entities can be self-linked. For example, employees can supervise
other employees.

● Attributes, which are represented by ovals. A key attribute is the unique,


distinguishing characteristic of the entity. For example, an employee's social security
number might be the employee's key attribute.

● A multivalued attribute can have more than one value. For example, an employee
entity can have multiple skill values.

● A derived attribute is based on another attribute. For example, an employee's monthly


salary is based on the employee's annual salary.

● Connecting lines, solid lines that connect attributes to show the relationships of
entities in the diagram.

● Cardinality specifies how many instances of an entity relate to one instance of


another entity. Ordinality is also closely linked to cardinality. While cardinality
specifies the occurrences of a relationship, ordinality describes the relationship as
either mandatory or optional. In other words, cardinality specifies the maximum
number of relationships and ordinality specifies the absolute minimum number of
relationships.

Page 23 of 36
Prepared By: Prof. Bhagyshri Lachhwani SOFTWARE ENGINEERING 2160701
ER Diagram for Banking system:

Page 24 of 36
Prepared By: Prof. Bhagyshri Lachhwani SOFTWARE ENGINEERING 2160701
Exercise:
1. Prepare ER diagram for Hospital Management system.
2. Prepare ER diagram for Time Table Scheduling system.
3. Prepare ER diagram for Payroll system.
4. Prepare ER diagram for Library management system.
5. Prepare ER diagram for Given System

EVALUATION:

Understanding /
Involvement
Problem solving Timely Completion Total
(3) (10)
(4)
(3)

Signature with date:

Page 25 of 36
Prepared By: Prof. Bhagyshri Lachhwani SOFTWARE ENGINEERING 2160701
EXPERIMENT NO: 8 DATE: / /

AIM: - Prepare Activity diagram for given system.

Objectives:
➢ Detailed understanding of Activity diagram.

Introduction
Activity diagram is another important diagram in UML to describe the dynamic aspects of
the system. 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.

Benefits of activity diagrams


Activity diagrams present a number of benefits to users. Consider creating an activity
diagram to:

● Demonstrate the logic of an algorithm.


● Describe the steps performed in a UML use case.
● Illustrate a business process or workflow between users and the system.
● Simplify and improve any process by clarifying complicated use cases.
● Model software architecture elements, such as method, function, and operation.

Activity diagram symbols


These activity diagram shapes and symbols are some of the most common types you'll find in
UML diagrams.

Page 26 of 36
Prepared By: Prof. Bhagyshri Lachhwani SOFTWARE ENGINEERING 2160701
Activity Diagram Example - Student Enrollment
This UML activity diagram example describes a process for student enrollment in a
university as follows:

● An applicant wants to enroll in the university.


● The applicant hands a filled out copy of Enrollment Form.
● The registrar inspects the forms.
● The registrar determines that the forms have been filled out properly.
● The registrar informs student to attend in university overview presentation.
● The registrar helps the student to enroll in seminars.
● The registrar asks the student to pay for the initial tuition.

Page 27 of 36
Prepared By: Prof. Bhagyshri Lachhwani SOFTWARE ENGINEERING 2160701
Activity diagram for a login page
Many of the activities people want to accomplish online—checking email, managing
finances, ordering clothes, etc.—require them to log into a website. This activity diagram
shows the process of logging into a website, from entering a username and password to
successfully logging in to the system.

Page 28 of 36
Prepared By: Prof. Bhagyshri Lachhwani SOFTWARE ENGINEERING 2160701
Activity diagram for a banking system
This diagram shows the process of either withdrawing money from or depositing money into
a bank account.

Exercise:
1. Prepare Activity diagram for Given System.
2. Prepare Activity diagram for Time Table Scheduling system.
3. Prepare Activity diagram for Payroll system.
4. Prepare Activity diagram for Library management system.

EVALUATION:
Understanding /
Involvement
Problem solving Timely Completion Total
(3) (10)
(4) (3)

Signature with date:

Page 29 of 36
Prepared By: Prof. Bhagyshri Lachhwani SOFTWARE ENGINEERING 2160701
EXPERIMENT NO: 9 DATE: / /

AIM: Calculate FP based Estimation and LOC based Estimation for given project.

Objectives:

➢ Detailed understanding Project estimation techniques such as FP based ans LOC


based Estimation.

What is LOC based Estimation

➢ The LOC (Line of Code) is a product size metric in software engineering. Here, the
number of lines in the code are counted and based on the number of lines the cost is
calculated.
➢ There is no definite clear picture of how to count number of lines because the length
and complexity of the code is different in different languages.
➢ It only depends on the length but not on complexity and functionality.
Example

Based on historical data, assume the average productivity is as follows:


Number of LOC per month: $500 LOC/month.
The cost per month: $9000
Therefore, cost estimation per line of code is $9000/$500 = $18 / LOC

There are
• 5 physical line of code.
• 2 logical line of code (printf statement and for statement)
• 1 comment line.
Example:
The problems of lines of code (LOC) – Different languages lead to different lengths of
code – It is not clear how to count lines of code – A report, screen, or GUI generator can
generate thousands of lines of code in minutes – Depending Depending on the application
application, the complexity complexity of code is different.

Page 30 of 36
Prepared By: Prof. Bhagyshri Lachhwani SOFTWARE ENGINEERING 2160701
LOC‐based Estimation Estimation ‐Example

Function Estimated LOC

User interface 2,300

2‐D geometric analysis 5,300

3‐D geometric analysis 6 800

Database management 3,500

Graphic display facilities 4,950

I/O control function 2,100

Analysis function 8,400

Total estimated LOC 33,350

Average Average productivity productivity based on historical historical data – 620


LOC/pm – $8,000 per month ‐> $12.91/LOC

What is FP based Estimation

● Function points are independent of the language, tools, or methodologies used for
implementation (ex. Do not take into consideration programming languages,
DBMS, or processing hardware).
● Function points can be estimated early in analysis and design,Since function points
are based on the system user’s external view of the system, non-technical users of
the software system have a better understanding of what function points are
measuring .

Uses of Function Points

➢ Measure productivity (ex. Number of function points achieved per work hour
expended)
➢ Estimate development and support (cost benefit analysis, staffing estimation)
➢ Normalize other measures (Other measures, such as defects, frequently require the
size in function points)
➢ Measure software development and maintenance independently of technology used
for implementation.
➢ As baseline metrics collected from past projects and used in conjuction with
estimation variables to develop cost and effort projections.
➢ A consistent measure among various projects and organizations

Page 31 of 36
Prepared By: Prof. Bhagyshri Lachhwani SOFTWARE ENGINEERING 2160701
The approach is to identify and count a number of unique function types:

● external inputs (e.g. file names)


● external outputs (e.g. reports, messages)
● queries (interactive inputs needing a response)
● external files or interfaces (files shared with other software systems)
● internal files (invisible outside the system)

Each of these is then individually assessed for complexity and given a weighting value
which varies from 3 (for simple external inputs) to 15 (for complex internal files).

Unadjusted function points ( UFP ) is calculated as follows :

The sum of all the occurrences is computed by multiplying each function count with a
weighting and then adding up all the values. The weights are based on the complexity of
the feature being counted. Albrecht’s original method classified the weightings as:

Function Type Low Average High

External Input x3 x4 x6

External Input x4 x5 x7

Logical Internal File x7 x10 x15

External Interface File x5 x7 x10

External Inquiry x3 x4 x6

Low, average and high decision can be determined with this table :

1-5 Data 6-19 Data element 20+ Data


element types types element types

0-1 File types referenced Low Low Average

2-3 File types referenced Low Average High

4+ File types referenced Average High High

Page 32 of 36
Prepared By: Prof. Bhagyshri Lachhwani SOFTWARE ENGINEERING 2160701
In order to find adjusted FP, UFP is multiplied by technical complexity factor ( TCF )
which can be calculated by the formula : TCF = 0.65 + ( sum of factors ) / 100

There are 14 technical complexity factor. Each complexity factor is rated on the basis of
its degree of influence, from no influence to very influencial :

1. Data communications 2. Performance 3. Heavily used configuration


4. Transaction rate 5. Online data entry 6. End user efficiency
7. Online update 8. Complex processing 9. Reusability
10.Installation ease 11. Operations ease 12. Multiple sites
13. Facilitate change 14. Distributed functions
Then FP = UFP x TCF

Function points are recently used also for real time systems.

Advantages of FP

1. It is not restricted to code


2. Language independent
3. The necessary data is available early in a project. We need onşy a detailed
specification.
4. More accurate than estimated LOC

Drawbacks of FP

1. Subjective counting
2. Hard to automate and difficult to compute
3. Ignores quality of output
4. Oriented to traditional data processing applications
5. Effort prediction using the unadjusted function count is often no worse than when the
TCF is added.

Exercise:
1. Calculate FP based project estimation for any given project.
For LOC based estimation If the estimated project is 33,200 LOC, – then the total estimated
project cost is $ and – the estimated effort is person‐months.

EVALUATION:
Understanding /
Involvement
Problem solving Timely Completion Total
(3) (10)
(4)
(3)

Signature with date:

Page 33 of 36
Prepared By: Prof. Bhagyshri Lachhwani SOFTWARE ENGINEERING 2160701
EXPERIMENT NO: 10 DATE: / /

AIM: Consider the any code segment:


1. Guarantees that all independent execution path is exercised at least once;
2. Calculate the Cyclomatic complexity for given code

Objectives:
➢ Learn about Software Metric.
➢ Detailed understanding of Cyclomatic Complexity and its importance.

What is Software Metric?

Measurement is nothing but quantitative indication of size / dimension / capacity of an


attribute of a product / process.Software metric is defined as a quantitative measure of an
attribute a software system possesses with respect to Cost, Quality, Size and Schedule.
Example-
Measure - No. of Errors
Metrics - No. of Errors found per person

What is Cyclomatic Complexity?

➢ Cyclomatic complexity is a software metric used to measure the complexity of a


program. These metric, measures independent paths through program source code.
➢ Independent path is defined as a path that has at least one edge which has not been
traversed before in any other paths.
➢ Cyclomatic complexity can be calculated with respect to functions, modules, methods
or classes within a program.This metric was developed by Thomas J. McCabe in
1976 and it is based on a control flow representation of the program. Control flow
depicts a program as a graph which consists of Nodes and Edges.
➢ In the graph, Nodes represent processing tasks while edges represent control flow
between the nodes.

Flow graph notation for a program:


Flow Graph notation for a program is defines. several nodes connected through the edges.
Below are Flow diagrams for statements like if-else, While, until and normal sequence of
flow.

Page 34 of 36
Prepared By: Prof. Bhagyshri Lachhwani SOFTWARE ENGINEERING 2160701
Mathematical representation:
Mathematically, it is set of independent paths through the graph diagram. The complexity of
the program can be defined as -
V(G) = E - N + 2
Where,
E - Number of edges
N - Number of Nodes
V (G) = P + 1
Where P = Number of predicate nodes (node that contains condition)

Example
i = 0;
n=4; //N-Number of nodes present in the graph
while (i<n-1) do
j = i + 1;
while (j<n) do
if A[i]<A[j] then
swap(A[i], A[j]);
end do;
i=i+1;
end do;

Flow graph for this program will be

Page 35 of 36
Prepared By: Prof. Bhagyshri Lachhwani SOFTWARE ENGINEERING 2160701
Computing mathematically,

● V(G) = 9 - 7 + 2 = 4
● V(G) = 3 + 1 = 4 (Condition nodes are 1,2 and 3 nodes)
● Basis Set - A set of possible execution path of a program
● 1, 7
● 1, 2, 6, 1, 7
● 1, 2, 3, 4, 5, 2, 6, 1, 7
● 1, 2, 3, 5, 2, 6, 1, 7

Properties of Cyclomatic complexity:

Following are the properties of Cyclomatic complexity:

1. V (G) is the maximum number of independent paths in the graph


2. V (G) >=1
3. G will have one path if V (G) = 1
4. Minimize complexity to 10

How this metric is useful for software testing?

Basis Path testing is one of White box technique and it guarantees to execute atleast one
statement during testing. It checks each linearly independent path through the program,
which means number test cases, will be equivalent to the cyclomatic complexity of the
program.
This metric is useful because of properties of Cyclomatic complexity (M) -

1. M can be number of test cases to achieve branch coverage (Upper Bound)


2. M can be number of paths through the graphs. (Lower Bound)

Consider this example -

If (Condition 1)
Statement 1
Else
Statement 2
If (Condition 2)
Statement 3
Else
Statement 4

Cyclomatic Complexity for this program will be 9-7+2=4.


As complexity has calculated as 4, four test cases are necessary to the complete path
coverage for the above example.

Page 36 of 36
Prepared By: Prof. Bhagyshri Lachhwani SOFTWARE ENGINEERING 2160701
Steps to be followed:

The following steps should be followed for computing Cyclomatic complexity and test cases
design.
Step 1 - Construction of graph with nodes and edges from the code
Step 2 - Identification of independent paths
Step 3 - Cyclomatic Complexity Calculation
Step 4 - Design of Test Cases
Once the basic set is formed, TEST CASES should be written to execute all the paths.

What is V (G):
Cyclomatic complexity can be calculated manually if the program is small. Automated tools
need to be used if the program is very complex as this involves more flow graphs. Based on
complexity number, team can conclude on the actions that need to be taken for measure.
Following table gives overview on the complexity number and corresponding meaning of v
(G):
Complexity Number Meaning

1-10 Structured and well written code,High Testability,Cost and Effort is


Less

10-20 Complex code,Medium Testability,Cost and Effort is Medium

20-40 Very Complex code,Low Testability,Cost and Efforts are High

>40 Not at all testable, very high cost and Effort

Exercise:

1. Calculate Cyclomatic Complexity for any given program.

EVALUATION:

Understanding /
Involvement
Problem solving Timely Completion Total
(3) (10)
(4) (3)

Signature with date:

Page 37 of 36
Prepared By: Prof. Bhagyshri Lachhwani SOFTWARE ENGINEERING 2160701

You might also like