Software Measurement &
Metrics
❑ Software size estimation is the process through which
we estimate the size of the software to be developed.
We use it to determine software cost.
❑ Hence, tight size estimates are critical for correct cost
estimates. Our project can run behind schedule or
exceed its budget if they are way off.
❑ So, most companies use several estimation methods
simultaneously. One of the most popular ones is LOC.
Software Size
❖ Line Of Estimation
Code(LOC)
❖ Function Count
❖ Halstead’s
Analysis
Line of
Code
Line of Code
• A line of code is any line of program text that is not a
comment or blank line, regardless of the number of
statements or fragments of statements on the line.
• This specifically includes all lines containing program
header, declaration, and executable and non-executable
statements”.
• This is the predominant definition for lines of code used
by researchers.
• By this definition, figure shown above (Ex) has 17 LOC
Line of Code
• LOC is programming language dependent .
• LOC need to be estimated before design.
• Not universally accepted standard
Advantages & Disadvatages
Advantages
• Easy
• For counting no of assembly lines (Code)
•Direct estimation metric
Disadvantage
•Technology Dependent.
Function Point
Measures
Halstead’s Software
Science
Halstead’s Software
Science
Size of
Vocablary
Length of
Program
Counting Rules For C
Language
Other
Measures
Estimated Program
Length
Control flow Graph
The control flow of a program can be analyzed using a
graphical representation known as flow graph.
• The flow graph is a directed graph in which nodes are
either entire statements or fragments of a statement, and
edges represents flow of control.
• If i and j are nodes in the program graph ,there is an edge
from node i to node j , if the statement (fragment)
corresponds to node j can be executed immediately after
the statement corresponding to node i.
• Flow graph can easily be generated from the code of
any problem
Cyclomatic
Complexity
3 Methods used for calculation of Cyclomatic Complexity
1