You are on page 1of 29

SWE505 - Software Metrics

Scales of measurement
Definitions
• Measure - quantitative indication of the extent,
amount, dimension, capacity, or size of some
attribute of a product or process.
• Measurement - the act of determining a measure
• Metric - a quantitative measure of the degree to
which a system, component, or process possesses a
given attribute (IEEE)
Measurement - Uses
• Measurement helps us to understand
– Makes the current activity visible
– Measures establish guidelines
• Measurement allows us to control
– Predict outcomes and change processes
• Measurement encourages us to improve
– When we hold our product up to a measuring stick, we can
establish quality targets and aim to improve
Without metrics in software

• How big is the program?


– Huge!!
• How close are you to finishing?
– We are almost there!!
• How many errors you have made?
- Very few!!.........
• Can you make subjective decisions from these
answers?...
Measurement - Scales
• Nominal Scale
• Ordinal Scale
• Interval Scale
• Ratio Scale
• Absolute Scale

5
Nominal Scale
• Items are assigned to groups.
• No ordering.
• No number is generated.

6
Ordinal Scale
• Ordering.
• Higher number represents higher value (Usually).
• numbers are used only for ordering.

7
Interval Scale
• Used when interval that separates groups is known.
• can add and subtract
• But can’t multiply and divide

8
Ratio Scale
• Ordering, interval and ratio.
• Multiplication and division possible.
• Value zero represents the absence of value measured.

9
Absolute Scale
• Counting
• Can perform all arithmetic operations

10
Primary Scales of Measurement
Scale
Nominal Numbers Finish
Assigned
7 8 3
to Runners

Ordinal Rank Order Finish


of Winners
Third Second First
place place place

Interval Performance
Rating on a 8.2 9.1 9.6

0 to 10 Scale
15.2 14.1 13.4
Ratio Time to
Finish, in
Measurement

12
In software industry…
1. Number of project engineers in a project
development
2. CMM Maturity levels
1. Initial
2. Repeatable
3. Defined
4. Managed
5. Optimizing
3. Types of errors (Logical / Syntax)
13
In software industry…
4. Recursive or Non – Recursive programs
5. Logs of events (on date basis)
6. Number of methods in a class
7. Skill level of programmer
8. Given a program, find whether it is a
system software or application software
9. McCabe’s Complexity

14
In software industry…
1. Number of project engineers in a project
development - Absolute
2. CMM Maturity levels - Ordinal
1. Initial
2. Repeatable
3. Defined
4. Managed
5. Optimizing
3. Types of errors (Logical / Syntax) - Nominal
15
In software industry…
4. Recursive or Non – Recursive programs - Nominal
5. Logs of events (on date basis) - Interval
6. Number of methods in a class - Absolute
7. Skill level of programmer - Ordinal
8. Given a program, find whether it is a system software
or application software - Nominal
9. McCabe’s Complexity - Interval

16
Software – what to measure
• 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

17
Software – How to measure

• Two Kinds of Measurements:


1. Direct measures
 Measurement
2.Indirect measures
 Calculation

18
Metrics - Example

• Direct Measurements in SE:


– Length of source code
– Duration of a phase
– Number of defects found during phase
– Time a programmer spends on a project

19
Metrics - Example

• Indirect Measurements in SE:


•Programmer productivity
(LOC/work-months of effort)
•Module defect density
(number of defects/module size)
•System spoilage
(effort spent fixing faults/total project effort)

20
Product Metrics
• Product refers to the actual software system,
documentation and other deliverables.
• We examine the product and measure a number of
aspects:
– Size
– Functionality offered
– Cost
– Various Quality Attributes
Process Metrics
• Involves analysis of the way a product is developed.

• What lifecycle do we use?


• What deliverables are produced?
• How are they analysed?
• How can the process help to produce products
faster?
• How can the process help to produce better
products?
Resource Metrics

• Involves analysis of the people developing a


product
• How fast do they work?
• How much bugs do they produce?
• How many sick-days do they take?
• Very controversial. People do not like being
turned into numbers.
Metrics: requirements phase
• Number of requirements that change during
the rest of the software development process
– if a large number changed during specification,
design, …, something is wrong in the requirements
phase
• Metrics for rapid prototyping
– Are defect rates, mean-time-to-failure useful?
– Knowing how often requirements change?
– Knowing number of times features are tried?

24
Metrics: specification phase
• Size of specifications document
– may predict effort required for subsequent
products
– What can be counted?
• Number of items in the data dictionary
– number of files
– number of data items
– number of processes

11/30/99 CS 406 Testing 25


Metrics: specification phase
• Cost
• Duration
• Effort
• Quality
– number of faults found during inspection

26
Metrics: design phase
• Number of modules (measure of size of target
product)
• Fault statistics
• Module cohesion
• Module coupling
• Cyclomatic complexity
• Fan-in, fan-out

27
Metrics: implementation and
integration phase
• Total number of test cases
• Number of tests resulting in failure
• Fault statistics
– Total number of faults
– Types of faults
• misunderstanding the design
• lack of initialization
• inconsistent use of variables
• Statistical-based testing:
– zero-failure technique

28
Metrics: maintenance & inspections

• Purpose: measure effectiveness of inspections


– may reflect deficiencies of the development team,
quality of code
• Measure fault density
– Faults per page - specs and design inspection
– Faults per KLOC - code inspection
– Fault detection rate - #faults / hour
– Fault detection efficiency - #faults/person-hour

29

You might also like