1. Software Metrics
What it is?
What are the different Metrics?
The act of collecting Software measurement Data.
13 January 2012 Made By Utpal Ray 1
2. Software Metrics
The Story So Far
4 Blocks SDLC ( Software Development Life Cycle ) Model
Design and
SPECIFI- Testing and Maintenance
Development
CATION Validation
Software Measurement Process
13 January 2012 Made By Utpal Ray 2
3. Software Metrics
Why do we do software measurement?
Measurement is fundamental to any engineering
discipline, and software engineering is no exception.
To get an insight into the software process.
To do process improvement.
To make the quality of the product better.
To express the qualitative factor by a number.
To make a better estimate of the cost, schedule,
complexity, effort requirements etc. of the s/w
development process.
13 January 2012 Made By Utpal Ray 3
4. Software Metrics
Why do we do software measurement? ( contd. )
The answer was nicely given by Lord Kelvin:-
When you can measure what you are speaking about and
express it in numbers, you know something about it; but
when you cannot measure, when you cannot express it in
numbers, your knowledge is of a meager and unsatisfactory
kind: it may be the beginning of knowledge, but you have
scarcely , in your thoughts, advanced to the stage of science.
13 January 2012 Made By Utpal Ray 4
5. Software Metrics
Measures, Measurements, Metrics, Indicators
Measure is a quantitative indication of the extent, size,
amount, dimension, capacity of some attributes of a
product or a process.
Measurement is the act of determining a measure.
Metric is a quantitative measure of the degree to which
a system, component, or a process possesses a given
attribute.
An indicator is a metric or a combination of metrics
that provide insight into the s/w process, a s/w project
or the s/w product itself.
13 January 2012 Made By Utpal Ray 5
6. Software Metrics
Measures, Measurements, Metrics, Indicators ( contd. )
S/W
Engineering
Process
Measures
Data Collection
S/W Projects
Metrics
Metrics
S/W Computation
Products
Metrics Indicators
Evaluation
13 January 2012 Made By Utpal Ray 6
7. Software Metrics
An example of “Measures, Measurements, Metrics,
Indicators”
All test engineers of a certain project started collecting
the following measure – ‘The errors found in the test
cycle’.
But this measure is not enough to compute a suitable
metric. You need two more measurements, which are
number of test engineer and the number of months
spent on the testing process.
Suppose there were 5 test engineers and they spent
about 6 months to do the necessary testing of the
product. So, the total engineer-month is 30.
13 January 2012 Made By Utpal Ray 7
8. Software Metrics
An example of “Measures, Measurements, Metrics,
Indicators” ( contd. )
And let’s assume, all together they found about 60 errors.
So, using all those measures mentioned above we can
compute a Metric, which could be ‘Errors found per
Engineer-Month’; and the value of that metric here is 2.
This metric can be used here as an indicator regarding how
efficient the test teams are or how good the product is.
For example, after introducing an automated testing tool, the
above metric may reach a value of ‘5’; which indicates the
effectiveness of the automated testing tool used by the test
team.
So, this Metric can be used as an indicator of the efficiency of
a project team.
13 January 2012 Made By Utpal Ray 8
9. Software Metrics
Process, Project and Product Metrics
- The process metrics are those metrics which are
concerned with Software Development Life Cycle (
SDLC ). They can be used to improve the process
efficiency of the SDLC. For example, the process
metric ‘Defect Rate’ – the amount of defects reaching
the customer can be used to improve the efficiency of
the Development and the Testing team. If ‘Defect rate’
is less, we know that the efficiency of the Development
and the Testing team is improving.
13 January 2012 Made By Utpal Ray 9
10. Software Metrics
Process, Project and Product Metrics (contd.)
- The project metrics are those metrics which are more
relevant to a project team. They can be used to
measure the efficiency of a project team or any other
tools being used by the team members. One example
of a project metric is ‘Errors found per engineer-
month’ which was mentioned before. This is a relevant
project metric for a test team.
13 January 2012 Made By Utpal Ray 10
11. Software Metrics
Process, Project and Product Metrics (contd.)
- The product metrics are those metrics which has more
meaning in the perspective of the software product
being developed. One of the example is, quality of the
developed product. Considering the fact that quality is
a subjective attribute, one needs a very good
understanding of the measures based on which the
quality metrics are computed.
13 January 2012 Made By Utpal Ray 11
12. Software Metrics
Private and Public Metrics
- The Private metrics are those metrics which are
collected by individual software professionals. They
are mostly used by any software professional to get an
insight regarding how is his productivity or any other
parameter of interests to him. For example, a test
engineer may keep ‘errors found in a week’ as a
private metric. Similarly, for a development engineer,
‘lines of code written in a week’ could be a private
metric of interests to him. Also, an IT professional may
keep ‘Number of new technology studied in a
month’ as a private metric.
13 January 2012 Made By Utpal Ray 12
13. Software Metrics
Private and Public Metrics ( contd. )
- The public metrics has more meaning on a overall team
basis. The public metrics can be computed depending
upon the private metrics made public by the
individual software professional. They are more
concerned with the project team rather than any
individual software professional. The examples are,
‘Errors found per engineer-month’, ‘Lines of code
written per engineer-month’, etc.
13 January 2012 Made By Utpal Ray 13
14. Software Metrics
Private and Public Metrics ( contd. )
- It may happen that some of the product metrics are
private metrics maintained by the individual engineer.
When these metrics are shared by all the engineer on
the team basis, those metrics can be combined to
develop a set of project metrics on a project level. In
addition to that, these project metrics can be
consolidated to create a set of process metrics. So, at
the end these process metrics become the public
metrics for the whole organization.
13 January 2012 Made By Utpal Ray 14
15. Software Metrics
Size Oriented Metrics
The size oriented metrics are those metrics, which are
computed keeping size of the software as main
consideration.
The size of the software are usually expressed in terms
of KLOC ( Kilo Line Of Code ).
The table on the following slide gives various project
data ( measures ) for three different projects executed
over 3 successive years.
Using those project data one can come out with
different size oriented metrics.
13 January 2012 Made By Utpal Ray 15
16. Software Metrics
Size Oriented Metrics ( contd. )
Project Line of Total Cost Doc Errors Defects No of
Name Code Effort in ( Lac Produc found found person
( LOC) person- of Rs ) ed ( in test in the s
month pages ) Cycle field
ALPHA 12,000 24 5 400 150 25 3
( 2002 )
BETA 24,000 50 12 1000 250 50 6
( 2003 )
GAMMA 18,000 33 8 800 175 30 5
( 2004 )
13 January 2012 Made By Utpal Ray 16
17. Software Metrics
Size Oriented Metrics ( contd. )
The four different metrics which can be computed from the
previous table are, Errors per KLOC, Defects per KLOC,
Cost per KLOC and Doc per KLOC.
Errors per Defects per Cost per Doc per
KLOC KLOC KLOC (Thou) KLOC
ALPHA 12.5 2 42 33
( 2002 )
BETA 10.4 2 50 41
( 2003 )
GAMMA 9.7 1.5 44 44
( 2004 )
13 January 2012 Made By Utpal Ray 17
18. Software Metrics
Size Oriented Metrics ( contd. )
If we try to evaluate these metrics, we may end up
finding one or two major indicators. These indicators
may point towards a better quality process which was
incorporated during those three years.
For example, both ‘Error rate’ and ‘Defect Rate’ were
gradually down as recent projects had been executed.
These may give indication that, whatever quality
process methodology was introduced during those
projects had given out results towards the right
direction.
13 January 2012 Made By Utpal Ray 18
19. Software Metrics
Function Oriented Metrics (A. J. Albrecht, 1979)
It’s a metric which gives the degree of functionality
delivered by a software system. Since
‘functionality’ can not be measured directly; an
indirect measurement is done by computing
Function-Point ( FP ).
FP is derived using an empirical relationship based
on countable ( direct ) measures of software’s
information domain and assessment of software
complexity.
FP can be computed by completing the table shown
in the next slide and then applying some formulae.
13 January 2012 Made By Utpal Ray 19
20. Software Metrics
Function Oriented Metrics ( contd. )
Measurement count Weighing Factor Sub-
Parameter Simple Average Complex total
No of User Inputs X 3 4 6 =
No of User Outputs X 4 5 7 =
No of User Inquiries X 3 4 6 =
No of Files X 7 10 15 =
No of External X 5 7 10 =
Interfaces
Count Total
13 January 2012 Made By Utpal Ray 20
21. Software Metrics
Function Oriented Metrics ( contd. )
The weighing factor mentioned in the previous table
depends upon the fact, whether that particular entry is
simple, average or complex.
FP can be given by the following formulae-
FP = Count-Total x [ 0.65 + 0.01 x ( Fi ) ]
Where, Fi ( i=1 to 14 ) are “complexity adjustment value”,
based on the responses of the following questions.
Each of the question is answered in a scale of 0 ( not
important or applicable ) to 5 ( absolutely essential ).
13 January 2012 Made By Utpal Ray 21
22. Software Metrics
Function Oriented Metrics ( contd. )
Complexity Adjustment Questions
1. Does the system require reliable Backup and
Recovery?
2. Are Data Communication required?
3. Are there any Distributed Processing function?
4. Is Performance critical?
5. Will the system run in an existing, heavily utilizied
Operational Environment ?
6. Does the system require Online Data Entry ?
7. Does the Online Data Entry require the input
transaction to be built over multiple screens or
operations ?
13 January 2012 Made By Utpal Ray 22
23. Software Metrics
Function Oriented Metrics ( contd. )
Complexity Adjustment Questions ( contd. )
8. Are the Master files updated Online?
9. Are the Inputs, Outputs, Inquiries, Files complex ?
10. Is the Internal Processing complex ?
11. Is the code designed to be Re-usable?
12. Are Conversion and Installation included in the
design ?
13. Is the system designed for Multiple Installation in
different organization ?
14. Is the application designed to facilitate Change and
Ease of Use by the user?
13 January 2012 Made By Utpal Ray 23
24. Software Metrics
Function Oriented Metrics ( contd. )
Once the FP is computed, the following metrics can be
derived using FP as a normalization value.
- Errors per FP
Defects per FP
Cost per FP
Doc per FP
FP per person-month
13 January 2012 Made By Utpal Ray 24
25. Software Metrics
The relationship between LOC and FP ( C. Jones, 1998 )
Prog Lang LOC/FP
Assembly Lang 320
C 128
COBOL 106
FORTRAN 106
PASCAL 90
C++ 64
VISUAL BASIC 32
POWEBUILDER 16
SQL 12
13 January 2012 Made By Utpal Ray 25
26. Software Metrics
Defect Removal Efficiency ( DRE )
It is a metric which benefits both in the project level
and process level. DRE is defined as;
DRE= E / ( E + D )
Where, E is the number of errors found before the
delivery of the software to the end user and D is
the number of defects found after delivery.
Ideally DRE should be 1 (means D is zero).
DRE can also be used within a project team, to
measure the team’s efficiency. In that context, E is
the total number of errors uncovered in the project
team; and D is the total number of defects
uncovered in the next stage.
13 January 2012 Made By Utpal Ray 26
27. Software Metrics
HOME TASK
1. Give 2 more examples of private metrics.
2. Think about 3 more metrics based on LOC.
3. Think about 2 more metrics based on FP.
4. Compute the FP for ‘SafeHome’ problem.
5. Compute the FP for the ‘Max Number’ prog.
13 January 2012 Made By Utpal Ray 27