SlideShare una empresa de Scribd logo
1 de 23
Descargar para leer sin conexión
Code Change and Fault
           Prediction
             Tom Ostrand, Robert Bell, Elaine Weyuker
             AT&T Labs – Research
             Florham Park, NJ, USA


    PROMISE 2011
    Banff, Alberta, September 20-21, 2011




© 2007 AT&T Knowledge Ventures. All rights reserved. AT&T
and the AT&T logo are trademarks of AT&T Knowledge Ventures.
Overview

•Do measures of code change or churn
 provide useful input to fault prediction
 models?
•Standard model
•Base models
•Churn-augmented models
The Standard Model

• Underlying statistical model
  • Negative binomial regression
• Output (dependent) variable
  • Predicted fault count in each file of release n
• Predictor (independent) variables
  •   KLOC (n)
  •   Previous faults (n-1)
  •   Previous changes (n-1, n-2)
  •   File age (number of releases)
  •   File type (C,C++,java,sql,make,sh,perl,...)
Evaluating prediction models

• Model produces ranking of files in a release, from
  predicted most faults to fewest faults
• Choose cutoff point in ranking, X%
• Yield = percent of all faults in the release that are
  in the first X% of the ranked files
We’ve usually evaluated models at a 20% cutoff.
• Fault-percentile average (FPA) is the average yield
  over all values of X
Prediction Results, from the Standard
Model

                  Percent of faults in top 20% of files        FPA
       100
        90
                                             93 93             91 93        92
        80                              88                88           87
             83   83               81
        70                75                         76
        60
        50
        40
        30
        20
        10
         0
Measures of Code Change

•Changed/not changed
•Number of changes during a release
•Number of lines added
•Number of lines deleted
•Number of lines modified
•Relative churn (line changes/LOC)
Two Subject Systems

Large provisioning system
• 18 releases, 5 year lifespan
• 6 programming languages:
  • Java (60%), C, C++, SQL, SQL-C, SQL-C++
• 3000+ files
• 1.5Mil LOC
• Average of 395 faults/release
Two Subject Systems

Utility, data aggregation system
• 18 releases, 5 year lifespan
• >10 programming languages:
  • Java (77%), Perl, xml, sh, ...
• 800 files
• 280K LOC
• Average of 90 faults/release
Distribution of files,
       averages over all releases.


Percent of Files: Provisioning          Percent of Files: Utility


        6.8%                                 1.6%
                                                15.1%
           11.0%            New                                     New
                            Changed                                 Changed
                            Unchanged                               Unchanged
    82.2%                                84.4%
Where do faults occur?
Distribution of faults over files


Faults/file: Provisioning               Faults/file: Utility


     0.02                                      0.12
            0.24            New                                New
                            Changed                            Changed
                            Unchanged                          Unchanged
  0.80                                  0.82
Provisioning system faults per file, by
               release


                                 Faults per File, by Change Status and Release
                   2.5


                    2
  Fault-per-File




                   1.5


                    1


                   0.5


                    0
                         1   2   3    4   5    6    7   8    9    10   11   12    13   14   15   16    17   18
                                                             Release

                             New (Mean=0.24)       Unchanged (Mean=0.02)         Changed (Mean=0.80)
Utility system faults per file, by release


                                     Faults per File, by Change Status and Release
                      3


                     2.5


                      2
   Faults per file




                     1.5


                      1


                     0.5


                      0
                           1   2      3   4    5    6   7    8    9    10   11   12    13   14   15   16   17   18

                                   New (Mean=.09)       Unchanged (Mean=.002)         Changed (Mean=.92)
Potential predictor combinations

• Added lines only
• Deleted lines only
• Modified lines only
• Adds & Deletes
• Adds & Mods
• Deletes & Mods
• Adds & Deletes & Mods
• Relative values: changed lines/LOC
Distribution of change combinations,
all check-ins, all releases:
Provisioning system
                         Number of Files



                                 Mods, 683       Deletes, 296




            M & D & A, 2625                  Adds, 597
                                                         Mods & Deletes,
                                                              168



                                    Mods & Adds,
                                       1894

             Deletes &
             Adds, 126
