Software Metrics Software metrics help evaluate development and testing efforts needed,
SWEN 5430 Software Metrics Slide 1 Quality Management u Managing the quality of the software process...
-
Upload
dorthy-richardson -
Category
Documents
-
view
216 -
download
3
Transcript of SWEN 5430 Software Metrics Slide 1 Quality Management u Managing the quality of the software process...
SWEN 5430 Software Metrics Slide 1
Quality Management
Managing the quality of the software process and products using Software Metrics
SWEN 5430 Software Metrics Slide 2
Objectives
To explain how software metrics may be used in quality management
SWEN 5430 Software Metrics Slide 3
Topics covered
Software metrics Product quality metrics
SWEN 5430 Software Metrics Slide 4
Any type of measurement which relates to a software system, process or related documentation• Lines of code in a program, the Fog index, number of person-
days required to develop a component
Allow the software and the software process to be quantified
Measures of the software process or product Should be captured automatically if possible
Software metrics
SWEN 5430 Software Metrics Slide 5
Predictor and control metrics
Managementdecisions
Controlmeasurements
Softwareprocess
Predictormeasurements
Softwareproduct
SWEN 5430 Software Metrics Slide 6
A software property can be measured The relationship exists between what we can
measure and what we want to know This relationship has been formalized and
validated It may be difficult to relate what can be measured
to desirable quality attributes
Metrics assumptions
SWEN 5430 Software Metrics Slide 7
Internal and external attributes
Reliability
Number of procedureparameters
Cyclomatic complexity
Program size in linesof code
Number of errormessages
Length of user manual
Maintainability
Usability
Portability
SWEN 5430 Software Metrics Slide 8
Data collection
A metrics program should be based on a set of product and process data
Data should be collected immediately (not in retrospect) and, if possible, automatically
Three types of automatic data collection• Static product analysis
• Dynamic product analysis
• Process data collation
SWEN 5430 Software Metrics Slide 9
Automated data collection
Instrumentedsoftware system
Faultdata
Usagedata
SWEN 5430 Software Metrics Slide 10
Data accuracy
Don’t collect unnecessary data The questions to be answered should be decided in advance and the required data identified
Tell people why the data is being collected It should not be part of personnel evaluation
Don’t rely on memory Collect data when it is generated not after a project has finished
SWEN 5430 Software Metrics Slide 11
Measurement analysis
Not always obvious what data means. Analyzing collected data is very difficult
Professional statisticians should be consulted if available
Data analysis must take local circumstances into account
SWEN 5430 Software Metrics Slide 12
A quality metric should be a predictor of product quality.
Most quality metrics are design quality metrics and are concerned with measuring the coupling or the complexity of a design.
The relationship between these metrics and quality as judged by a human may hold in some cases but it is not clear whether or not it is generally true.
Product quality metrics
SWEN 5430 Software Metrics Slide 13
Product measurement process
Measurecomponent
characteristics
Identifyanomalous
measurements
Analyseanomalouscomponents
Selectcomponents to
be assessed
Choosemeasurements
to be made
SWEN 5430 Software Metrics Slide 14
Design maintainability
Cohesion• How closely are the parts of a component related
Coupling• How independent is a component
Understandability• How easy is it to understand a component’s function
Adaptability• How easy is to change a component
SWEN 5430 Software Metrics Slide 15
Associated with Yourdon's 'Structured Design'/ Measures 'fan-in and fan-out' in a structure chart.
High fan-in (number of calling functions) suggests high coupling because of module dependencies.
High fan-out (number of calls) suggests high coupling because of control complexity.
Coupling metrics
SWEN 5430 Software Metrics Slide 16
Structural fan-in and fan-out
Component A
Fan-in
Fan-out
SWEN 5430 Software Metrics Slide 17
The approach based on the calls relationship is simplistic because it ignores data dependencies.
Informational fan-in/fan-out takes these into account.• Number of local data flows + number of global data
structures updated.• Data-flow count subsumes calls relation. It includes updated
procedure parameters and procedures called from within a module.
Complexity = Length * (Fan-in * Fan-out)2• Length is any measure of program size such as LOC.
Henry and Kafura’s modifications
SWEN 5430 Software Metrics Slide 18
Some studies with Unix found that informational fan-in/fan-out allowed complex and potentially fault components to be identified.
Some studies suggest that size and number of branches are as useful in predicting complexity than informational fan-in/fan-out.
Fan-out on its own also seemed to be a better quality predictor.
The whole area is still a research area rather than practically applicable.
Validation of quality metrics
SWEN 5430 Software Metrics Slide 19
Program quality metrics
Design metrics also applicable to programs Other metrics include
• Length. The size of the program source code
• Cyclomatic complexity. The complexity of program control
• Length of identifiers
• Depth of conditional nesting
Anomalous metric values suggest a component may contain an above average number of defects or may be difficult to understand
SWEN 5430 Software Metrics Slide 20
Metric utility
Length of code is simple but experiments have suggested it is a good predictor of problems
Cyclomatic complexity can be misleading Long names should increase program
understandability Deeply nested conditionals are hard to
understand. May be a contributor to an understandability index
SWEN 5430 Software Metrics Slide 21
Cyclomatic complexity is a measure of control structure complexity
Metric has two drawbacks• It is inaccurate for data-driven programs as it is only
concerned with control constructs.
• It places the same weight on nested and non-nested loops. Deeply nested structures, however, are usually harder to understand.
Oviedo's metric modifies this to take data references into account• C = aE +bN
Complexity metrics
SWEN 5430 Software Metrics Slide 22
Documentation quality metrics
Readability of documentation is important Gunnings Fog index is a simple measure of
readability• Based on length of sentences and number of syllables in a word
However, this can be misleading when applied to technical documentation
SWEN 5430 Software Metrics Slide 23
Metrics still have a limited value and are not widely collected
Relationships between what we can measure and what we want to know are not well-understood
Lack of commonality across software process between organizations makes universal metrics difficult to develop
Metrics maturity
SWEN 5430 Software Metrics Slide 24
Key points
Metrics gather information about both process and product
Control metrics provide management information about the software project. Predictor metrics allow product attributes to be estimated
Quality metrics should be used to identify potentially problematical components