Beruflich Dokumente
Kultur Dokumente
Software Metrics: What and Why ? 8. What is the reliability at the time of release?
1. How to measure the size of a software? 9. Which test technique is more effective?
2. How much will it cost to develop a software? 10. Are we testing hard or are we testing smart?
3. How many bugs can we expect? 11. Do we have a strong program or a week test suite?
1 2
3 4
Categories of Metrics Project metrics
Product metrics: describe the characteristics of the describe the project characteristics and execution.
product such as size, complexity, design features, performance, Examples are :
efficiency, reliability, portability, etc. number of software developers
Process metrics: describe the effectiveness and quality of staffing pattern over the life cycle of the software
the processes that produce the software product. Examples are: cost and schedule
effort required in the process
productivity
time to produce the product
effectiveness of defect removal during development
number of defects found during testing
5 6
Fq = å c i ´ mi
7 8
McCall’s Quality Parameters
Correctness.The extent to which a program satisfies its specification
and fulfills the customer‘s mission objectives.
Reliability.The extent to which a program can be expected to perform
its intended function with required precision. It should be
noted that other, more complete definitions of reliability
have been proposed
9 10
11 12
The Challenge of Technical Metrics Measurement Principles
D Each quality measurement takes a different view of what
D Formulation - derivation of software metrics appropriate for
quality is and what attributes in a system lead to
the software being considered
complexity.
D Collection - accumulating data required to derive the
D The goal is to develop measures of different program formulated metrics
attributes to use as indicators of quality.
D Analysis - computation of metrics and application of
D Unfortunately, a scientific methodology of realizing this mathematical tools
goal has not been achieved. D Interpretation - evaluation of metrics in an effort to gain
insight into the quality of the system
D Feedback - recommendations derived from the interpretation
of metrics
13 14
15 16
Function Point Metric The Bang Metric
D Used to predict the application size based on the analysis
model.
Weighting Factor
MEASUREMENT PARAMETER count simple average complex total D The software engineer first evaluates a set of primitives
number of user inputs 3 x 3 4 6 =9
number of user outputs 2 x 4 5 7 =8 unsubdividable at the analysis level.
number of user inquiries 2 x 3 4 6 =6 D With the evaluation of these primitives, software can be
number of files 1 x 7 10 15 =7
number of external interfaces 4 x 5 7 10 = 20 defined as either function-strong or data-strong.
count - total 50 D Once the Bang metric is computed, past history must be
used to predict software size and effort.
Overall implemented size can be estimated from the projected FP value
FP = count-total ´ (0.65 + 0.01 ´ S Fi)
17 18
19 20
Algorithm Metrics for Requirements Quality
set initial value of bang = 0;
do while functional primitives remain to be evaluated D Requirements quality metrics - completeness, correctness,
Compute token-count around the boundary of primitive i understandability, verifiability, consistency, achievability,
traceability, modifiability, precision, and reusability - design metric
Compute corrected FuP increment (CFuPI)
for each.
Allocate primitive to class
D E.g., let nr = nf + nnf , where
Assess class and note assessed weight
D nr = number of requirements
Multiply CFuPI by the assessed weight
D nf = number of functional requirements
bang = bang + weighted CFuPI D nnf = number of nonfunctional requirements
enddo
21 22
23 24
High-Level Design Metrics (Cont.) Morphology Metrics
D Morphology Metrics a
D size = n + a
D n = number of modules b c d e
D a = number of arcs (lines of control)
f g i j k l
D arc-to-node ratio, r = a/n
D depth = longest path from the root to a leaf
h m n p q r
D width = maximum number of nodes at any level
AF Design Structure Quality Index Air Force Design Structure Quality Index
S1 = total number of modules
S2 = # modules dependent upon correct data source or D1 = 1 if arch design method used, else 0
produces data used, excl. control D2 = 1 - (S2/S1) -- module independence
S3 = # modules dependent upon prior processing
D3 = 1 - (S3/S1) -- independence of prior processing
S4 = total number of database items
S5 = # unique database items D4 = 1 - (S5/S4) -- database size
S6 = # of database segments D5 = 1 - (S6/S4) -- DB compartmentalization
S7 = # modules with single entry & exit D6 = 1 - (S7/S1) -- Module entrance/exit
27 28
AF Design Structure Quality Index Component-Level Design Metrics
D Cohesion Metrics
DSQI = åwiDi, where the wi are weights totaling 1 which D Coupling Metrics
give the relative importance D data and control flow coupling
The closer this is to one, the higher the quality. D global coupling
This is best used on a comparison basis, i.e., with previous D environmental coupling
successful projects. D Complexity Metrics
If the value is too low, more design work should be done. D Cyclomatic complexity
D Experience shows that if this > 10, it is very difficult to test
29 30
31 32
Interface Design Metrics Metrics for Source Code
D Software Science Primitives
D Layout Entities - graphic icons, text, menus, windows, . D n1 = the number of distinct operators
D Layout Appropriateness D n2 = the number of distinct operands
D absolute and relative position of each layout entity
D frequency used
D N1 = the total number of operator occurrences
D cost of transition from one entity to another D N2 = the total number of operand occurrences
D LA = 100 x [(cost of LA-optimal layout) /
(cost of proposed layout)]
D Final GUI design should be based on user feedback on GUI
prototypes Length: N = n1log2n1 + n2log2n2
Volume: V = Nlog2(n1 + n2)
33 34
35 36
Metrics for Maintenance Summary
D Software Maturity Index (SMI) D Software metrics provide a quantitative way to asses the
D MT = number of modules in the current release quality of product attributes.
D Fc = number of modules in the current release that have D A software metric needs to be simple, computable,
been changed persuasive, consistent, and objective.
D Fa = number of modules in the current release that have
D The function point and bang metrics provide quantitative
been added
D Fd = number of modules from the preceding release that
means for evaluating the analysis model.
were deleted in the current release D Metrics for design consider high-level, component level,
and interface design issues.
Summary
D Interface design metrics provide an indication of layout
appropriateness for a GUI.
D Using the number of operators and operands present in
the code provides a variety of metrics to assess program
quality.
D Using the metrics as a comparison with known successful
or unsuccessful projects is better than treating them as
absolute quantities.
39