Upcoming SlideShare
×

# Software Metrics

• 806 views

Software Metrics …

Software Metrics

Ehsan hessami

More in: Technology
• Comment goes here.
Are you sure you want to
Be the first to comment
Be the first to like this

Total Views
806
On Slideshare
0
From Embeds
0
Number of Embeds
0

Shares
23
0
Likes
0

No embeds

### Report content

No notes for slide

### Transcript

• 1. Software Metrics
Ehsan hessamiIslamic Azad University OF Qazvin
• 2. What ?
Software measurement is the mapping of symbols to objects
• 3. What ?
Software measurement is the mapping of symbols to objects
Why ?!!!!!!
quantify some attribute of
the objects
• 4. Criteria
• 5. Criteria
A metric must allow differententities
to be distinguished.
A metric must obey a representation
condition
• 6. Criteria…
Each unit of the attribute must contribute an equivalent amount to the metric
Different entities can have the
sameattributevalue
• 7. Many times
the attribute of interest is not
directly measurable .
An indirect measure involves a
measure and a prediction
formula
• 8. Example
density
mass
volume
• 9. Software Measurement Theory
2 Kinds :
numerical relation system
empirical relation system
• 10. The empirical relation system
two parts:
A set of entities, E
A set of relationships, R
• 11. The numerical relation system
two parts:
A set of entities, N
EXP : Integers , Real
A set of relationships, P
EXP : Less , Equal
• 12. Mapping
M, maps (E, R) to (N, P)
related in the empirical system
related in the numberical system
• 13. Mapping
M, maps (E, R) to (N, P)
related in the empirical system
related in the numberical system
EXP :
x rel y if M(x) rel M(y)
• 14. EXP . Mapping
measure, BIG
X height=< Y height and X weight =< Y weight
• 15. MONOTONICITY
IF increase the value of attribute ,
the object Will not Reverse.
• 16. MONOTONICITY
IF increase the value of attribute ,
The object will not Reverse.
Exp :
2
y = X
Monotonicity
X>0 And X<5
2
y = 5x - x
Increaes
X>=5 And X<10
Decrease
Not Monotonicity
• 17. MEASUREMENT SCALES
There are five different scale types :
nominal
ordinal
interval
ratio
absolute
• 18. Normal
This type basically assigns
numbers or symbols without
regard to any quantity
• 19. Normal
This type basically assigns
numbers or symbols without
regard to any quantity
EXP:
• 20. Ordinal
there is an implied ordering of
the entities by the numbers
assigned to the entity
• 21. Ordinal
there is an implied ordering of
the entities by the numbers
assigned to the entity
EXP:
First – Second
Not Equal
1
Second - third
2
3
• 22. Interval
the amount of the difference
is constant
• 23. Interval
the amount of the difference
is constant
EXP:
converting from a Celsius to
a Fahrenheit
Formule :
9.5 x +32
• 24. Ratio
the amount of the difference
is constant and Well Zero
• 25. absolute
The absolute is a counting scale measure
EXP:
• 26. Product Metrics
Product metrics are metrics that
can be calculated from the
document independent of how
it was produced .
The most basic metric for size is
thelinesof code metric .
• 27. McCABE’S CYCLOMATIC NUMBER
introduced in 1976 .
Use the Gragh Theory :
C = E – N + 2
C = Cyclomatic number .
E = number of Edges .
N = number of Eodes .
• 28. McCABE’S CYCLOMATIC NUMBER
EXP :
5
1
4
3
2
E = 11
N = 8
C = 11 – 8 + 2
C = 5
• 29. McCABE’S CYCLOMATIC NUMBER
Calculating the cyclomatic number from control flow graphs is time-consuming .
McCabe found a more direct
Method of calculating his measure .
• 30. McCABE’S CYCLOMATIC NUMBER
Restriction :
IN source Code :
1 decision
IF , For , While
Case or multiple Branch
1 less decision
• 31. McCABE’S CYCLOMATIC NUMBER
Restriction … :
Control flow graphs are required to have a distinct starting node and a distinct stoppingnode
Formula :
C = D + 1
D = Sum of Decisions
• 32. Example
E = 2
D = 1
E = 2
D = 1
E = 3
D = 2
D = 4
C = 5
Complexity
• 33. Threshold Value
If the Complexity is greater than 10
, efforts should be made to reduce the value or to split the module
He did his work in the late
1960s and 1970s.
He empirically looked for measures
of intrinsic size
variables
Operands
constants
commas
parentheses
Operator
arithmetic operators
brackets
• 36. Basic Measures—η1 and η2
η = η1 + η2
η =
total count of unique tokens
Count of unique Operator
η1 =
Count of unique Operands
η2 =
• 37. Basic Measures—η1 and η2
Exp :
z = 0;
While x> 0
z = z + y ;
x = x + 1;
End –while ;
Print(z) ;
Operator
= ; > + - Print () While-endwhile
Operand
z x y 0 1
η1 =8 η2 = 5 η = 13
• 38. Length(N)
N = N1 + N2
N =
total count of tokens
Count of Operator
N1 =
Count of Operands
N2 =
• 39. Length
EXP :
Operators
= 3
; 5
While 1
> 1
+ 1
- 1
Print 1
() 1
Operands
Z 4
X 3
Y 2
0 2
1 1
z = 0;
While x> 0
z = z + y ;
x = x + 1;
End –while ;
Print(z) ;
N = N1 + N2 = 14+12 = 26
• 40. Estimate of the Length(est N)
η1
η2
est N = η1*log + η2*log
2
2
• 41. Estimate of the Length(est N)
η1
η2
est N = η1*log + η2*log
2
2
Exp :
η1=8 , η2=5
est N = 8*3 +5*2.32 = 35.6
• 42. Volume ( V )
Volume = number of bits
(η1+ η2)
V = N * Log
2
• 43. Volume ( V )
Volume = number of bits
(η1+ η2)
V = N * Log
2
Exp:
N = 26 , η1=8 , η2=5
13
V = 26 * Log = 96.2
2
• 44. Potential Volume, V*
Potential Volume = Min number of bits
V* = (2 + η2*)log
(2+ η2*)
2
η2* = The Minimal number of Operands
• 45. Other Parameter
Implementation Level :
L = V* / V
• 46. Other Parameter
Implementation Level :
L = V* / V
Effort :
E = V / L
unit of Effors is emd
• 47. Other Parameter
Implementation Level :
L = V* / V
Effort :
E = V / L
unit of Effors is emd
Time :
T = E / S
18 emd / sec
• 48. HENRY–KAFURA INFORMATION FLOW
measure the intermodule complexity of source code .
HK = Weight *(out * in )
i
i
i
i
In = into the module
i
Out = out the module
i
Weight = weight the module
i
• 49. HENRY–KAFURA INFORMATION FLOW
Exp :
Weight = 1
HK = 1110