Professional Documents
Culture Documents
Quiz 1 Jan. 28
Software Sizing – Size Estimation Models Chap.10 Feb. 2
Software Sizing – Size Estimation Models Feb 4
Estimating Duration and Cost Chap. 11 Feb 9
Estimating Duration and Cost Feb.11
Reading Week Break Feb. 14-20
Problem Solving Class – Sizing and Estimation Feb. 23
Quiz 2 Feb. 25
1. Understanding
• What is happening during development and
maintenance?
• Establish baselines
2. Control
• Using baselines, monitor product and process
3. Improvement
• Based on measurements, improve the quality of
product/process
Software Quality
How is quality defined and measured in a coherent way?
1. Expectations of Quality
• User View -> Team (Developer) View -> Actual
Measurements
2. Use of the Product (SW)
• Operational, Transition or Revision
Operability
Usability Training
Communicativeness
I/O Volume
Intregrity
I/O Rate
Access Control
Product Operation Efficiency Access Audit
Storage Efficiency
Execution Efficiency
Correctness
Traceability
Completeness
Reliability Accuracy
Error Tolerance
Consistency Measures
Product Revision Maintainability
Simplicity
Conciseness
Testability Instrumentation
Expandability
Flexibility Generality
Self-descriptiveness
# of procedure
Maintainability parameters
Cyclomatic complexity
Reliability
Portability
# of error messages
Usability
Length of the user
manual
External Attributes
Internal Attributes (Metrics)
(User view)
Measuring Internal Attributes
Metrics for the Analysis Model
• Predicting size (FP, LOC, Bang- Model Blitz)
Metrics for the Design Model
• Focuses on the Architectural Structure and
effectiveness of modules
• Suggests reusability/testability
• Specific Metrics:
Cyclomatic Complexity (Thomas McCabe) and
Information Flow Complexity
Metrics for Source Code
Halstead’s Software Science
Models of Software- Design Model
Modeling of software is an essential stage in
establishing assessment criteria for internal
attributes
Model is the image of certain structures in
reality
Formal Models:
Flow Graphs = (E, N, s, t) where N = {nodes}, E=
{edges}, and s,t N.
Structure Charts are also used as models for
software.
Program Model A = (n1,n2, N1, N2) where n1, n2 are
operators and operands, N1 and N2 represent totals
Design Model Metrics
For internal attributes, we must consider the
structure of software. This includes three parts:
Control Flow
sequence of instructions, iterative and looping nature of
programs
Flowgraph (model)
Metric ( McCabe’s complexity)
Data Flow
Trailof a data item as it is created and handled by a
program
Structure Charts (model)
Metric -Information Flow Complexity (Henry-Kafura)
Data Structure
Organization of the data independent of the program
Representation of Program Flow
Graph
Control Flow Constructs
Repeat-Until
Case
Cyclomatic Complexity- McCabe (1976)
Definition: Cyclomatic complexity is a measure of
the logical complexity of a module and the
minimum effort necessary to code a module.
Cyclomatic is the number of linearly independent
paths and, consequently, the minimum number of
paths that one should (theoretically) test.
Advantages
Quantifies the logical (algorithmic) complexity
Measures the minimum effort for testing
Guides the testing process
Useful for finding sneak paths within the logic
Aids in verifying the integrity of control flow
Used to test the interactions between code
constructs
Cyclomatic Complexity- Method 1
Measure of logical
complexity of a program 1
1
CC(G) = e – n + 2 2 3
2
e is the # of edges 3 4
n is the # of nodes 5
4
5
7
G is the Flowgraph 6
6
The CC number actually 8
7
9
measures the number of
linearly independent 8
CC(G) = D + 1 where D
is the D is number of
decision (predicate)
nodes
CC provides a
quantitative measure
of testing difficulty
DE=2
n n 1 2 1
n
n n
4 4 2
n
n n n 3 3 2
Software Module Example
1.procedure sort (var
x: array; n: integer); 1
2.var i, j, temp:
integer; 2
3. begin
3
4.for i:= 2 to n do
5.for j:= 1 to i do 12 4
6.if x[i] < x[j]
7.begin 5 7
8.temp:= x[i]; 6 8
9.x[i]:= x[j];
10. x[j]:= temp; 9
11. end 11
12. end 10
Example: sort(x,n)
1
e = 14
2 n = 12
regions = 4
R4 3
1
4
2
R1
5 7
6 8
R2 R3
9
11
10
McCabe’s Cyclomatic Complexity
Example: sort(x,n)
(1) CC= e - n + 2 = 14 - 12 + 2 = 4
(2) CC= D + 1 = 3 + 1 = 4
Consists of:
-Modules (e.g., A, B)
-Input/Output
Resources
-Call Hierarchy
-Data Flow (e.g, a,b)
-Circles (global
variables)
Properties of Structure Charts
b c
d e f g
Module FI FO FIFO
a 0 3 0
b 1 3 3
c 2 2 4
d 1 0 0
e 2 1 2
f 3 2 6
g 2 0 0
Local Information Flow
A module can have many data flows into and out of it.
The greater the number of flows between modules, they
higher they are coupled. Flows may be through
parameter passing or use of globals or shared files.
Local Information Flows occur when a module passes
a parm to another module. Here A passes x to B.
x
A B
<A,x,B>
Global Information Flow
y
A B
DS C
B C D
File E
<A,x,B> <A,y,C> <A,z,D>
<B,xx,E> <C,yy,B> <C,yy,D>
<D,zz,A> <E,File,B> <E,File,A>
Information Flow Calculation
Fan-In and Fan-Out does not distinguish between
local and global flows. The IF metric is a summation of
all data flows.
To calculate the information flow, calculate FIFO as
before and then compute IF:
Module Fi Fo FIFO IF
A 2 3 6 36
B 3 1 3 9
C 1 2 2 4
D 2 1 2 4
E 1 1 1 1
Henry- Kafura (1981) Measure
IFC(A) = length(A) * 36
IFC(B) = length(B) * 9
IFC(C) = length(C) * 4
IFC(D) = length(D) * 4
IFC(E) = length(E) * 1
Metrics for Source Code Halstead (1977)
for (… ; …; …) this->
[] {}
… ‘?’ … ‘ ‘: …
Operands