Software Quality Metrics Overview Types of Software Metrics

  • Slides: 63
Download presentation
Software Quality Metrics Overview

Software Quality Metrics Overview

Types of Software Metrics o Product metrics – e. g. , size, complexity, design

Types of Software Metrics o Product metrics – e. g. , size, complexity, design features, performance, quality level o Process metrics – e. g. , effectiveness of defect removal, response time of the fix process o Project metrics – e. g. , number of software developers, cost, schedule, productivity

Software Quality Metrics o The subset of metrics that focus on quality o Software

Software Quality Metrics o The subset of metrics that focus on quality o Software quality metrics can be divided into: n End-product quality metrics n In-process quality metrics o The essence of software quality engineering is to investigate the relationships among inprocess metric, project characteristics , and end-product quality, and, based on the findings, engineer improvements in quality to both the process and the product.

Three Groups of Software Quality Metrics o Product quality o In-process quality o Maintenance

Three Groups of Software Quality Metrics o Product quality o In-process quality o Maintenance quality

Product Quality Metrics o Intrinsic product quality n n Mean time to failure Defect

Product Quality Metrics o Intrinsic product quality n n Mean time to failure Defect density o Customer related n n Customer problems Customer satisfaction

Intrinsic Product Quality o Intrinsic product quality is usually measured by: n n the

Intrinsic Product Quality o Intrinsic product quality is usually measured by: n n the number of “bugs” (functional defects) in the software (defect density), or how long the software can run before “crashing” (MTTF – mean time to failure) o The two metrics are correlated but different

Difference Between Errors, Defects, Faults, and Failures (IEEE/ANSI) o An error is a human

Difference Between Errors, Defects, Faults, and Failures (IEEE/ANSI) o An error is a human mistake that results in incorrect software. o The resulting fault is an accidental condition that causes a unit of the system to fail to function as required. o A defect is an anomaly in a product. o A failure occurs when a functional unit of a software-related system can no longer perform its required function or cannot perform it within specified limits

What’s the Difference between a Fault and a Defect?

What’s the Difference between a Fault and a Defect?

The Defect Density Metric o This metric is the number of defects over the

The Defect Density Metric o This metric is the number of defects over the opportunities for error (OPE) during some specified time frame. o We can use the number of unique causes of observed failures (failures are just defects materialized) to approximate the number of defects. o The size of the software in either lines of code or function points is used to approximate OPE.

Lines of Code o Possible variations n n n Count only executable lines Count

Lines of Code o Possible variations n n n Count only executable lines Count executable lines plus data definitions Count executable lines, data definitions, and comments Count executable lines, data definitions, comments, and job control language Count lines as physical lines on an input screen Count lines as terminated by logical delimiters

Lines of Code (Cont’d) o Other difficulties n LOC measures are language dependent n

Lines of Code (Cont’d) o Other difficulties n LOC measures are language dependent n Can’t make comparisons when different languages are used or different operational definitions of LOC are used n For productivity studies the problems in using LOC are greater since LOC is negatively correlated with design efficiency n Code enhancements and revisions complicates the situation – must calculate defect rate of new and changed lines of code only

Defect Rate for New and Changed Lines of Code o Depends on the availability

Defect Rate for New and Changed Lines of Code o Depends on the availability on having LOC counts for both the entire produce as well as the new and changed code o Depends on tracking defects to the release origin (the portion of code that contains the defects) and at what release that code was added, changed, or enhanced

Function Points o A function can be defined as a collection of executable statements

Function Points o A function can be defined as a collection of executable statements that performs a certain task, together with declarations of the formal parameters and local variables manipulated by those statements. o In practice functions are measured indirectly. o Many of the problems associated with LOC counts are addressed.

Measuring Function Points o The number of function points is a weighted total of

Measuring Function Points o The number of function points is a weighted total of five major components that comprise an application. n n n Number of external inputs x 4 Number of external outputs x 5 Number of logical internal files x 10 Number of external interface files x 7 Number of external inquiries x 4