Average lines touched for each combination of
changes


                      Average Lines touched
                                Mods, 4      Deletes, 5

                                                       Mods &
                                          Adds,       Deletes, 23
                                           21




                                              Mods & Adds,
                                                  37
               M & D & A, 210
                                                          Deletes &
                                                          Adds, 21
Faults per file, changed files only:
Provisioning system

                          Faults per File

                                               Deletes, 0.04
                                   Mods,
                                   0.19
                                            Adds, 0.3


                                                Mods &
             M & D & A, 1.38
                                              Deletes, 0.36


                                            Mods & Adds,
                                               0.55


                          Deletes & Adds,
                                0.5
Fault prediction models

•Univariate models
•Base model: log(KLOC), File age, File type
•Augmented models:
 • Previous Changes
 • Previous {Adds / Deletes / Mods}
 • Previous Adds + Deletes + Modifications
 • Previous {Adds / Deletes / Mods} / LOC
   (relative churn)
 • Previous Developers
Fault-percentile averages for univariate
predictor models: Provisioning system
(best result from raw variable, square root, fourth root)


                                          FPA, univariate models
                 Standard Model
                             Age
                       Language
              Prior Lines Deleted
                     Prior Faults
                  Prior Changed
             Prior Lines Modified
               Prior Lines Added
                Prior Developers
        Prior Adds+Deletes+Mods
                   Prior Changes
                       log(KLOC)
                                    0%   10%   20%   30%   40%   50%   60%   70%   80%   90%   100%
Base Model 1
 • KLOC
 • File age (number of releases)
 • File type (C,C++,java,sql,make,sh,perl,...)
Base Model 1, and added variables
       Mean FPA, Provisioning System                                        Mean FPA, Utility System
           Standard Model                                       Standard Model
              prev-changes                                         prev-changes
      prev-adds,dels,mods                                   prev-adds,dels,mods
(prev-adds,dels,mods)/LOC                                       prev-developers
          prev-developers
                                                                       prev-adds
                  prev-adds
                                                                  prev-changed
             prev-changed
                 prev-mods                                            prev-mods
               prev-deletes                                         prev-deletes
        prev-prev changes                                     prev-prev changes
                     Base 1                                               Base 1
                              89   90   91   92   93   94                          87   88   89   90   91   92   93




    • Base model 1
          • KLOC
          • File age (number of releases)
          • File type (C,C++,java,sql,make,sh,perl,...)
Base Model 2
 • KLOC
 • File age (number of releases)
 • File type (C,C++,java,sql,make,sh,perl,...)
 • (Previous changes)1/2
Base Model 2, and added variables

                     Mean FPA, Provisioning System
                    prev-prev changes
                  prev-adds,dels,mods
                             prev-adds
                            prev-mods
                      prev-developers
            (prev-adds,dels,mods)/LOC
                          prev-deletes
                         prev-changed
                                Base 2

                                         93.2 93.25 93.3 93.35 93.4 93.45 93.5 93.55




 • Base model 2
   • KLOC
   • File age (number of releases)
   • File type (C,C++,java,sql,make,sh,perl,...)
   • (Previous changes)1/2
Summary

• Churn can be an effective aid for improving fault prediction
• {Adds+Deletes+Mods} improves the accuracy of a model
  that doesn’t include any change information
BUT
• a simple count of prior changes slightly outperforms
  {Adds+Deletes+Mods}
• Prior changed is nearly as good as either, when added to a
  model without change info
• Lines added is the most effective single predictor
• Lines deleted is least effective single predictor
• Relative churn is no better than absolute churn for
  predicting total fault count

Más contenido relacionado

Similar a Promise 2011: "Does Measuring Code Change Improve Fault Prediction?"

The Impact of Tangled Code Changes
The Impact of Tangled Code ChangesThe Impact of Tangled Code Changes
The Impact of Tangled Code Changes
Kim Herzig
 
Studying the impact of dependency network measures on software quality
Studying the impact of dependency network measures on software quality	Studying the impact of dependency network measures on software quality
Studying the impact of dependency network measures on software quality
ICSM 2010
 
