0% found this document useful (0 votes)
7 views

Week 06 Lecture 11&12: Product Metrics Waqas Ud Deen

Uploaded by

uocboy
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PPTX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
7 views

Week 06 Lecture 11&12: Product Metrics Waqas Ud Deen

Uploaded by

uocboy
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PPTX, PDF, TXT or read online on Scribd
You are on page 1/ 26

Week 06 Lecture

11&12
Product Metrics
Waqas Ud Deen

1
Software Cost Estimation

• Software cost estimation is the cost of


predicting the amount of effort required to
build a software system.

2
Important Concepts
• Measure :A quantitative indication of an attribute
• Measurement :Act of measure
• Metrics :A quantitative measure of the degree to possess
a given attribute
• Indicator :A metric or combination of metrics which provide
an insight

3
Why Measurement ?

Measurements provide us a mechanism for:


• Objective evaluation
• Gaining an insight into the efficacy of the software
process and projects
• Assisting in estimation, quality control,
productivity assessment, and project control
• Improving software process on a continuous basis
• Pinpointing the problem areas so that remedies can
be taken
4
Work
Product
• Product metrics are computed from data
collected from the requirements and design
models, source code and test cases.

5
Why do we Measure?

• To
characterize
• To evaluate
• To predict
• To improve

6
Role
• Analysis and Assessment
By Software
Managers

• Collection of measures
By Software Engineers

7
What is Metrics ?
• Metrics are a system of parameters or ways of quantitative and periodic
assessment of a process that is to be measured, along with the
procedures to carry out such measurement and the procedures for the
interpretation of the assessment in the light of previous or comparable
assessments. Metrics are usually specialized by the subject area, in which
case they are valid only within a certain domain and cannot be directly
benchmarked or interpreted outside it.
Retrieved from "http://en.wikipedia.org/wiki/Metrics"
• The metric system is the modern approach to weights and measures.
• Measures typically are quantitative in nature, conveyed in
numbers, dollars, percentages, etc

8
Contd!....

• Software metrics are the statistics


describing the structure or content of a
program. A metric should be a real
objective measurement of something such
as number of bugs per lines of code

9
Software Measurements

Measurements can be categorized in two ways

• Direct Measures – Cost and Effort Applied


e.g: LOC, execution speed, memory size etc
• Indirect Measures – Abilities
e.g: functionality, quality,
complexity, efficiency
etc

Indirect Measures are more difficult to collect


10
Measurement
Principles
• Assist in the evaluation of the analysis
and design models.
• Provide an indication of the complexity
of procedural designs and source code.
• Facilitate the design of more effective
testing

11
Measurement Process Five Activities
• Formulation: The derivation of software measures and
metrics appropriate for the representation of the software
that is being considered.
• Collection: The mechanism used to accumulate data
required to derive the formulated metrics.
• Analysis: The computation of metrics and the application of
mathematical tools.
• Interpretation: The evaluation of metrics resulting in insight
into the quality of the representation.
• Feedback: Recommendations derived from the interpretation
of product metrics transmitted to the software team.
12
The Attributes of Effective S/W Metrics

• Simple and Computable


• Consistent and objective
• Consistent in its use of units and
dimensions
• Programming language independent
• An effective mechanism for high quality
feedback
13
Metric Classification
• Products
– Explicit results of software development activities
– Deliverables, documentation, by products

• Processes
– Activities related to production of software

• Resources
– Inputs into the software development activities
– hardware, knowledge, people
Product vs. Process
• Process Metrics
– Insights of process paradigm, software engineering tasks,
work product, or milestones
– Lead to long term process improvement

• Product Metrics
– Assesses the state of the project
– Track potential risks
– Uncover problem areas
– Adjust workflow or tasks
– Evaluate teams ability to control quality
Types of Measures
• Direct Measures (internal attributes)
– Cost, effort, LOC, speed, memory

• Indirect Measures (external attributes)


– Functionality, quality, complexity, efficiency,
reliability, maintainability
Metrics For Specification
Quality
• Davis and his colleagues propose a list of
characteristics that can be used to access
the quality of the requirements model and
the requirement specification
specificity(lack of ambiguity), completeness,
correctness,understandability,verifiability
Size-Oriented Metrics
• Size of the software produced
• LOC - Lines Of Code
• KLOC - 1000 Lines Of Code
• SLOC – Statement Lines of Code (ignore
whitespace)
• Typical Measures:
– Errors/KLOC, Defects/KLOC, Cost/LOC, Documentation
Pages/KLOC
LOC Metrics
• Easy to use

• Easy to compute

• Language & programmer


dependent
SLOC Estimation

• All lines of source code except for comments and blanks,


are counted
• Accurate estimation of the LOC count at the beginning of a
project is very difficult.
• Estimate the LOC count at the beginning of a project, divide
the problem into modules, and each module into submodules
and so on, until the sizes of the different leaf-level modules
can be approximately predicted.

24
Types of SLOC
• There are two major types of SLOC measures:
physical SLOC (LOC) and logical SLOC (LLOC).
Example
• for (i = 0; i < 100; i += 1) print("hello"); /* How many
lines of code is this? */
• In this example we have:
• 1 Physical Lines of Code (LOC)
• 2 Logical Line of Code (LLOC) (for statement and printf
statement)
• 1 comment line
/* Now how many lines of code is this? */
for (i = 0; i < 100; i += 1)
{
printf("hello");
}
• 5 Physical Lines of Code (LOC): is placing braces work to be
estimated?
• 2 Logical Line of Code (LLOC): what about all the work
writing non-statement lines?
• 1 comment line: tools must account for all code and
comments regardless of comment placement.
Complexity
Metrics
• LOC - a function of complexity
• Language and programmer dependent
• Halstead’s Software Science
Halstead's complexity measures are based on counts of
operators and operands in code. This is highly correlated to
the number of lines of code, with the improvement that
more complicated lines will contribute more to the metric
than simple lines. Halstead's central observation on
program length is that the number of distinct, unique
operators and operands can be used to compute a number
that approximates N:
Halstead’s Metrics
– n1 - number of distinct operators
– n2 - number of distinct operands
– N1 - total number of operators
– N2 - total number of operands
Example
if (k < 2)
{
if (k > 3)
x = x*k;
}

• Distinct
operators: if
(){}><=*;
• Distinct
operands: k 2
3x
• n1 = 10
• n2 = 4
Advantages
• Easy to count
• It is an artifact of all software development projects

Disadvantages
• LOC measures are programming language
dependent
• Its use in estimation requires a level of detail that is
difficult to achieve early in the development
process
35

You might also like