Measuring Function Points (Cont’d) o The function count (FC) is a weighted total of

Measuring Function Points (Cont’d) o The function count (FC) is a weighted total of five major components that comprise an application. n n n Number of external inputs x (3 to 6) Number of external outputs x (4 to 7) Number of logical internal files x (7 to 15) Number of external interface files x (5 to 10) Number of external inquiries x (3 to 6) the weighting factor depends on complexity

Measuring Function Points (Cont’d) o Each number is multiplied by the weighting factor and

Measuring Function Points (Cont’d) o Each number is multiplied by the weighting factor and then they are summed. o This weighted sum (FC) is further refined by multiplying it by the Value Adjustment Factor (VAF). o Each of 14 general system characteristics are assessed on a scale of 0 to 5 as to their impact on (importance to) the application.

The 14 System Characteristics 1. Data Communications 2. Distributed functions 3. Performance 4. Heavily

The 14 System Characteristics 1. Data Communications 2. Distributed functions 3. Performance 4. Heavily used configuration 5. Transaction rate 6. Online data entry 7. End-user efficiency

The 14 System Characteristics (Cont’d) 8. Online update 9. Complex processing 10. Reusability 11.

The 14 System Characteristics (Cont’d) 8. Online update 9. Complex processing 10. Reusability 11. Installation ease 12. Operational ease 13. Multiple sites 14. Facilitation of change

The 14 System Characteristics (Cont’d) q VAF is the sum of these 14 characteristics

The 14 System Characteristics (Cont’d) q VAF is the sum of these 14 characteristics divided by 100 plus 0. 65. q Notice that if an average rating is given each of the 14 factors, their sum is 35 and therefore VAF =1 q The final function point total is then the function count multiplied by VAF q FP = FC x VAF

Customer Problems Metric o Customer problems are all the difficulties customers encounter when using

Customer Problems Metric o Customer problems are all the difficulties customers encounter when using the product. o They include: n n n Valid defects Usability problems Unclear documentation or information Duplicates of valid defects (problems already fixed but not known to customer) User errors o The problem metric is usually expressed in terms of problems per user month (PUM)

Customer Problems Metric (Cont’d) o PUM = Total problems that customers reported for a

Customer Problems Metric (Cont’d) o PUM = Total problems that customers reported for a time period <divided by> Total number of license-months of the software during the period where Number of license-months = Number of the install licenses of the software x Number of months in the calculation period

Approaches to Achieving a Low PUM o Improve the development process and reduce the

Approaches to Achieving a Low PUM o Improve the development process and reduce the product defects. o Reduce the non-defect-oriented problems by improving all aspects of the products (e. g. , usability, documentation), customer education, and support. o Increase the sale (number of installed licenses) of the product.

Defect Rate and Customer Problems Metrics Defect Rate Problems per User. Month (PUM) Numerator

Defect Rate and Customer Problems Metrics Defect Rate Problems per User. Month (PUM) Numerator Valid and unique product defects All customer problems (defects and nondefects, first time and repeated) Denominator Size of product (KLOC or function point) Customer usage of the product (user-months) Measurement perspective Producer—software development organization Customer Scope Intrinsic product quality plus other factors

Customer Satisfaction Metrics Customer Satisfaction Issues Customer Problems Defects

Customer Satisfaction Metrics Customer Satisfaction Issues Customer Problems Defects

Customer Satisfaction Metrics (Cont’d) o Customer satisfaction is often measured by customer survey data

Customer Satisfaction Metrics (Cont’d) o Customer satisfaction is often measured by customer survey data via the fivepoint scale: n n n Very satisfied Satisfied Neutral Dissatisfied Very dissatisfied

IBM Parameters of Customer Satisfaction o CUPRIMDSO n Capability (functionality) n Usability n Performance

