Location via proxy:   [ UP ]  
[Report a bug]   [Manage cookies]                

Product Metrics

Download as pptx, pdf, or txt
Download as pptx, pdf, or txt
You are on page 1of 15

PRODUCT METRICS

What is it?

By its nature, engineering is a quantitative discipline. Product metrics help


software engineers gain insight into the design and construction of the software
they build by focusing on specific, measurable attributes of software engineering
work products.

Who does it?

Software engineers use product metrics to help them build higher-quality software.

Why is it important?

Product metrics provide a basis from which analysis, design, coding, and testing
can be conducted more objectively and assessed more quantitatively.
What are the steps?
• The first step in the measurement process is to derive the software
measures and metrics that are appropriate for the representation of
software that is being considered.

• Data required to derive the formulated metrics are collected. Once


computed, appropriate metrics are analyzed based on preestablished
guidelines and past data.

• The results of the analysis are interpreted to gain insight into the
quality of the software, and the results of the interpretation lead to
modification of requirements and design models, source code, or test
cases.
A FRAMEWORK FOR PRODUCT METRICS

Measures, Metrics, and Indicators

• Measurement occurs as the result of the collection of one or more data points
(e.g., a number of component reviews and unit tests are investigated to
collect measures of the number of errors for each).

• A software metric relates the individual measures in some way (e.g., the
average number of errors found per review or the average number of errors
found per unit test).

• A software engineer collects measures and develops metrics so that indicators


will be obtained.
• An indicator is a metric or combination of metrics that provides
insight into the software process, a software project, or the product
itself.

• An indicator provides insight that enables the project manager or


software engineers to adjust the process, the project, or the product to
make things better.

The Challenge of Product Metrics

 Although dozens of complexity measures have been proposed, each


takes a somewhat different view of what complexity is and what
attributes of a system lead to complexity.
 By analogy, consider a metric for evaluating an attractive
car.

 Some observers might emphasize body design; others might


consider mechanical characteristics; still others might tout
cost, or performance, or the use of alternative fuels, or the
ability to recycle when the car is junked.

Measurement Principles

(1) assist in the evaluation of the analysis and design models,


(2) provide an indication of the complexity of procedural
designs and source code.

(3) facilitate the design of more effective testing, it is important


for you to understand basic measurement principles.

• 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.

Interpretation. The evaluation of metrics resulting in


insight into the quality of the representation.

Feedback. Recommendations derived from the


interpretation of product metrics transmitted to the
software team
The following principles are representative of many that can be
proposed for metrics characterization and validation:

• A metric should have desirable mathematical properties. That


is, the metric’s value should be in a meaningful range (e.g., 0
to 1, where 0 truly means absence, 1 indicates the maximum
value, and 0.5 represents the “halfway point”).

• When a metric represents a software characteristic that


increases when positive traits occur or decreases when
undesirable traits are encountered, the value of the metric
should increase or decrease in the same manner.
• Each metric should be validated empirically in a wide variety of
contexts before being published or used to make decisions.

The Attributes of Effective Software Metrics

• Simple and computable. It should be relatively easy to learn how to


derive the metric, and its computation should not demand inordinate
effort or time.

• Empirically and intuitively persuasive. The metric should satisfy the


engineer’s intuitive notions about the product attribute under
consideration (e.g., a metric that measures module cohesion should
increase in value as the level of cohesion increases).
METRICS FOR SOURCE CODE

• Halstead assigned quantitative laws to the development of computer software,


using a set of primitive measures that may be derived after code is generated or
estimated once design is complete.

• The measures are:


• n1 number of distinct operators that appear in a program
• n2 number of distinct operands that appear in a program
• N1 total number of operator occurrences
• N2 total number of operand occurrences
Halstead uses these primitive measures to develop expressions for the
overall program length, potential minimum volume for an algorithm,
the actual volume (number of bits required to specify a program), the
program level (a measure of software complexity), the language level
(a constant for a given language), and other features such as
development effort, development time, and even the projected number
of faults in the software.
It should be noted that V will vary with programming language and
represents the volume of information (in bits) required to specify a
program.

METRICS FOR TESTING


• In general, testers must rely on analysis, design, and code metrics to
guide them in the design and execution of test cases.

• Architectural design metrics provide information on the ease or


difficulty associated with integration testing and the need for
specialized testing software (e.g., stubs and drivers).
Modules with high cyclomatic complexity are more likely to
be error prone than modules whose cyclomatic complexity is
lower.
Halstead Metrics Applied to Testing

• Testing effort can be estimated using metrics derived from


Halstead measures. Using the definitions for program
volume V and program level PL, Halstead effort e can be
computed as
The percentage of overall testing effort to be allocated to a module k
can be estimated using the following relationship

where e(k) is computed for module k using Equations and the


summation in the denominator of Equation

You might also like