2. PRESENTATION
Software Design Complexity
Abdul Sattar
Sarmad
Farooq
Liaqat Ali
Muhammad
ArsalanSoftware Engineering
GC University Faisalabad (Layyah Campus)
Group Members
Abdul Sattar Sarmad Farooq Liaqat Ali Muhammad Arsalan
Software Engineering Software Design Complexity
3. GC University Faisalabad (Layyah Campus)
Abdul Sattar Sarmad Farooq Liaqat Ali Muhammad Arsalan
Software Engineering Software Design Complexity
What is A Software Design?
4. GC University Faisalabad (Layyah Campus)
Abdul Sattar Sarmad Farooq Liaqat Ali Muhammad Arsalan
Software Engineering Software Design Complexity
What is A Software Design?
Software design is a process to
transform user requirements into
some suitable form, which helps
the programmer in software coding
and implementation.
5. GC University Faisalabad (Layyah Campus)
Abdul Sattar Sarmad Farooq Liaqat Ali Muhammad Arsalan
Software Engineering Software Design Complexity
6. GC University Faisalabad (Layyah Campus)
Abdul Sattar Sarmad Farooq Liaqat Ali Muhammad Arsalan
Software Engineering Software Design Complexity
7. GC University Faisalabad (Layyah Campus)
Abdul Sattar Sarmad Farooq Liaqat Ali Muhammad Arsalan
Software Engineering Software Design Complexity
The term complexity stands for state of
events or things, which have multiple
interconnected links and highly complicated
structures. In software programming, as the
design of software is realized, the number of
elements and their interconnections gradually
emerge to be huge, which becomes too
difficult to understand at once.
8. GC University Faisalabad (Layyah Campus)
Abdul Sattar Sarmad Farooq Liaqat Ali Muhammad Arsalan
Software Engineering Software Design Complexity
9. GC University Faisalabad (Layyah Campus)
Abdul Sattar Sarmad Farooq Liaqat Ali Muhammad Arsalan
Software Engineering Software Design Complexity
Halstead's Complexity Measures
10. GC University Faisalabad (Layyah Campus)
Abdul Sattar Sarmad Farooq Liaqat Ali Muhammad Arsalan
Software Engineering Software Design Complexity
Halstead's Complexity Measures
Halstead measures were introduced in 1977
According to Halstead, “A computer
program is an implementation of an algorithm
considered to be a collection of tokens which
can be classified as either operators or
operands”
11. GC University Faisalabad (Layyah Campus)
Abdul Sattar Sarmad Farooq Liaqat Ali Muhammad Arsalan
Software Engineering Software Design Complexity
Halstead's Complexity Measures
Developed to measure a program module
complexity directly from source code.
Measures complexity directly from the
operators and operands.
They are most often used as a
maintenance metric.
12. GC University Faisalabad (Layyah Campus)
Abdul Sattar Sarmad Farooq Liaqat Ali Muhammad Arsalan
Software Engineering Software Design Complexity
Halstead's Complexity Measures
Number of Operators and Operands
Halstead´s metrics is based on
interpreting the source code as a
sequence of tokens and classifying each
token to be an operator or an operand.
13. GC University Faisalabad (Layyah Campus)
Abdul Sattar Sarmad Farooq Liaqat Ali Muhammad Arsalan
Software Engineering Software Design Complexity
Halstead's Complexity Measures
14. GC University Faisalabad (Layyah Campus)
Abdul Sattar Sarmad Farooq Liaqat Ali Muhammad Arsalan
Software Engineering Software Design Complexity
Halstead's Complexity Measures
15. GC University Faisalabad (Layyah Campus)
Abdul Sattar Sarmad Farooq Liaqat Ali Muhammad Arsalan
Software Engineering Software Design Complexity
16. GC University Faisalabad (Layyah Campus)
Abdul Sattar Sarmad Farooq Liaqat Ali Muhammad Arsalan
Software Engineering Software Design Complexity
Cyclomatic Complexity Measures
17. GC University Faisalabad (Layyah Campus)
Abdul Sattar Sarmad Farooq Liaqat Ali Muhammad Arsalan
Software Engineering Software Design Complexity
Cyclomatic Complexity Measures
A program consists of statements.
Some of them are decision-making which change
the flow of the program.
Comparing two Programs with the Same Size.
18. GC University Faisalabad (Layyah Campus)
Abdul Sattar Sarmad Farooq Liaqat Ali Muhammad Arsalan
Software Engineering Software Design Complexity
Cyclomatic Complexity Measures
19. GC University Faisalabad (Layyah Campus)
Abdul Sattar Sarmad Farooq Liaqat Ali Muhammad Arsalan
Software Engineering Software Design Complexity
Cyclomatic Complexity Measures
McCabe, in 1976.
The purpose was to quantify complexity of a
given software.
A graph driven model based on decision-
making statements( if-else, do-while, repeat-
until, switch-case and goto statements ).
20. GC University Faisalabad (Layyah Campus)
Abdul Sattar Sarmad Farooq Liaqat Ali Muhammad Arsalan
Software Engineering Software Design Complexity
Cyclomatic Complexity Measures
21. GC University Faisalabad (Layyah Campus)
Abdul Sattar Sarmad Farooq Liaqat Ali Muhammad Arsalan
Software Engineering Software Design Complexity
Cyclomatic Complexity Measures
Process to make flow control graph:
i. Break program by decision-making statements.
ii. Create nodes representing each of these nodes.
Connect nodes as follows:
If control can branch from block i to block j? Draw an arc.
From exit node to entry node, Draw an arc.
22. GC University Faisalabad (Layyah Campus)
Abdul Sattar Sarmad Farooq Liaqat Ali Muhammad Arsalan
Software Engineering Software Design Complexity
Cyclomatic Complexity Measures
23. GC University Faisalabad (Layyah Campus)
Abdul Sattar Sarmad Farooq Liaqat Ali Muhammad Arsalan
Software Engineering Software Design Complexity
Cyclomatic Complexity Measures
To calculate Cyclomatic complexity of a program
module, we use the formula
Cyclomatic Complexity = e – n +2
Where
e is total number of edges
n is total number of nodes
24. GC University Faisalabad (Layyah Campus)
Abdul Sattar Sarmad Farooq Liaqat Ali Muhammad Arsalan
Software Engineering Software Design Complexity
Cyclomatic Complexity Measures
25. GC University Faisalabad (Layyah Campus)
Abdul Sattar Sarmad Farooq Liaqat Ali Muhammad Arsalan
Software Engineering Software Design Complexity
Cyclomatic Complexity Measures
`
Statement 1
Expression
1
Statement 2 Statement 3
Statement 4
Statement 5
Expression
2
Statement 6
n1
n2
n4n3
n5
n6
n7
n8
Statement 1
If Expression 1
Statement 2
else
Statement 3
e1
e2
e6
e7
e3
e8
e10
e9
e5e4
Y N
Statement 4
do
Statement 5
While expression 2
Statement 6
Y
N
26. GC University Faisalabad (Layyah Campus)
Abdul Sattar Sarmad Farooq Liaqat Ali Muhammad Arsalan
Software Engineering Software Design Complexity
Cyclomatic Complexity Measures
27. GC University Faisalabad (Layyah Campus)
Abdul Sattar Sarmad Farooq Liaqat Ali Muhammad Arsalan
Software Engineering Software Design Complexity
Cyclomatic Complexity Measures
`
Statement 1
Expression
1
Statement 2 Statement 3
Statement 4
Statement 5
Expression
2
Statement 6
n1
n2
n4n3
n5
n6
n7
n8
Statement 1
If Expression 1
Statement 2
else
Statement 3
e1
e2
e6
e7
e3
e8
e10
e9
e5e4
Y N
Statement 4
do
Statement 5
While expression 2
Statement 6
Y
N
28. GC University Faisalabad (Layyah Campus)
Abdul Sattar Sarmad Farooq Liaqat Ali Muhammad Arsalan
Software Engineering Software Design Complexity
Cyclomatic Complexity Measures
`
29. GC University Faisalabad (Layyah Campus)
Abdul Sattar Sarmad Farooq Liaqat Ali Muhammad Arsalan
Software Engineering Software Design Complexity
Cyclomatic Complexity Measures
`
Statement 1
Expression
1
Statement 2 Statement 3
Statement 4
Statement 5
Expression
2
Statement 6
n1
n2
n4n3
n5
n6
n7
n8
Statement 1
If Expression 1
Statement 2
else
Statement 3
e1
e2
e6
e7
e3
e8
e10
e9
e5e4
Y N
Statement 4
do
Statement 5
While expression 2
Statement 6
Y
N
30. GC University Faisalabad (Layyah Campus)
Abdul Sattar Sarmad Farooq Liaqat Ali Muhammad Arsalan
Software Engineering Software Design Complexity
Umer Chandia
There are
8 nodes
31. GC University Faisalabad (Layyah Campus)
Abdul Sattar Sarmad Farooq Liaqat Ali Muhammad Arsalan
Software Engineering Software Design Complexity
Cyclomatic Complexity Measures
`
Statement 1
Expression
1
Statement 2 Statement 3
Statement 4
Statement 5
Expression
2
Statement 6
n1
n2
n4n3
n5
n6
n7
n8
Statement 1
If Expression 1
Statement 2
else
Statement 3
e1
e2
e6
e7
e3
e8
e10
e9
e5e4
Y N
Statement 4
do
Statement 5
While expression 2
Statement 6
Y
N
32. GC University Faisalabad (Layyah Campus)
Abdul Sattar Sarmad Farooq Liaqat Ali Muhammad Arsalan
Software Engineering Software Design Complexity
Cyclomatic Complexity Measures
`
Nodes(n) = 8
33. GC University Faisalabad (Layyah Campus)
Abdul Sattar Sarmad Farooq Liaqat Ali Muhammad Arsalan
Software Engineering Software Design Complexity
Cyclomatic Complexity Measures
`
Statement 1
Expression
1
Statement 2 Statement 3
Statement 4
Statement 5
Expression
2
Statement 6
n1
n2
n4n3
n5
n6
n7
n8
Statement 1
If Expression 1
Statement 2
else
Statement 3
e1
e2
e6
e7
e3
e8
e10
e9
e5e4
Y N
Statement 4
do
Statement 5
While expression 2
Statement 6
Y
N
34. GC University Faisalabad (Layyah Campus)
Abdul Sattar Sarmad Farooq Liaqat Ali Muhammad Arsalan
Software Engineering Software Design Complexity
Ahmad Yaqoob
There are
10 edges
35. GC University Faisalabad (Layyah Campus)
Abdul Sattar Sarmad Farooq Liaqat Ali Muhammad Arsalan
Software Engineering Software Design Complexity
Cyclomatic Complexity Measures
`
Statement 1
Expression
1
Statement 2 Statement 3
Statement 4
Statement 5
Expression
2
Statement 6
n1
n2
n4n3
n5
n6
n7
n8
Statement 1
If Expression 1
Statement 2
else
Statement 3
e1
e2
e6
e7
e3
e8
e10
e9
e5e4
Y N
Statement 4
do
Statement 5
While expression 2
Statement 6
Y
N
36. GC University Faisalabad (Layyah Campus)
Abdul Sattar Sarmad Farooq Liaqat Ali Muhammad Arsalan
Software Engineering Software Design Complexity
Cyclomatic Complexity Measures
`
Edges(e) = 10
Nodes(n) = 8
37. GC University Faisalabad (Layyah Campus)
Abdul Sattar Sarmad Farooq Liaqat Ali Muhammad Arsalan
Software Engineering Software Design Complexity
Cyclomatic Complexity Measures
To calculate Cyclomatic complexity of a program
module, we use the formula
Cyclomatic Complexity = e – n +2
Where
e is total number of edges
n is total number of nodes
38. GC University Faisalabad (Layyah Campus)
Abdul Sattar Sarmad Farooq Liaqat Ali Muhammad Arsalan
Software Engineering Software Design Complexity
Cyclomatic Complexity Measures
`Cyclomatic Complexity = e – n +2
Edges(e) = 10
Nodes(n) = 8
Putting values
= 10 – 8 + 2
= 4
39. GC University Faisalabad (Layyah Campus)
Abdul Sattar Sarmad Farooq Liaqat Ali Muhammad Arsalan
Software Engineering Software Design Complexity
41. Function Points
It is widely used to measure the size of
software. Function Point concentrates on
functionality provided by the system.
Features and functionality of the
system are used to measure the software
complexity
44. Function Points
Parameters Simple Complex Average
External Input If input count is low and
affects less internal files.
If input count is high and
affects more internal files.
b/w simple and complex.
45. Function Points
Parameters Simple Complex Average
External Input If input count is low and
affects less internal files.
If input count is high and
affects more internal files.
b/w simple and complex.
External Output If output count is low. If output count is high. b/w simple and complex.
46. Function Points
Parameters Simple Complex Average
External Input If input count is low and
affects less internal files.
If input count is high and
affects more internal files.
b/w simple and complex.
External Output If output count is low. If output count is high. b/w simple and complex.
Internal Logical Files If number of record types
are low.
If number of record types
are high.
b/w simple and complex.
47. Function Points
Parameters Simple Complex Average
External Input If input count is low and
affects less internal files.
If input count is high and
affects more internal files.
b/w simple and complex.
External Output If output count is low. If output count is high. b/w simple and complex.
Internal Logical Files If number of record types
are low.
If number of record types
are high.
b/w simple and complex.
External Interface Files If number of record types
in shared files are low.
If number of record types
in shared files are high.
b/w simple and complex.
48. Function Points
Parameters Simple Complex Average
External Input If input count is low and
affects less internal files.
If input count is high and
affects more internal files.
b/w simple and complex.
External Output If output count is low. If output count is high. b/w simple and complex.
Internal Logical Files If number of record types
are low.
If number of record types
are high.
b/w simple and complex.
External Interface Files If number of record types
in shared files are low.
If number of record types
in shared files are high.
b/w simple and complex.
External Inquiries If query needs low
processing and yield small
amount.
If query needs high
processing and yield larger
amount.
b/w simple and complex.
49. GC University Faisalabad (Layyah Campus)
Abdul Sattar Sarmad Farooq Liaqat Ali Muhammad Arsalan
Software Engineering Software Design Complexity
Abdul Sattar Sarmad Farooq Liaqat Ali M. Arsalan