Professional Documents
Culture Documents
Lecture 10
Software Size
and
Cost Estimation
Software Size Metrics: Summary
Requirement
Length Design
LOC
Code
Halstead’s
Function point
Software Feature point
Functionality
size
Use-case point
Object point
10
Length: Halstead’s Work /1
• Maurice Halstead’s Theory (1971~1979):
• Provide metrics for estimating software development effort and complexity.
• A program P is a collection of tokens, composed of two basic elements:
operands and operators
• Operands are variables, constants.
• Operators are defined operations in a programming language (language
constructs)
if … else a, b, x
+ -> = ; 100
main()
11
Length: Halstead’s Work /2
Number of distinct operators in the program (n1)
Number of distinct operands in the program (n2)
Total number of occurrences of operators in the
program (N1)
Total number of occurrences of operands in the
program (N2)
n2 = 3 N2 = 16
n1 = 20 N1 = 47
Program length: N = N1 + N2 = 63
Program Estimated length:
N^ =n 1
log 2 n +n
1 2 log 2 n 2 = 20 log 2 20 + 3log 2 3=91.1934
Example 1 (cont’d)
E=V*D= 20*16 * 63log223
2*3
E=V*D= 15177.7
Remaining Bugs
B=0.19
Example 2
Length: Halstead’s Work /7
Critics of Halstead’s work
Developed in the context of assembly languages and
too fine grained for modern programming
languages.
The notions of time to develop and remaining bugs
are arguable.
Unable to be extended to include the size for
specification and design.
Length: Code - Problems
One of the problems with text-based definition of
length is that the line of code measurement is
increasingly less meaningful as software
development turns to more automated tools, such
as:
Tools that generate code from specifications
Visual programming tools