IBM Parameters of Customer Satisfaction o CUPRIMDSO n Capability (functionality) n Usability n Performance n Reliability n Installability n Maintainability n Documentation n Service n Overall

HP Parameters of Customer Satisfaction o FURPS n n n Functionality Usability Reliability Performance

HP Parameters of Customer Satisfaction o FURPS n n n Functionality Usability Reliability Performance Service

Examples Metrics for Customer Satisfaction 1. Percent of completely satisfied customers 2. Percent of

Examples Metrics for Customer Satisfaction 1. Percent of completely satisfied customers 2. Percent of satisfied customers (satisfied and completely satisfied) 3. Percent of dissatisfied customers (dissatisfied and completely dissatisfied) 4. Percent of nonsatisfied customers (neutral, dissatisfied, and completely dissatisfied)

In-Process Quality Metrics o Defect density during machine testing o Defect arrival pattern during

In-Process Quality Metrics o Defect density during machine testing o Defect arrival pattern during machine testing o Phase-based defect removal pattern o Defect removal effectiveness

Defect Density During Machine Testing o Defect rate during formal machine testing (testing after

Defect Density During Machine Testing o Defect rate during formal machine testing (testing after code is integrated into the system library) is usually positively correlated with the defect rate in the field. o The simple metric of defects per KLOC or function point is a good indicator of quality while the product is being tested.

Defect Density During Machine Testing (Cont’d) o Scenarios for judging release quality: n If

Defect Density During Machine Testing (Cont’d) o Scenarios for judging release quality: n If the defect rate during testing is the same or lower than that of the previous release, then ask: Does the testing for the current release deteriorate? p If the answer is no, the quality perspective is positive. p If the answer is yes, you need to do extra testing.

Defect Density During Machine Testing (Cont’d) o Scenarios for judging release quality (cont’d): n

Defect Density During Machine Testing (Cont’d) o Scenarios for judging release quality (cont’d): n If the defect rate during testing is substantially higher than that of the previous release, then ask: Did we plan for and actually improve testing effectiveness? p If the answer is no, the quality perspective is negative. p If the answer is yes, then the quality perspective is the same or positive.

Defect Arrival Pattern During Machine Testing o The pattern of defect arrivals gives more

Defect Arrival Pattern During Machine Testing o The pattern of defect arrivals gives more information than defect density during testing. o The objective is to look for defect arrivals that stabilize at a very low level, or times between failures that are far apart before ending the testing effort and releasing the software.

Two Contrasting Defect Arrival Patterns During Testing

Two Contrasting Defect Arrival Patterns During Testing

Three Metrics for Defect Arrival During Testing o The defect arrivals during the testing

Three Metrics for Defect Arrival During Testing o The defect arrivals during the testing phase by time interval (e. g. , week). These are raw arrivals, not all of which are valid. o The pattern of valid defect arrivals – when problem determination is done on the reported problems. This is the true defect pattern. o The pattern of defect backlog over time. This is needed because development organizations cannot investigate and fix all reported problems immediately. This metric is a workload statement as well as a quality statement.

Phase-Based Defect Removal Pattern o This is an extension of the test defect density

Phase-Based Defect Removal Pattern o This is an extension of the test defect density metric. o It requires tracking defects in all phases of the development cycle. o The pattern of phase-based defect removal reflects the overall defect removal ability of the development process.

Defect Removal by Phase for Two Products

Defect Removal by Phase for Two Products

Defect Removal Effectiveness o DRE = (Defects removed during a development phase <divided by>

Defect Removal Effectiveness o DRE = (Defects removed during a development phase <divided by> Defects latent in the product) x 100% o The denominator can only be approximated. o It is usually estimated as: Defects removed during the phase + Defects found later

Defect Removal Effectiveness (Cont’d) o When done for the front end of the process

Defect Removal Effectiveness (Cont’d) o When done for the front end of the process (before code integration), it is called early defect removal effectiveness. o When done for a specific phase, it is called phase effectiveness.

Phase Effectiveness of a Software Product

Phase Effectiveness of a Software Product

Metrics for Software Maintenance o The goal during maintenance is to fix the defects

Metrics for Software Maintenance o The goal during maintenance is to fix the defects as soon as possible with excellent fix quality o The following metrics are important: n n Fix backlog and backlog management index Fix response time and fix responsiveness Percent delinquent fixes Fix quality

Fix Backlog o Fix backlog is a workload statement for software maintenance. o It

Fix Backlog o Fix backlog is a workload statement for software maintenance. o It is related to both the rate of defect arrivals and the rate at which fixes for reported problems become available. o It is a simple count of reported problems that remain at the end of each time period (week, month, etc. )

Backlog Management Index (BMI) o BMI = (Number of problems closed during the month

Backlog Management Index (BMI) o BMI = (Number of problems closed during the month <divided by> Number of problem arrivals during the month) x 100%. o If BMI is larger than 100, it means the backlog is reduced. o If BMI is less than 100, then the backlog is increased.

Opened Problems, Closed Problems, and Backlog Management Index by Month

Opened Problems, Closed Problems, and Backlog Management Index by Month

Fix Response Time and Fix Responsiveness o The fix response time metric is usually

Fix Response Time and Fix Responsiveness o The fix response time metric is usually q q calculated as: Mean time of all problems from open to closed Metric may be used for different defect severity levels. Fix response time relates to customer satisfaction. But meeting agreed-to fix time is more than just achieving a short fix time. A possible metric is the percentage of delivered fixes meeting committed dates to customers.

Percent Delinquent Fixes o The mean response time metric is a central tendency measure.

Percent Delinquent Fixes o The mean response time metric is a central tendency measure. o A more sensitive metric is the percentage of delinquent fixes (for each fix, if the turnaround time greatly exceeds the required response time, it is classified as delinquent). o Percent delinquent fixes = (Number of fixes that exceeded the response time criteria by severity level <divided by> Number of fixes delivered in a specified time) x 100%

Percent Delinquent Fixes (Cont’d) o This is not a real-time metric because it is

Percent Delinquent Fixes (Cont’d) o This is not a real-time metric because it is for closed problems only. o For a real-time metric we must factor in problems that are still open. o We can use the following metric Real-Time Delinquency Index = 100 x Delinquent / (Backlog + Arrivals)

Real-Time Delinquency Index

Real-Time Delinquency Index

Fix Quality o The number of defective fixes is another quality metric for maintenance.

Fix Quality o The number of defective fixes is another quality metric for maintenance. o The metric of percent defective fixes is simply the percentage of all fixes in a time interval that are defective. o Recording both the time the defective fix was discovered and the time the fix was made to be able to calculate the latent period of the defective fix.

Examples of Metrics Programs o Motorola n n Follows the Goal/Question/Metric paradigm of Basili

Examples of Metrics Programs o Motorola n n Follows the Goal/Question/Metric paradigm of Basili and Weiss Goals: 1. Improve project planning 2. Increase defect containment 3. Increase software reliability 4. Decrease software defect density 5. Improve customer service 6. Reduce the cost of nonconformance 7. Increase software productivity

Examples of Metrics Programs (Cont’d) o Motorola (cont’d) n Measurement Areas p p p

Examples of Metrics Programs (Cont’d) o Motorola (cont’d) n Measurement Areas p p p p Delivered defects and delivered defects per size Total effectiveness throughout the process Adherence to schedule Accuracy of estimates Number of open customer problems Time that problems remain open Cost of nonconformance Software reliability

Examples of Metrics Programs (Cont’d) o Motorola (cont’d) n For each goal the questions

Examples of Metrics Programs (Cont’d) o Motorola (cont’d) n For each goal the questions to be asked and the corresponding metrics were formulated: p p p Goal 1: Improve Project Planning Question 1. 1: What was the accuracy of estimating the actual value of project schedule? Metric 1. 1: Schedule Estimation Accuracy (SEA) n SEA = (Actual project duration)/(Estimated project duration)

Examples of Metrics Programs (Cont’d) o Hewlett-Packard n The software metrics program includes both

Examples of Metrics Programs (Cont’d) o Hewlett-Packard n The software metrics program includes both primitive and computed metrics. n Primitive metrics are directly measurable n Computed metrics are mathematical combinations of primitive metrics p p (Average fixed defects)/(working day) (Average engineering hours)/(fixed defect) (Average reported defects)/(working day) Bang – A quantitative indicator of net usable function from the user’s point of view

Examples of Metrics Programs (Cont’d) o Hewlett-Packard (cont’d) n Computed metrics are mathematical combinations

Examples of Metrics Programs (Cont’d) o Hewlett-Packard (cont’d) n Computed metrics are mathematical combinations of primitive metrics (cont’d) p p p (Branches covered)/(total branches) Defects/KNCSS (thousand noncomment source statements) Defects/LOD (lines of documentation not included in program source code) Defects/(testing time) Design weight – sum of module weights (function of token and decision counts) over the set of all modules in the design

Examples of Metrics Programs (Cont’d) o Hewlett-Packard (cont’d) n Computed metrics are mathematical combinations

Examples of Metrics Programs (Cont’d) o Hewlett-Packard (cont’d) n Computed metrics are mathematical combinations of primitive metrics (cont’d) p p p NCSS/(engineering month) Percent overtime – (average overtime)/(40 hours per week) Phase – (engineering months)/(total engineering months)

Examples of Metrics Programs (Cont’d) o IBM Rochester n Selected quality metrics p p

Examples of Metrics Programs (Cont’d) o IBM Rochester n Selected quality metrics p p p p Overall customer satisfaction Postrelease defect rates Customer problem calls per month Fix response time Number of defect fixes Backlog management index Postrelease arrival patterns for defects and problems

Examples of Metrics Programs (Cont’d) o IBM Rochester (cont’d) n Selected quality metrics (cont’d)

Examples of Metrics Programs (Cont’d) o IBM Rochester (cont’d) n Selected quality metrics (cont’d) p p p Defect removal model for the software development process Phase effectiveness Inspection coverage and effort Compile failures and build/integration defects Weekly defect arrivals and backlog during testing Defect severity

Examples of Metrics Programs (Cont’d) o IBM Rochester (cont’d) n Selected quality metrics (cont’d)

Examples of Metrics Programs (Cont’d) o IBM Rochester (cont’d) n Selected quality metrics (cont’d) p p p Defect cause and problem component analysis Reliability (mean time to initial program loading during testing) Stress level of the system during testing Number of system crashes and hangs during stress testing and system testing Various customer feedback metrics S curves for project progress

Collecting Software Engineering Data o The challenge is to collect the necessary data without

Collecting Software Engineering Data o The challenge is to collect the necessary data without placing a significant burden on development teams. o Limit metrics to those necessary to avoid collecting unnecessary data. o Automate the data collection whenever possible.

Data Collection Methodology (Basili and Weiss) 1. Establish the goal of the data 2.

Data Collection Methodology (Basili and Weiss) 1. Establish the goal of the data 2. 3. 4. 5. 6. collection Develop a list of questions of interest Establish data categories Design and test data collection forms Collect and validate data Analyze data

Reliability of Defect Data o Testing defects are generally more reliable than inspection defects

Reliability of Defect Data o Testing defects are generally more reliable than inspection defects since inspection defects are more subjective o An inspection defect is a problem found during the inspection process that, if not fixed, would cause one or more of the following to occur: n A defect condition in a later inspection phase

Reliability of Defect Data o An inspection defect is one which would cause: (cont’d)

Reliability of Defect Data o An inspection defect is one which would cause: (cont’d) : n n A defect condition during testing A field defect Nonconformance to requirements and specifications Nonconformance to established standards

An Inspection Summary Form

An Inspection Summary Form