CH 22
CH 22
6/e
Chapter 22
Process and Project Metrics
copyright © 1996, 2001, 2005
R.S. Pressman & Associates, Inc.
These courseware materials are to be used in conjunction with Software Engineering: A Practitioner’s Approach, 6/e and are provided with
permission by R.S. Pressman & Associates, Inc., copyright © 1996, 2001, 2005 1
Until you can measure something and express
it in numbers, you have only the beginning of
understanding.
- Lord Kelvin
These courseware materials are to be used in conjunction with Software Engineering: A Practitioner’s Approach, 6/e and are provided with
permission by R.S. Pressman & Associates, Inc., copyright © 1996, 2001, 2005 2
Until you can measure something and express it in
numbers, you have only the beginning of
understanding.
- Lord Kelvin
- Lord Kelvin
These courseware materials are to be used in conjunction with Software Engineering: A Practitioner’s Approach, 6/e and are provided with
permission by R.S. Pressman & Associates, Inc., copyright © 1996, 2001, 2005 4
Metrics for software
When asked to measure something, always try to
determine an objective measurement. If not possible, try
to get as close as you can!
These courseware materials are to be used in conjunction with Software Engineering: A Practitioner’s Approach, 6/e and are provided with
permission by R.S. Pressman & Associates, Inc., copyright © 1996, 2001, 2005 5
A Good Manager Measures
process
process metrics
project metrics
measurement
product metrics
product
What do we
use as a
basis?
• size?
• function?
These courseware materials are to be used in conjunction with Software Engineering: A Practitioner’s Approach, 6/e and are provided with
permission by R.S. Pressman & Associates, Inc., copyright © 1996, 2001, 2005 6
We need a basis to say 20 defects per X
lines of code. Why is this important?
A Because lines of code equals cost
B We want our metrics to be valid across projects of
many sizes
C Because you just caused me to die in Halo 3… stop
asking these questions!
D Because this helps up understand how big our
program is
These courseware materials are to be used in conjunction with Software Engineering: A Practitioner’s Approach, 6/e and are provided with
permission by R.S. Pressman & Associates, Inc., copyright © 1996, 2001, 2005 7
Why Do We Measure?
assess the status of an ongoing project
track potential risks
uncover problem areas before they go “critical,”
adjust work flow or tasks,
evaluate the project team’s ability to control
quality of software work products.
These courseware materials are to be used in conjunction with Software Engineering: A Practitioner’s Approach, 6/e and are provided with
permission by R.S. Pressman & Associates, Inc., copyright © 1996, 2001, 2005 8
Process versus Project Metrics
Process Metrics - Measure the process to help update
and change the process as needed across many projects
These courseware materials are to be used in conjunction with Software Engineering: A Practitioner’s Approach, 6/e and are provided with
permission by R.S. Pressman & Associates, Inc., copyright © 1996, 2001, 2005 10
Process Metrics Guidelines
Use common sense and organizational sensitivity when interpreting metrics
data.
Provide regular feedback to the individuals and teams who collect
measures and metrics.
Don’t use metrics to appraise individuals.
Work with practitioners and teams to set clear goals and metrics that will be
used to achieve them.
Never use metrics to threaten individuals or teams.
Metrics data that indicate a problem area should not be considered
“negative.” These data are merely an indicator for process improvement.
Don’t obsess on a single metric to the exclusion of other important metrics.
These courseware materials are to be used in conjunction with Software Engineering: A Practitioner’s Approach, 6/e and are provided with
permission by R.S. Pressman & Associates, Inc., copyright © 1996, 2001, 2005 11
If I calculate the number of defects
per developer and rank them, then
using that rank assign salary raises
based on that.
A. This is good
B. This is bad
C. Helloo…. Halo 3? Stop it.
These courseware materials are to be used in conjunction with Software Engineering: A Practitioner’s Approach, 6/e and are provided with
permission by R.S. Pressman & Associates, Inc., copyright © 1996, 2001, 2005 12
Software Process Improvement
Process model
Process improvement
Improvement goals recommendations
These courseware materials are to be used in conjunction with Software Engineering: A Practitioner’s Approach, 6/e and are provided with
permission by R.S. Pressman & Associates, Inc., copyright © 1996, 2001, 2005 14
Can you calculate a metric that records
the number of ‘e’ that appear in a
program? A. Yes B. No
Should you calculate the number of ‘e’ in a program?
A. Yes
B. No
These courseware materials are to be used in conjunction with Software Engineering: A Practitioner’s Approach, 6/e and are provided with
permission by R.S. Pressman & Associates, Inc., copyright © 1996, 2001, 2005 15
Effective Metrics (ch 15)
Simple and computable
Empirically and intuitively persuasive
Consistent and objective
Consistent in use of units and dimensions
Programming language independent
Should be actionable
These courseware materials are to be used in conjunction with Software Engineering: A Practitioner’s Approach, 6/e and are provided with
permission by R.S. Pressman & Associates, Inc., copyright © 1996, 2001, 2005 16
Actionable Metrics
Actionable metrics (or information in general) are metrics
that guide change or decisions about something
These courseware materials are to be used in conjunction with Software Engineering: A Practitioner’s Approach, 6/e and are provided with
permission by R.S. Pressman & Associates, Inc., copyright © 1996, 2001, 2005 18
Typical Project Metrics
Effort/time per software engineering task
Errors uncovered per review hour
Scheduled vs. actual milestone dates
Changes (number) and their characteristics
Distribution of effort on software engineering
tasks
These courseware materials are to be used in conjunction with Software Engineering: A Practitioner’s Approach, 6/e and are provided with
permission by R.S. Pressman & Associates, Inc., copyright © 1996, 2001, 2005 19
Metrics Guidelines
Use common sense and organizational sensitivity when interpreting
metrics data.
Provide regular feedback to the individuals and teams who have
worked to collect measures and metrics.
Don’t use metrics to appraise individuals.
Work with practitioners and teams to set clear goals and metrics that
will be used to achieve them.
Never use metrics to threaten individuals or teams.
Metrics data that indicate a problem area should not be considered
“negative.” These data are merely an indicator for process
improvement.
Don’t obsess on a single metric to the exclusion of other important
metrics.
These courseware materials are to be used in conjunction with Software Engineering: A Practitioner’s Approach, 6/e and are provided with
permission by R.S. Pressman & Associates, Inc., copyright © 1996, 2001, 2005 21
Typical Function-Oriented Metrics
These courseware materials are to be used in conjunction with Software Engineering: A Practitioner’s Approach, 6/e and are provided with
permission by R.S. Pressman & Associates, Inc., copyright © 1996, 2001, 2005 22
But.. What is a Function Point?
Function points (FP) are a unit measure for software size
developed at IBM in 1979 by Richard Albrecht
To determine your number of FPs, you classify a system
into five classes:
Transactions - External Inputs, External Outputs, External Inquires
Data storage - Internal Logical Files and External Interface Files
Each class is then weighted by complexity as
low/average/high
Multiplied by a value adjustment factor (determined by
asking questions based on 14 system characteristics
These courseware materials are to be used in conjunction with Software Engineering: A Practitioner’s Approach, 6/e and are provided with
permission by R.S. Pressman & Associates, Inc., copyright © 1996, 2001, 2005 23
But.. What is a Function Point?
Count Low Average High Total
External Input x3 x4 x6
External Output x4 x5 x7
External Inquiries x3 x4 x6
http://www.his.sunderland.ac.uk/~cs0mel/Alb_Example.doc
These courseware materials are to be used in conjunction with Software Engineering: A Practitioner’s Approach, 6/e and are provided with
permission by R.S. Pressman & Associates, Inc., copyright © 1996, 2001, 2005 25
Comparing LOC and FP
Programming LOC per Function point
Language avg. median low high
Ada 154 - 104 205
Assembler 337 315 91 694
C 162 109 33 704
C++ 66 53 29 178
COBOL 77 77 14 400
Java 63 53 77 -
JavaScript 58 63 42 75
Perl 60 - - -
PL/1 78 67 22 263
Powerbuilder 32 31 11 105
SAS 40 41 33 49
Smalltalk 26 19 10 55
SQL 40 37 7 110
Visual Basic 47 42 16 158
These courseware materials are to be used in conjunction with Software Engineering: A Practitioner’s Approach, 6/e and are provided with
permission by R.S. Pressman & Associates, Inc., copyright © 1996, 2001, 2005 26
At IBM in the 70s or 80s (I don’t
remember) they paid people per line-
of-code they wrote
What happened?
A. The best programmers got paid the most
B. The worst programmers got paid the most
C. The sneakiest programmers, got paid the most
D. The lawyers got paid the most
These courseware materials are to be used in conjunction with Software Engineering: A Practitioner’s Approach, 6/e and are provided with
permission by R.S. Pressman & Associates, Inc., copyright © 1996, 2001, 2005 27
Why Opt for FP?
Programming language independent
Used readily countable characteristics that are
determined early in the software process
Does not “penalize” inventive (short) implementations
that use fewer LOC that other more clumsy versions
Makes it easier to measure the impact of reusable
components
These courseware materials are to be used in conjunction with Software Engineering: A Practitioner’s Approach, 6/e and are provided with
permission by R.S. Pressman & Associates, Inc., copyright © 1996, 2001, 2005 28
Object-Oriented Metrics
Number of scenario scripts (use-cases)
Number of support classes (required
( to implement the
system but are not immediately related to the problem
domain)
Average number of support classes per key class
(analysis class)
Number of subsystems (an aggregation of classes that
support a function that is visible to the end-user of a
system)
These courseware materials are to be used in conjunction with Software Engineering: A Practitioner’s Approach, 6/e and are provided with
permission by R.S. Pressman & Associates, Inc., copyright © 1996, 2001, 2005 29
WebEngineering Project Metrics
Number of static Web pages (the end-user has no control over the content
displayed on the page)
Number of dynamic Web pages (end-user actions result in customized
content displayed on the page)
Number of internal page links (internal page links are pointers that provide
a hyperlink to some other Web page within the WebApp)
Number of persistent data objects
Number of external systems interfaced
Number of static content objects
Number of dynamic content objects
Number of executable functions
These courseware materials are to be used in conjunction with Software Engineering: A Practitioner’s Approach, 6/e and are provided with
permission by R.S. Pressman & Associates, Inc., copyright © 1996, 2001, 2005 30
Measuring Quality
Correctness — the degree to which a program operates
according to specification
Verified non-conformance
Maintainability—the degree to which a program
with reqmts is
amenable to change ----------------------------------
MTTC KLOC
Integrity—the degree to whichMean
a program
time tois impervious
change:
time to analyze, design,
to outside attack implement and deploy
threat probability
Usability—the degree tosecurity
which a- program
likelihood is
a change
ofeasy to use
repelling attack
Integrity = 1-(threat*(1-security))
Many options. See ch 12
E.g. t=0.25, s=0.95 --> I=0.99
These courseware materials are to be used in conjunction with Software Engineering: A Practitioner’s Approach, 6/e and are provided with
permission by R.S. Pressman & Associates, Inc., copyright © 1996, 2001, 2005 31
Defect Removal Efficiency
DRE = E /(E + D)
These courseware materials are to be used in conjunction with Software Engineering: A Practitioner’s Approach, 6/e and are provided with
permission by R.S. Pressman & Associates, Inc., copyright © 1996, 2001, 2005 32
Defect Removal Efficiency
DRE = E /(E + D)
These courseware materials are to be used in conjunction with Software Engineering: A Practitioner’s Approach, 6/e and are provided with
permission by R.S. Pressman & Associates, Inc., copyright © 1996, 2001, 2005 34
Establishing a Metrics Program
Set Goals
Identify your business goals.
Identify what you want to know or learn.
Identify your subgoals.
Identify the entities and attributes related to your subgoals.
Formalize your measurement goals.
Determine indicators for goals
Identify quantifiable questions and the related indicators that you will use to
help you achieve your measurement goals.
Identify the data elements that you will collect to construct the indicators that
help answer your questions.
Define Measurements
Define the measures to be used, and make these definitions operational.
Identify the actions that you will take to implement the measures.
Prepare a plan for implementing the measures.
These courseware materials are to be used in conjunction with Software Engineering: A Practitioner’s Approach, 6/e and are provided with
permission by R.S. Pressman & Associates, Inc., copyright © 1996, 2001, 2005 35
Metrics give you information!
Metrics about your process help you determine if you
need to make changes or if your process is working
Metrics about your project do they same thing
Metrics about your software can help you understand it
better, and see where possible problems may lurk. Let’s
see the complexity measurement (after a few
questions…)
These courseware materials are to be used in conjunction with Software Engineering: A Practitioner’s Approach, 6/e and are provided with
permission by R.S. Pressman & Associates, Inc., copyright © 1996, 2001, 2005 36
Questions
What are some reasons NOT to use lines of code to
measure size?
What do you expect the DRE rate will be for the
implementation (or construction) phase of the software
lifecycle?
What about for testing?
Give an example of a usability metric?
According to the chart, Smalltalk is much more efficient
than Java and C++. Why don’t we use it for everything?
These courseware materials are to be used in conjunction with Software Engineering: A Practitioner’s Approach, 6/e and are provided with
permission by R.S. Pressman & Associates, Inc., copyright © 1996, 2001, 2005 37