An Exploration of Challenges Limiting Pragmatic Software Defect Prediction
An Exploration of Challenges Limiting Pragmatic Software Defect PredictionAn Exploration of Challenges Limiting Pragmatic Software Defect Prediction
An Exploration of Challenges Limiting Pragmatic Software Defect Prediction
SAIL_QU
 

Similar a Promise 2011: "Does Measuring Code Change Improve Fault Prediction?" (20)

The Impact of Tangled Code Changes
The Impact of Tangled Code ChangesThe Impact of Tangled Code Changes
The Impact of Tangled Code Changes
 
Continuous deployment
Continuous deploymentContinuous deployment
Continuous deployment
 
Changes and Bugs: Mining and Predicting Development Activities
Changes and Bugs: Mining and Predicting Development ActivitiesChanges and Bugs: Mining and Predicting Development Activities
Changes and Bugs: Mining and Predicting Development Activities
 
Studying the impact of dependency network measures on software quality
Studying the impact of dependency network measures on software quality	Studying the impact of dependency network measures on software quality
Studying the impact of dependency network measures on software quality
 
An Exploration of Challenges Limiting Pragmatic Software Defect Prediction
An Exploration of Challenges Limiting Pragmatic Software Defect PredictionAn Exploration of Challenges Limiting Pragmatic Software Defect Prediction
An Exploration of Challenges Limiting Pragmatic Software Defect Prediction
 
poster_3.0
poster_3.0poster_3.0
poster_3.0
 
Of Bugs and Men
Of Bugs and MenOf Bugs and Men
Of Bugs and Men
 
Of Bugs and Men (and Plugins too)
Of Bugs and Men (and Plugins too)Of Bugs and Men (and Plugins too)
Of Bugs and Men (and Plugins too)
 
ASE06.ppt
ASE06.pptASE06.ppt
ASE06.ppt
 
Partitioning composite code changes to facilitate code review
Partitioning composite code changes to facilitate code reviewPartitioning composite code changes to facilitate code review
Partitioning composite code changes to facilitate code review
 
Partitioning Composite Code Changes to Facilitate Code Review (MSR2015)
Partitioning Composite Code Changes to Facilitate Code Review (MSR2015)Partitioning Composite Code Changes to Facilitate Code Review (MSR2015)
Partitioning Composite Code Changes to Facilitate Code Review (MSR2015)
 
DelOps vs. DevOps
DelOps vs. DevOpsDelOps vs. DevOps
DelOps vs. DevOps
 
Using Developer Information as a Prediction Factor
Using Developer Information as a Prediction FactorUsing Developer Information as a Prediction Factor
Using Developer Information as a Prediction Factor
 
Cross-project defect prediction
Cross-project defect predictionCross-project defect prediction
Cross-project defect prediction
 
Towards Probabilistic Assessment of Modularity
Towards Probabilistic Assessment of ModularityTowards Probabilistic Assessment of Modularity
Towards Probabilistic Assessment of Modularity
 
Model Compression
Model CompressionModel Compression
Model Compression
 
(ATS3-PLAT01) Recent developments in Pipeline Pilot
(ATS3-PLAT01) Recent developments in Pipeline Pilot(ATS3-PLAT01) Recent developments in Pipeline Pilot
(ATS3-PLAT01) Recent developments in Pipeline Pilot
 
[MSR2012] An Empirical Study of Supplementary Bug Fixes
[MSR2012] An Empirical Study of Supplementary Bug Fixes[MSR2012] An Empirical Study of Supplementary Bug Fixes
[MSR2012] An Empirical Study of Supplementary Bug Fixes
 
Version control
Version controlVersion control
Version control
 
FASE08.ppt
FASE08.pptFASE08.ppt
FASE08.ppt
 

Más de CS, NcState

Lexisnexis june9
Lexisnexis june9Lexisnexis june9
Lexisnexis june9
CS, NcState
 
Ai4se lab template
Ai4se lab templateAi4se lab template
Ai4se lab template
CS, NcState
 
