Chapter 1 Basics of Software Metrics
Chapter 1 Basics of Software Metrics
Page 4
Neglect of Measurement in Software Engineering
Page 5
Why Do We Measure?
• To indicate the quality of the product
• To assess the productivity of the people who
produce the product
• To assess the benefits derived from new software
engineering methods and tools
• To form a baseline for estimation
• To help justify requests for new tools or additional
training
Page 8
Process Metrics & Software Process
Improvement
• To improve any process, the rational way is:
– Measure Specific attributes of the process
Page 9
Factors Affecting Software Quality
Page 10
How to Measure Effectiveness of a Software
Process
• We measure the effectiveness of a software process indirectly
• We derive a set of metrics based on the outcomes that can be
derived from the process
• Outcomes include
– Errors uncovered before release of the software
– Defects delivered to and reported by end-users
– Work products delivered (productivity)
– Human effort expended
– Calendar time expended
– Conformance to schedule
Page 11
Project Metrics (1)
• Project Metrics are the measures of Software Project and
are used to monitor and control the project.
Page 13
Product metrics
Page 16
Software quality model
Page 17
Normalization of Metrics
• For normalization we have 2 ways
– Size-Oriented Metrics
– Function Oriented Metrics
Page 18
Size-Oriented Metrics
Page 19
• From the above data, simple size oriented metrics can be
developed for each Project
• Errors per KLOC
• $ per KLOC
• Pages of documentation per KLOC
• Errors per person-month
• LOC per person-month
• Advantages of Size Oriented Metrics
– LOC can be easily counted
– Many software estimation models use LOC or KLOC as input.
• Disadvantages of Size Oriented Metrics
– LOC measures are language dependent, programmer dependent
– Their use in estimation requires a lot of detail which can be difficult to
achieve.
• Useful for projects with similar environment Page 20
Function-Oriented Metrics
Page 21
Steps In Calculating FP
Page 23
Software information domain values
• Number of user inputs
• Number of user outputs
• Number of user inquiries
• Number of files
• Number of external interfaces
Page 24
Rate Complexity Factors
Page 25
Complexity Adjustment Factors
1. Does the system require reliable backup and recovery?
2. Are data communications required?
3. Are there distributed processing functions?
4. Is performance critical?
5. Will the system run in an existing, heavily utilized
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?
Page 26
Complexity Adjustment Factors(Continue…)
Page 27
Complexity Adjustment Value
Page 28
Example of Function-Oriented Metrics
• Errors per FP • Productivity = Functionality / Effort
= FP / person-month
• Defects per FP
• Quality = Errors / Functionality
• Payment per FP = Errors / FP
• Cost = $ / FP
• Pages of documentation per FP
• Documentation = pages / FP
• FP per person month
Page 29
FP Characteristics
Page 30
Qualities of a good metric
• Simple, precisely definable: so that it is clear how the
metric can be evaluated;
• Objective, to the greatest extent possible;
• Easily obtainable (i.e. At reasonable cost);
• Valid: the metric should measure what it is intended to
measure; and
• Robust: relatively insensitive to (intuitively)
Insignificant changes in the process or product.
Page 31
Types of Software Measurements
• Direct measures: Easy to collect
– Size of source code (measured by LOC)
– Schedule of the testing process (measured by elapsed time in
hours)
– Number of defects discovered (measured by counting defects)
– Time a programmer spends on a project (measured by months
worked): Effort
– Memory size
– Execution speed
– Cost
Page 32
Types of Software Measurements (2)
• Indirect measures/ derived
– More difficult to assess & can be measured indirectly only.
Page 33
Measurement for Prediction
• For allocating the appropriate resources to the project, we need
to predict the effort, time, and cost for developing the project.
Page 34
Measurement Scales and Scale Types
• Nominal
• Ordinal
• Interval
• Ratio
• Absolute
Page 35
Nominal scale type
• This is the most primitive form of measurement.
Page 36
Ordinal scale
• Augments nominal scale with ordering information.
• Three major characteristics
– Empirical relation system consists of classes that are ordered
with respect to the attribute
– Any mapping preserving the ordering (i.e., a monotonic
function) is acceptable
– Numbers represent ranking only, so arithmetic operations have
no meaning
• Set of admissible transformations is set of all monotonic
mappings
Page 37
Interval scale
• Captures information about size of intervals that
separate classes.
• Three characteristics
Page 39
Absolute scale
• Most restrictive in terms of admissible transformations
• For any two measures, M and M‟, there's only one admissible
transformation (identity transformation), since there's only one way
to make the measurement.
• 4 characteristics
– Measurement is made simply by counting the number of
elements in the entity set
– Attribute always takes the form of “number of occurrences of x
in the entity”
– Only one possible measurement mapping, namely the actual
count
– All arithmetic analysis of the resulting count is meaningful.
• Example: lines of code in a module is an absolute scale measure.
Page 40
Question?