You are on page 1of 11

1

Software Testing, 2nd edition


NARESH CHAUHAN

© Oxford University Press 2017. All rights reserved.


2

Chapter 10
Software Metrics

© Oxford University Press 2017. All rights reserved.


Objectives
 Software projects need measurement to quantify things for better
1
monitoring and control over software development

 Software metrics are quantitative measurements

 Various types of software metrics

 Entities to be measured for the software: process, product, and resource

 Recognition of attributes

 Line-of-code metrics

 Halstead metrics

 Function point analysis metrics


© Oxford University Press 2017. All rights reserved.
Need of Software Measurement
2

 Understanding

 Control

 Improvement

© Oxford University Press 2017. All rights reserved.


Software Metrics
3

 A quantitative measure of the degree to which a system component or


process possesses a given attribute.

 Classification of Software Metrics


 Product vs. Process Metrics
 Objective vs. Subjective Metrics
 Primitive vs. Computed Metrics
 Private vs. Public Metrics

© Oxford University Press 2017. All rights reserved.


Entities to be Measured 4
 Processes

 Product

 Resource

 Attributes of entities

 Internal Attributes

 External Attributes

© Oxford University Press 2017. All rights reserved.


Size Metrics 5

 Line of Code (LOC)

 Token Count (Halstead Product Metrics)

Program Vocabulary
n = n1 + n2
where n = program vocabulary
n1 = number of unique operators
n2 = number of unique operands
Program Length
N = N1 + N2
where N = program length
N1 = all operators appearing in the implementation
N2 = all operands appearing in the implementation
© Oxford University Press 2017. All rights reserved.
Size Metrics (contd.) 6

Program Volume

V = N log2 n

where V = Program volume

N = Program length

n = Program vocabulary

© Oxford University Press 2017. All rights reserved.


Function Point Analysis 7
 Determine the type of project.

 Identify the counting scope and the application boundary.

 Identify all data functions (internal logical functions and external interface files)
and their complexity.

 Identify all transactional functions (external inputs, external outputs and the
external queries) and their complexity.

 Determine the unadjusted function point count (UFP).

 Determine the value adjustment factor, which is based on the 14 general


system characteristics (GSCs).

 Calculate the adjusted function point count (AFP).


© Oxford University Press 2017. All rights reserved.
Function Point Analysis 8

© Oxford University Press 2017. All rights reserved.


Function Point Analysis 9

VAF = (TDI x 0.01 ) + 0.065


AFP = UFP x VAF
© Oxford University Press 2017. All rights reserved.

You might also like