Title: ITIS 3310 Software Architecture and Design Chapter 15 Product Metrics for Software
1ITIS 3310 Software Architecture and Design
Chapter 15Product Metrics for Software
2Software Quality
- How do we define quality?
- Conformance to
- Explicitly stated functional and performance
requirements - Explicitly documented development standards
- Implicit characteristics that are expected of
all professionally developed software
3Software Quality
- Mix of factors
- Varies for
- Different applications
- Different customers
- Three important points
- Requirements are the foundation of quality
- Standards need to be specified
- Implicit requirements are often as important as
explicit ones
4Engine Analogy
- 3 base qualities
- Durability
- Economy of operation
- Power output
- Emphasize one at the expense of the others
- Optimize two at the loss of the third
- Example Power
- Power Economy Durability (longevity)
- Family car 200 hp, 25 mpg, 200,000 mi.
- NASCAR Cup 850 hp, 3-4 mpg, 600 miles
- NHRA Top Fuel 6000 hp, 5 gal per ¼ mile ¼
mi
5McCalls Triangle of Quality
- Measurement of software quality can be
- Direct
- Defects uncovered during testing
- Performance
- Indirect
- Usability
- Maintainability
- In either case, measurement is important!
- Compare a metric to some goal
6McCalls Triangle of Quality
- McCall, Richards, Walters categorization of
software quality factors - Product operation
- Operational characteristics
- Product revision
- Ability to undergo change
- Product transition
- Adaptability to new environments
7McCalls Triangle of Quality
M
a
i
n
t
a
i
n
a
b
i
l
i
t
y
M
a
i
n
t
a
i
n
a
b
i
l
i
t
y
8McCalls Triangle of Quality
- Correctness
- Satisfies expectations
- Fulfills customers mission objectives
- Reliability
- Expectation of performing intended function with
required precision - Efficiency
- Consumption of resources to deliver functionality
9McCalls Triangle of Quality
- Integrity
- Access/control by unauthorized persons can be
controlled - Usability
- Effort required to learn, operate, prepare input
for, and interpret output of - Maintainability
- Effort required to locate and fix an error
10McCalls Triangle of Quality
- Flexibility
- Effort required to modify
- Testability
- Effort required to test for intended
functionality - Portability
- Effort required to transfer operations to a
different hardware platform or operating system
environment
11McCalls Triangle of Quality
- Reusability
- Extent to which parts of a system can be reused
by other systems - Interoperability
- Effort necessary to connect two systems together
12McCalls Triangle of Quality
- Can these be measured directly?
- Yes, if there is a single countable value
- Size of a program in bytes
- Transactions per second
- Some can only be measured indirectly
- Subjective assessment
- Effort required to learn how to operate a program
- Some may catch on quickly
- Some may require extensive instruction and
practice - Some many never get it
13A Comment
McCalls quality factors were proposed in
the early 1970s. They are as valid today as they
were in that time. Its likely that software
built to conform to these factors will exhibit
high quality well into the 21st century, even if
there are dramatic changes in technology.
14Resume 4/9
15ISO 9216 Quality Factors
- Functionality How the software satisfies stated
needs - Suitability
- Accuracy
- Interoperability
- Compliance
- Security
- Reliability Amount of time system is available
for use - Maturity
- Faulty tolerance
- Recoverability
16ISO 9216 Quality Factors
- Usability Ease of use
- Understandability
- Learnability
- Operability
- Efficiency Optimum use of system resources
- Time behavior
- Resource behavior
17ISO 9216 Quality Factors
- Maintainability Ease of repair
- Analyzability
- Changeability
- Stability
- Portability Ease of transposition to new
environment - Adaptability
- Installability
- Conformance
- Replaceability
18Measures, Metrics and Indicators
- Major problem in measurement subjectivity
- What is needed is a set of metrics
- Applicable to quantitative assessment of software
quality - Metrics necessarily represent indirect measure
- What is the unit of measure for quality?
- We can never directly measure quality
- Instead, we measure some manifestation of quality
- What counts is the precise relationship between
the variable measured and the presumed quality of
the software
19Measures, Metrics and Indicators
- A measure provides a quantitative indication of
the extent, amount, dimension, capacity, or size
of some attribute of a product or process - The IEEE glossary defines a metric as a
quantitative measure of the degree to which a
system, component, or process possesses a given
attribute. - An indicator is a metric or combination of
metrics that provide insight into the software
process, a software project, or the product
itself
20Measures, Metrics and Indicators
Collect measures in order to
Develop metrics that
Reveal indicators of quality
21Measurement Principles
- The objectives of measurement should be
established before data collection begins - Each technical metric should be defined in an
unambiguous manner - Metrics should be based on a theory that is valid
for the domain of application (e.g., metrics for
design should draw upon basic design concepts and
principles) - Metrics should be tailored to best accommodate
specific products and processes
22Measurement Process
- Formulation. The derivation of software measures
and metrics appropriate for the representation of
the software that is being considered - Collection. The mechanism used to accumulate data
required to derive the formulated metrics - Analysis. The computation of metrics and the
application of mathematical tools
23Measurement Process
- Interpretation. The evaluation of metrics results
in an effort to gain insight into the quality of
the representation - Feedback. Recommendations derived from the
interpretation of product metrics transmitted to
the software team
24Goal-Oriented Software Measurement
- The Goal/Question/Metric Paradigm
- Technique for identifying meaningful metrics for
any part of software process - Steps
- Establish an explicit measurement goal that is
specific to the process activity or product
characteristic that is to be assessed - Define a set of questions that must be answered
in order to achieve the goal, and - Identify well-formulated metrics that help to
answer these questions.
25Goal-Oriented Software Measurement
- Goal definition template
- Analyze the name of activity or attribute to be
measured - for the purpose of the overall objective of the
analysis - with respect to the aspect of the activity or
attribute that is considered - from the viewpoint of the people who have an
interest in the measurement - in the context of the environment in which the
measurement takes place.
26Goal-Oriented Software Measurement
- Analyze the SafeHome software architecture for
the purpose of evaluating architectural
components with respect to the ability to make
SafeHome more extensible from the viewpoint of
the software engineers performing the work in the
context of product enhancement over the next
three years.
27Goal-Oriented Software Measurement
Are architectural components characterized in a
manner that compartmentalizes function and
related data?
Is the complexity of each component within bounds
that will facilitate modification and extension?
- Now identify metrics that answer each question
quantitatively
28Metrics Attributes
- Simple and computable
- Relatively easy to learn how to derive the metric
- Its computation should not demand inordinate
effort or time - Empirically and intuitively persuasive
- Should satisfy an intuitive notion about the
product attribute under consideration - Consistent and objective
- Should always yield results that are
- The same from measurement to measurement
- Unambiguous
29Metrics Attributes
- Consistent in its use of units and dimensions
- The mathematical computation of the metric should
use measures that do not lead to bizarre
combinations of unit - Programming language independent
- Metrics should be based on the analysis model,
the design model, or the structure of the program
itself - An effective mechanism for quality feedback
- The metric should provide a software engineer
with information that can lead to a higher
quality end product
30Collection and Analysis Principles
- Whenever possible, data collection and analysis
should be automated - Valid statistical techniques should be applied to
establish relationship between internal product
attributes and external quality characteristics - Interpretative guidelines and recommendations
should be established for each metric
31Analysis Metrics
- Function-based metrics
- Use the function point as a normalizing factor or
as a measure of the size of the specification - Specification metrics
- Used as an indication of quality by measuring
number of requirements by type
32Function-Based Metrics
- The function point metric (FP)
- Can be used effectively as a means for measuring
the functionality delivered by a system - Function points are derived using
- An empirical relationship based on countable
(direct) measures of software's information
domain - Assessments of software complexity
33Function-Based Metrics
- Information domain values are defined in the
following manner - Number of external inputs (EIs)
- Number of external outputs (EOs)
- Number of external inquiries (EQs)
- Number of internal logical files (ILFs)
- Number of external interface files (EIFs)
34Function Points
35Architectural Design Metrics
- Architectural design metrics
- Structural complexity g(fan-out)
- Data complexity f(input output variables,
fan-out) - System complexity h(structural data
complexity) - HK metric architectural complexity as a function
of fan-in and fan-out - Morphology metrics a function of the number of
modules and the number of interfaces between
modules
36Metrics for OO Design-I
- Size
- Size is defined in terms of four views
population, volume, length, and functionality - Complexity
- How classes of an OO design are interrelated to
one another - Coupling
- The physical connections between elements of the
OO design - Sufficiency
- The properties of a class that make it useful for
a purpose - Completeness
- A measure of the properties required to fully
represent a problem domain object
37Metrics for OO Design-II
- Cohesion
- The degree to which all operations working
together to achieve a single, well-defined
purpose - Primitiveness
- Applied to both operations and classes, the
degree to which an operation is atomic - Similarity
- The degree to which two or more classes are
similar in terms of their structure, function,
behavior, or purpose - Volatility
- Measures the likelihood that a change will occur
38Distinguishing Characteristics
Berard argues that the following characteristics
require that special OO metrics be developed
- Localizationthe way in which information is
concentrated in a program - Encapsulationthe packaging of data and
processing - Information hidingthe way in which information
about operational details is hidden by a secure
interface - Inheritancethe manner in which the
responsibilities of one class are propagated to
another - Abstractionthe mechanism that allows a design to
focus on essential details
39Class-Oriented Metrics
Proposed by Chidamber and Kemerer
- Weighted methods per class
- Depth of the inheritance tree
- Number of children
- Coupling between object classes
- Response for a class
- Lack of cohesion in methods
40Class-Oriented Metrics
Proposed by Lorenz and Kidd LOR94
- Class size
- Number of operations overridden by a subclass
- Number of operations added by a subclass
- Specialization index
41Class-Oriented Metrics
The MOOD Metrics Suite
- Method inheritance factor
- Coupling factor
- Polymorphism factor
42Operation-Oriented Metrics
Proposed by Lorenz and Kidd LOR94
- Average operation size
- Operation complexity
- Average number of parameters per operation
43Component-Level Design Metrics
- Cohesion metrics a function of data objects and
the locus of their definition - Coupling metrics a function of input and output
parameters, global variables, and modules called - Complexity metrics hundreds have been proposed
(e.g., cyclomatic complexity)
44Interface Design Metrics
- Layout appropriateness
- A function of
- Layout entities
- Their geographic position
- The cost of making transitions among entities
45Code Metrics
- Halsteads Software Science a comprehensive
collection of metrics all predicated on the
number (count and occurrence) of operators and
operands within a component or program - It should be noted that Halsteads laws have
generated substantial controversy, and many
believe that the underlying theory has flaws.
However, experimental verification for selected
programming languages has been performed (e.g.
FEL89).
46Metrics for Testing
- Testing effort can also be estimated using
metrics derived from Halstead measures - Binder BIN94 suggests a broad array of design
metrics that have a direct influence on the
testability of an OO system. - Lack of cohesion in methods (LCOM).
- Percent public and protected (PAP).
- Public access to data members (PAD).
- Number of root classes (NOR).
- Fan-in (FIN).
- Number of children (NOC) and depth of the
inheritance tree (DIT).
47Summary
- Metrics for software is still in its infancy
- Different fields also have different maturity
- OO techniques still immature
- Testing and Maintenance immature
- Many of the methods are hotly debated
- Field will mature
- Start now with some easily defined and measured
aspects - OVERALL use metrics as a tool, not a weapon!