Automated Software Enging, Fall 2015, NCSU
Automated Software Enging, Fall 2015, NCSUAutomated Software Enging, Fall 2015, NCSU
Automated Software Enging, Fall 2015, NCSU
CS, NcState
 
Dagstuhl14 intro-v1
Dagstuhl14 intro-v1Dagstuhl14 intro-v1
Dagstuhl14 intro-v1
CS, NcState
 

Más de CS, NcState (20)

Talks2015 novdec
Talks2015 novdecTalks2015 novdec
Talks2015 novdec
 
Future se oct15
Future se oct15Future se oct15
Future se oct15
 
GALE: Geometric active learning for Search-Based Software Engineering
GALE: Geometric active learning for Search-Based Software EngineeringGALE: Geometric active learning for Search-Based Software Engineering
GALE: Geometric active learning for Search-Based Software Engineering
 
Big Data: the weakest link
Big Data: the weakest linkBig Data: the weakest link
Big Data: the weakest link
 
Three Laws of Trusted Data Sharing: (Building a Better Business Case for Dat...
Three Laws of Trusted Data Sharing:(Building a Better Business Case for Dat...Three Laws of Trusted Data Sharing:(Building a Better Business Case for Dat...
Three Laws of Trusted Data Sharing: (Building a Better Business Case for Dat...
 
Lexisnexis june9
Lexisnexis june9Lexisnexis june9
Lexisnexis june9
 
Welcome to ICSE NIER’15 (new ideas and emerging results).
Welcome to ICSE NIER’15 (new ideas and emerging results).Welcome to ICSE NIER’15 (new ideas and emerging results).
Welcome to ICSE NIER’15 (new ideas and emerging results).
 
Icse15 Tech-briefing Data Science
Icse15 Tech-briefing Data ScienceIcse15 Tech-briefing Data Science
Icse15 Tech-briefing Data Science
 
Kits to Find the Bits that Fits
Kits to Find  the Bits that Fits Kits to Find  the Bits that Fits
Kits to Find the Bits that Fits
 
Ai4se lab template
Ai4se lab templateAi4se lab template
Ai4se lab template
 
Automated Software Enging, Fall 2015, NCSU
Automated Software Enging, Fall 2015, NCSUAutomated Software Enging, Fall 2015, NCSU
Automated Software Enging, Fall 2015, NCSU
 
Requirements Engineering
Requirements EngineeringRequirements Engineering
Requirements Engineering
 
172529main ken and_tim_software_assurance_research_at_west_virginia
172529main ken and_tim_software_assurance_research_at_west_virginia172529main ken and_tim_software_assurance_research_at_west_virginia
172529main ken and_tim_software_assurance_research_at_west_virginia
 
Automated Software Engineering
Automated Software EngineeringAutomated Software Engineering
Automated Software Engineering
 
Next Generation “Treatment Learning” (finding the diamonds in the dust)
Next Generation “Treatment Learning” (finding the diamonds in the dust)Next Generation “Treatment Learning” (finding the diamonds in the dust)
Next Generation “Treatment Learning” (finding the diamonds in the dust)
 
Tim Menzies, directions in Data Science
Tim Menzies, directions in Data ScienceTim Menzies, directions in Data Science
Tim Menzies, directions in Data Science
 
Goldrush
GoldrushGoldrush
Goldrush
 
Dagstuhl14 intro-v1
Dagstuhl14 intro-v1Dagstuhl14 intro-v1
Dagstuhl14 intro-v1
 
Know thy tools
Know thy toolsKnow thy tools
Know thy tools
 
The Art and Science of Analyzing Software Data
The Art and Science of Analyzing Software DataThe Art and Science of Analyzing Software Data
The Art and Science of Analyzing Software Data
 

Último

Finding Java's Hidden Performance Traps @ DevoxxUK 2024
Finding Java's Hidden Performance Traps @ DevoxxUK 2024Finding Java's Hidden Performance Traps @ DevoxxUK 2024
Finding Java's Hidden Performance Traps @ DevoxxUK 2024
Victor Rentea
 
Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers:  A Deep Dive into Serverless Spatial Data and FMECloud Frontiers:  A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FME
Safe Software
 
Modular Monolith - a Practical Alternative to Microservices @ Devoxx UK 2024
Modular Monolith - a Practical Alternative to Microservices @ Devoxx UK 2024Modular Monolith - a Practical Alternative to Microservices @ Devoxx UK 2024
Modular Monolith - a Practical Alternative to Microservices @ Devoxx UK 2024
Victor Rentea
 

Último (20)

Exploring Multimodal Embeddings with Milvus
Exploring Multimodal Embeddings with MilvusExploring Multimodal Embeddings with Milvus
Exploring Multimodal Embeddings with Milvus
 
Rising Above_ Dubai Floods and the Fortitude of Dubai International Airport.pdf
Rising Above_ Dubai Floods and the Fortitude of Dubai International Airport.pdfRising Above_ Dubai Floods and the Fortitude of Dubai International Airport.pdf
Rising Above_ Dubai Floods and the Fortitude of Dubai International Airport.pdf
 
Ransomware_Q4_2023. The report. [EN].pdf
Ransomware_Q4_2023. The report. [EN].pdfRansomware_Q4_2023. The report. [EN].pdf
Ransomware_Q4_2023. The report. [EN].pdf
 
Apidays New York 2024 - Passkeys: Developing APIs to enable passwordless auth...
Apidays New York 2024 - Passkeys: Developing APIs to enable passwordless auth...Apidays New York 2024 - Passkeys: Developing APIs to enable passwordless auth...
Apidays New York 2024 - Passkeys: Developing APIs to enable passwordless auth...
 
Manulife - Insurer Transformation Award 2024
Manulife - Insurer Transformation Award 2024Manulife - Insurer Transformation Award 2024
Manulife - Insurer Transformation Award 2024
 
Navigating the Deluge_ Dubai Floods and the Resilience of Dubai International...
Navigating the Deluge_ Dubai Floods and the Resilience of Dubai International...Navigating the Deluge_ Dubai Floods and the Resilience of Dubai International...
Navigating the Deluge_ Dubai Floods and the Resilience of Dubai International...
 
Finding Java's Hidden Performance Traps @ DevoxxUK 2024
Finding Java's Hidden Performance Traps @ DevoxxUK 2024Finding Java's Hidden Performance Traps @ DevoxxUK 2024
Finding Java's Hidden Performance Traps @ DevoxxUK 2024
 
Connector Corner: Accelerate revenue generation using UiPath API-centric busi...
Connector Corner: Accelerate revenue generation using UiPath API-centric busi...Connector Corner: Accelerate revenue generation using UiPath API-centric busi...
Connector Corner: Accelerate revenue generation using UiPath API-centric busi...
 
TrustArc Webinar - Unlock the Power of AI-Driven Data Discovery
TrustArc Webinar - Unlock the Power of AI-Driven Data DiscoveryTrustArc Webinar - Unlock the Power of AI-Driven Data Discovery
TrustArc Webinar - Unlock the Power of AI-Driven Data Discovery
 
Apidays New York 2024 - Accelerating FinTech Innovation by Vasa Krishnan, Fin...
Apidays New York 2024 - Accelerating FinTech Innovation by Vasa Krishnan, Fin...Apidays New York 2024 - Accelerating FinTech Innovation by Vasa Krishnan, Fin...
Apidays New York 2024 - Accelerating FinTech Innovation by Vasa Krishnan, Fin...
 
Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers:  A Deep Dive into Serverless Spatial Data and FMECloud Frontiers:  A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FME
 
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemke
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemkeProductAnonymous-April2024-WinProductDiscovery-MelissaKlemke
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemke
 
presentation ICT roal in 21st century education
presentation ICT roal in 21st century educationpresentation ICT roal in 21st century education
presentation ICT roal in 21st century education
 
CNIC Information System with Pakdata Cf In Pakistan
CNIC Information System with Pakdata Cf In PakistanCNIC Information System with Pakdata Cf In Pakistan
CNIC Information System with Pakdata Cf In Pakistan
 
AWS Community Day CPH - Three problems of Terraform
AWS Community Day CPH - Three problems of TerraformAWS Community Day CPH - Three problems of Terraform
AWS Community Day CPH - Three problems of Terraform
 
Apidays New York 2024 - The Good, the Bad and the Governed by David O'Neill, ...
Apidays New York 2024 - The Good, the Bad and the Governed by David O'Neill, ...Apidays New York 2024 - The Good, the Bad and the Governed by David O'Neill, ...
Apidays New York 2024 - The Good, the Bad and the Governed by David O'Neill, ...
 
Spring Boot vs Quarkus the ultimate battle - DevoxxUK
Spring Boot vs Quarkus the ultimate battle - DevoxxUKSpring Boot vs Quarkus the ultimate battle - DevoxxUK
Spring Boot vs Quarkus the ultimate battle - DevoxxUK
 
Web Form Automation for Bonterra Impact Management (fka Social Solutions Apri...
Web Form Automation for Bonterra Impact Management (fka Social Solutions Apri...Web Form Automation for Bonterra Impact Management (fka Social Solutions Apri...
Web Form Automation for Bonterra Impact Management (fka Social Solutions Apri...
 
Axa Assurance Maroc - Insurer Innovation Award 2024
Axa Assurance Maroc - Insurer Innovation Award 2024Axa Assurance Maroc - Insurer Innovation Award 2024
Axa Assurance Maroc - Insurer Innovation Award 2024
 
Modular Monolith - a Practical Alternative to Microservices @ Devoxx UK 2024
Modular Monolith - a Practical Alternative to Microservices @ Devoxx UK 2024Modular Monolith - a Practical Alternative to Microservices @ Devoxx UK 2024
Modular Monolith - a Practical Alternative to Microservices @ Devoxx UK 2024
 

Promise 2011: "Does Measuring Code Change Improve Fault Prediction?"

  • 1. Code Change and Fault Prediction Tom Ostrand, Robert Bell, Elaine Weyuker AT&T Labs – Research Florham Park, NJ, USA PROMISE 2011 Banff, Alberta, September 20-21, 2011 © 2007 AT&T Knowledge Ventures. All rights reserved. AT&T and the AT&T logo are trademarks of AT&T Knowledge Ventures.
  • 2. Overview •Do measures of code change or churn provide useful input to fault prediction models? •Standard model •Base models •Churn-augmented models
  • 3. The Standard Model • Underlying statistical model • Negative binomial regression • Output (dependent) variable • Predicted fault count in each file of release n • Predictor (independent) variables • KLOC (n) • Previous faults (n-1) • Previous changes (n-1, n-2) • File age (number of releases) • File type (C,C++,java,sql,make,sh,perl,...)
  • 4. Evaluating prediction models • Model produces ranking of files in a release, from predicted most faults to fewest faults • Choose cutoff point in ranking, X% • Yield = percent of all faults in the release that are in the first X% of the ranked files We’ve usually evaluated models at a 20% cutoff. • Fault-percentile average (FPA) is the average yield over all values of X
  • 5. Prediction Results, from the Standard Model Percent of faults in top 20% of files FPA 100 90 93 93 91 93 92 80 88 88 87 83 83 81 70 75 76 60 50 40 30 20 10 0
  • 6. Measures of Code Change •Changed/not changed •Number of changes during a release •Number of lines added •Number of lines deleted •Number of lines modified •Relative churn (line changes/LOC)
  • 7. Two Subject Systems Large provisioning system • 18 releases, 5 year lifespan • 6 programming languages: • Java (60%), C, C++, SQL, SQL-C, SQL-C++ • 3000+ files • 1.5Mil LOC • Average of 395 faults/release
  • 8. Two Subject Systems Utility, data aggregation system • 18 releases, 5 year lifespan • >10 programming languages: • Java (77%), Perl, xml, sh, ... • 800 files • 280K LOC • Average of 90 faults/release
  • 9. Distribution of files, averages over all releases. Percent of Files: Provisioning Percent of Files: Utility 6.8% 1.6% 15.1% 11.0% New New Changed Changed Unchanged Unchanged 82.2% 84.4%
  • 10. Where do faults occur? Distribution of faults over files Faults/file: Provisioning Faults/file: Utility 0.02 0.12 0.24 New New Changed Changed Unchanged Unchanged 0.80 0.82
  • 11. Provisioning system faults per file, by release Faults per File, by Change Status and Release 2.5 2 Fault-per-File 1.5 1 0.5 0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 Release New (Mean=0.24) Unchanged (Mean=0.02) Changed (Mean=0.80)
  • 12. Utility system faults per file, by release Faults per File, by Change Status and Release 3 2.5 2 Faults per file 1.5 1 0.5 0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 New (Mean=.09) Unchanged (Mean=.002) Changed (Mean=.92)
  • 13. Potential predictor combinations • Added lines only • Deleted lines only • Modified lines only • Adds & Deletes • Adds & Mods • Deletes & Mods • Adds & Deletes & Mods • Relative values: changed lines/LOC
  • 14. Distribution of change combinations, all check-ins, all releases: Provisioning system Number of Files Mods, 683 Deletes, 296 M & D & A, 2625 Adds, 597 Mods & Deletes, 168 Mods & Adds, 1894 Deletes & Adds, 126
  • 15. Average lines touched for each combination of changes Average Lines touched Mods, 4 Deletes, 5 Mods & Adds, Deletes, 23 21 Mods & Adds, 37 M & D & A, 210 Deletes & Adds, 21
  • 16. Faults per file, changed files only: Provisioning system Faults per File Deletes, 0.04 Mods, 0.19 Adds, 0.3 Mods & M & D & A, 1.38 Deletes, 0.36 Mods & Adds, 0.55 Deletes & Adds, 0.5
  • 17. Fault prediction models •Univariate models •Base model: log(KLOC), File age, File type •Augmented models: • Previous Changes • Previous {Adds / Deletes / Mods} • Previous Adds + Deletes + Modifications • Previous {Adds / Deletes / Mods} / LOC (relative churn) • Previous Developers
  • 18. Fault-percentile averages for univariate predictor models: Provisioning system (best result from raw variable, square root, fourth root) FPA, univariate models Standard Model Age Language Prior Lines Deleted Prior Faults Prior Changed Prior Lines Modified Prior Lines Added Prior Developers Prior Adds+Deletes+Mods Prior Changes log(KLOC) 0% 10% 20% 30% 40% 50% 60% 70% 80% 90% 100%
  • 19. Base Model 1 • KLOC • File age (number of releases) • File type (C,C++,java,sql,make,sh,perl,...)
  • 20. Base Model 1, and added variables Mean FPA, Provisioning System Mean FPA, Utility System Standard Model Standard Model prev-changes prev-changes prev-adds,dels,mods prev-adds,dels,mods (prev-adds,dels,mods)/LOC prev-developers prev-developers prev-adds prev-adds prev-changed prev-changed prev-mods prev-mods prev-deletes prev-deletes prev-prev changes prev-prev changes Base 1 Base 1 89 90 91 92 93 94 87 88 89 90 91 92 93 • Base model 1 • KLOC • File age (number of releases) • File type (C,C++,java,sql,make,sh,perl,...)
  • 21. Base Model 2 • KLOC • File age (number of releases) • File type (C,C++,java,sql,make,sh,perl,...) • (Previous changes)1/2
  • 22. Base Model 2, and added variables Mean FPA, Provisioning System prev-prev changes prev-adds,dels,mods prev-adds prev-mods prev-developers (prev-adds,dels,mods)/LOC prev-deletes prev-changed Base 2 93.2 93.25 93.3 93.35 93.4 93.45 93.5 93.55 • Base model 2 • KLOC • File age (number of releases) • File type (C,C++,java,sql,make,sh,perl,...) • (Previous changes)1/2
  • 23. Summary • Churn can be an effective aid for improving fault prediction • {Adds+Deletes+Mods} improves the accuracy of a model that doesn’t include any change information BUT • a simple count of prior changes slightly outperforms {Adds+Deletes+Mods} • Prior changed is nearly as good as either, when added to a model without change info • Lines added is the most effective single predictor • Lines deleted is least effective single predictor • Relative churn is no better than absolute churn for predicting total fault count