Internal Product Attribute Measurement: Size
Internal Product Attribute Measurement: Size
Internal Product Attribute Measurement: Size
Measurement: Size
Aspect of Software Size
• Each product development described in size.
• Measuring the size of the software product
should be straight forward, simple , consistent
with measurement theory principles.
• Different attribute capture software size:
– Length-size of product
– Functionality-measure the functions supplied by
the product to the user
– Complexity-interpreted in different way on user
perspective
• Problem complexity - computational complexity
• Algorithmic complexity - complexity of the algorithm
• Structural complexity - measure the structure of the
software used to implement
• Cognitive complexity - measure the effort required to
understand the software
1. Length
7
Adv & Disadv
• Advantages of LOC
– Simple and automatically measurable
– Correlates with programming effort (& cost)
• Disadvantage of LOC
– Language dependability
– Not available for early planning
– Developers’ skill dependability
Halstead Metrics
• Maurice Halstead’s Theory (1971~1979):
• A program P is a collection of tokens,
composed of two basic elements: operands
and operators ,
• Operands are variables, constants, addresses
• Operators are defined operations in a
programming language
(language constructs)
Halstead’s Software Metrics
int 4 sort 1
() 5 x 7
, 4 n 3
[] 7 i 8
if 2 j 7
< 2 save 3
; 11 im1 3
for 2 2 2
= 6 1 3
- 1 0 1
<= 2 - -
++ 2 - -
return 2 - -
{} 3 - -
• T = 610 seconds
• V* = 11.6
Eg:2
if (x>5)
{
x= x + 2;
if(x<7)
{
x=0;
}
}
• Total Length (N)
N = N1 + N2 = 15 + 9 = 24
• Vocabulary (n)
n = n1 + n2 = 9 + 5 = 14
• Estimated Length = 1.67
• Volume = N log2 n
= 24 log2 14
= 24 x log10 14 / 0.3010
= 24 x 3.807 = 91.36
• D = N1/ 2 x N2 / n2
• = 9/2 x 9/5 = 81 /10 = 8.1
• Effort = V *D
• = 91.36 x 8.1 = 740.016
Halstead’s Metrics
• Advantages
– easy to compute (scanner)
– Predict maintenance effort
– Predict rate of error
– Useful in reporting and scheduling projects
– Simple to calculate
– applicable for all languages
– empirical studies: good measure for complexity
• Disadvantages
– language dependent
2. Reuse
• Program generator , fourth generation language , windowing
environment etc. facilitated the reuse of code.
• Reuse include specification , design , code, documentation
,helps to improve productivity and quality
• Reuse measure how much of a product was copied or
modified.
• Measure extent of reuse
– Reused verbatim : reuse without an changes
– Slightly modified:25% of lines are changed
– Extensively modified:25% or more lines are modified.
– New: none of the code comes form previously
constructed.
Reuse Repository
3. Functionality
• There are 3 method to measure the
functionality:
• Albrecht’s Approach
• COCOMO-II
• Demarco’s Approach
Albrecht’s Approach
• In 1979 by A.J Albrecht , then of measuring software
size and productivity.
• The first function-oriented metrics was proposed by
Albrecht(1979~1983) who suggested a productivity
measurement approach called the Function Point
(FP) method.
• Function points (FPs) measure the amount of
functionality in a system based upon the system
specification.
• Ultimate measure of software productivity is number
of function a development team can produce.
• Quantifies the size and complexity is measured by
input , output, inquires , input files and interfaces
• Function Point (FP) is a weighted measure of
software functionality.
• FP is computed in two steps:
– 1) Calculating Unadjusted Function point
Count (UFC).
– 2) Multiplying the UFC by a Technical Factor
count(TFC)
What are function points?
External System Boundary
Inquiries
Internal Files
External
Outputs
External
Interfaces
External Inputs
Example:- Spell Checker
• Covert specification to Diagram
Example:
• Given,
I/P: 5, O/P: 3,Inquiry: 2,Internal logical: 2
External Interface: 1
Complexity of Data/Transaction Function
Complexity of Data/Transaction
Function
FTR RET DET Compl Value Total
exity
EI 10 5 6 * 5 30
EO 7 8 7 * 3 21
EQ 5 6 6 * 2 12
ILF 9 7 10 * 2 20
ELF 7 8 7 * 1 7
UFC 90
• Assume all complexity weights are 5.
• 14*5 = 70
• VAF = 1.35
• FP = UFC * VAF
• = 90 * 1.35
• FP = 121.5
• our program is written In C,
• Then SLOC is: 17982 lines (121.5 * 148)
OBJECT POINT
Assumed 0%
reuse