Structural Complexity of A Software Product
Structural Complexity of A Software Product
Chapter 6:
Measuring Internal
Product Attributes:
Structural Complexity
compiled by Samuel Ashagrre
SOFTWARE METRICS 1
Software Complexity Metrics
How to Represent Program
Structure?
Software structure can have 3 attributes:
• Control-flow structure: Sequence of
execution of instructions of the program.
Flowgraph (model)
v(G) = 1 + d
v(G) = 1 + 2 = 3
Example: Graph Based
v(G) = 16 -13 + 2 = 5
or
v(G) = 4 +1 = 5
Example 2
■ Determine cyclomatic
complexity for the
following flow diagram:
v = 1+d
v = 1+2 = 3
or
v=e-n+2
v = 11 -10 + 2 = 3
Example 3A
■ Two functionally equivalent programs that are
coded differently could have different complexities
X = coupling violation
Coupling: Class Relationships