SlideShare uma empresa Scribd logo
1 de 27
Baixar para ler offline
When
Do Changes Induce Fixes?
                On Fridays.

Jacek Śliwerski, Thomas Zimmermann, Andreas Zeller
                Saarland University
The Risk of Change

Which changes go wrong?
How do we find such “bad” changes?
What can we do with them?
Idea:
combine bug databases + version archives
=> locate fix-inducing changes
The Risk of Change

Which changes go wrong?
How do we find such “bad” changes?
What can we do with them?
Idea:
combine bug databases + version archives
=> locate fix-inducing changes
Fix-Inducing Changes
Fix-Inducing Changes are
Changes that lead to problems as
indicated by later fixes.
                      Later:
Example:
...                   ...
if (foo==null) {      if (foo!=null) {
    foo.bar();            foo.bar();

FIX-INDUCING                   FIX
How to
Locate Fix-Inducing Changes
How to
Locate Fix-Inducing Changes
      $ cvs annotate -r 1.17   Foo.java
      ...
19:   1.11 (john 12-Feb-03):   public int a() {
20:   1.11 (john 12-Feb-03):       return i/0;
      ...
39:   1.10 (mary 12-Jan-03):   public int b() {
40:   1.14 (kate 23-May-03):       return 42;
      ...
59:   1.10 (mary 17-Jan-03):   public void c() {
60:   1.16 (mary 10-Jun-03):       int i=0;


                                                       1.18
                                                   Fixed Bug
                                                   42233
                                                   Changed:
                                                   a() b() c()
                                             line 20 40 60
How to
Locate Fix-Inducing Changes
     $ cvs annotate -r 1.17 Foo.java

 20: 1.11 (john 12-Feb-03):      return i/0;
 40: 1.14 (kate 23-May-03):      return 42;
 60: 1.16 (mary 10-Jun-03):      int i=0;




   1.11                 1.14           1.16         1.18
 a() was          b() was        c() was        Fixed Bug
 changed          changed        changed        42233
                                                Changed:
FIX-INDUCING      FIX-INDUCING   FIX-INDUCING
                                                a() b() c()
Bug
 How to
Locate Fix-Inducing Changes
     $ cvs annotate -r 1.17 Foo.java

 20: 1.11 (john 12-Feb-03):        return i/0;
 40: 1.14 (kate 23-May-03):        return 42;
 60: 1.16 (mary 10-Jun-03):        int i=0;



               Bug 42233 was reported.            closed.




   1.11                  1.14            1.16               1.18
 a() was           b() was          c() was          Fixed Bug
 changed           changed          changed          42233
                                                     Changed:
FIX-INDUCING      FIX-INDUCING     FIX-INDUCING
                                                     a() b() c()
BUG-INDUCING
Bug-Inducing Changes
are Indicators for Risk
Large Transactions
          are Risky
     Average Number of Changed Files

              Bug-      Not Bug-
                                      All
            Inducing    Inducing
   Fix
Not a Fix
   All                                3.52

ECLIPSE, for MOZILLA the average is 3.58.
Large Transactions
          are Risky
     Average Number of Changed Files

              Bug-     Not Bug-
                                     All
            Inducing   Inducing
   Fix                              2.73
Not a Fix                           3.81
   All                              3.52

ECLIPSE, for MOZILLA the other way round.
Large Transactions
          are Risky
     Average Number of Changed Files

              Bug-     Not Bug-
                                     All
            Inducing   Inducing
   Fix                              2.73
Not a Fix                           3.81
   All        7.49       2.61       3.52

ECLIPSE, for MOZILLA the same tendency.
Large Transactions
          are Risky
     Average Number of Changed Files

               Bug-      Not Bug-
                                        All
             Inducing    Inducing
   Fix         3.82        2.08        2.73
Not a Fix      11.30       2.77        3.81
   All         7.49        2.61        3.52

ECLIPSE, for MOZILLA a different distribution.
Fridays are Risky,
         Tuesdays are not ;-)
                                                                        Frequency
                             11.3%
  Monday                                       18.4%

                                                                        20.9% of all changes
                         10.4%
  Tuesday
                                                                        on Tuesday are fixes,
                                                       20.9%

                             11.1%
                                                                        10.4% induce bugs.
Wednesday                                          20.0%

                               12.1%
 Thursday                                                22.3%

                               12.2%
    Friday                                                     24.0%

                              11.7%
 Saturday                              14.7%

                              11.6%
   Sunday                                  16.9%

             0%   5%   10%           15%       20%         25%         30%   35%    40%
                                                                   Fixes
                              ECLIPSE
                                                                   Bug-Inducing Changes
Fixes are very Risky
                                                                  Likelihood
                         8.2%
  Monday                                             25.1%

                                                                  that a Change
                       7.1%
  Tuesday                                        22.9%

                                                                  is Bug-Inducing
                         8.1%
Wednesday                                        23.3%
                                                                  22.9% of all fixes on
                          8.8%
 Thursday
                                                                  Tuesday induce bugs,
                                                  23.5%

                                                                  only 7.1% of changes
                          8.7%
    Friday                                       23.2%
                                                                  for new features do.
                         8.4%
 Saturday                                                          30.3%

                          8.6%
   Sunday                                                 26.4%

             0%   5%      10%      15%     20%   25%         30%           35%   40%

                                 ECLIPSE          Fixes           New Features, Refactoring
Is MOZILLA broken?

Fix transactions are larger than regular
transactions (4.39 vs 3.05 files).
48.5% of all revisions are fixes,
41.5% induce later bugs.
A fix induces in 45.2% a later bugs,
regular changes in “only” 38.1%.
For earthquakes and crime rates...


  Risk depends on Locations
                 The same with risk of changes!
resolveClasspath()
/* (non-Javadoc)
 * @see org.eclipse.jdt.launching.IRuntimeClasspathProvider#resolveClasspath
 * (org.eclipse.jdt.launching.IRuntimeClasspathEntry[], org.eclipse.debug.core.ILaunchConfiguration)
 */
public IRuntimeClasspathEntry[] resolveClasspath(IRuntimeClasspathEntry[] entries, ILaunchConfiguration configuration)
  throws CoreException {
  List all = new ArrayList(entries.length);
  for (int i = 0; i < entries.length; i++) {
    switch (entries[i].getType()) {
      case IRuntimeClasspathEntry.PROJECT:
       // a project resolves to itself for source lookup (rather than the class file output locations)
       all.add(entries[i]);
       break;

                                        9 changes,
      case IRuntimeClasspathEntry.OTHER:
       IRuntimeClasspathEntry2 entry = (IRuntimeClasspathEntry2)entries[i];
       if (entry.getTypeId().equals(DefaultProjectClasspathEntry.TYPE_ID)) {
                                    all of them fixes
         // add the resolved children of the project
         IRuntimeClasspathEntry[] children = entry.getRuntimeClasspathEntries(configuration);

                                 8 bug-inducing changes
         IRuntimeClasspathEntry[] res = JavaRuntime.resolveSourceLookupPath(children, configuration);
         for (int j = 0; j < res.length; j++) {
           all.add(res[j]);

                                  one re-implementation
         }
       }
       break;
      default:
       IRuntimeClasspathEntry[] resolved =JavaRuntime.resolveRuntimeClasspathEntry(entries[i], configuration);
       for (int j = 0; j < resolved.length; j++) {
         all.add(resolved[j]);
       }
       break;
    }
  }
  return (IRuntimeClasspathEntry[])all.toArray(new IRuntimeClasspathEntry[all.size()]);
}
Movie with
John Wayne
   (1962)




                      Swahili for
                       “Danger”
            HATARI
    Raising Risk Awareness
HATARI: Annotations

Unrisky Location
     (green)


 Risky Location
   (dark red)
Conclusion

Fix- and Bug-inducing changes are an
measure for (past) risk.
We make this risk visible for developers.
HATARI will be released in August 2005
http://www.st.cs.uni-sb.de/softevo/
Until then: Don’t program on Fridays! ;-)
Sign Gallery
When do changes induce fixes?
When do changes induce fixes?
When do changes induce fixes?
When do changes induce fixes?

Mais conteúdo relacionado

Mais de Thomas Zimmermann

Analytics for software development
Analytics for software developmentAnalytics for software development
Analytics for software development
Thomas Zimmermann
 

Mais de Thomas Zimmermann (20)

Data driven games user research
Data driven games user researchData driven games user research
Data driven games user research
 
Not my bug! Reasons for software bug report reassignments
Not my bug! Reasons for software bug report reassignmentsNot my bug! Reasons for software bug report reassignments
Not my bug! Reasons for software bug report reassignments
 
Empirical Software Engineering at Microsoft Research
Empirical Software Engineering at Microsoft ResearchEmpirical Software Engineering at Microsoft Research
Empirical Software Engineering at Microsoft Research
 
Security trend analysis with CVE topic models
Security trend analysis with CVE topic modelsSecurity trend analysis with CVE topic models
Security trend analysis with CVE topic models
 
Analytics for software development
Analytics for software developmentAnalytics for software development
Analytics for software development
 
Characterizing and predicting which bugs get fixed
Characterizing and predicting which bugs get fixedCharacterizing and predicting which bugs get fixed
Characterizing and predicting which bugs get fixed
 
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
 
Cross-project defect prediction
Cross-project defect predictionCross-project defect prediction
Cross-project defect prediction
 
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
 
Predicting Defects using Network Analysis on Dependency Graphs
Predicting Defects using Network Analysis on Dependency GraphsPredicting Defects using Network Analysis on Dependency Graphs
Predicting Defects using Network Analysis on Dependency Graphs
 
Quality of Bug Reports in Open Source
Quality of Bug Reports in Open SourceQuality of Bug Reports in Open Source
Quality of Bug Reports in Open Source
 
Meet Tom and his Fish
Meet Tom and his FishMeet Tom and his Fish
Meet Tom and his Fish
 
Predicting Subsystem Defects using Dependency Graph Complexities
Predicting Subsystem Defects using Dependency Graph Complexities Predicting Subsystem Defects using Dependency Graph Complexities
Predicting Subsystem Defects using Dependency Graph Complexities
 
Got Myth? Myths in Software Engineering
Got Myth? Myths in Software EngineeringGot Myth? Myths in Software Engineering
Got Myth? Myths in Software Engineering
 
Mining Workspace Updates in CVS
Mining Workspace Updates in CVSMining Workspace Updates in CVS
Mining Workspace Updates in CVS
 
Mining Software Archives to Support Software Development
Mining Software Archives to Support Software DevelopmentMining Software Archives to Support Software Development
Mining Software Archives to Support Software Development
 
Unit testing with JUnit
Unit testing with JUnitUnit testing with JUnit
Unit testing with JUnit
 
esolang: Esoterische Programmiersprachen
esolang: Esoterische Programmiersprachenesolang: Esoterische Programmiersprachen
esolang: Esoterische Programmiersprachen
 
TA-RE: An Exchange Language for Mining Software Repositories
TA-RE: An Exchange Language for Mining Software RepositoriesTA-RE: An Exchange Language for Mining Software Repositories
TA-RE: An Exchange Language for Mining Software Repositories
 
Fine-grained Processing of CVS Archives with APFEL
Fine-grained Processing of CVS Archives with APFELFine-grained Processing of CVS Archives with APFEL
Fine-grained Processing of CVS Archives with APFEL
 

Último

+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...
+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...
+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...
?#DUbAI#??##{{(☎️+971_581248768%)**%*]'#abortion pills for sale in dubai@
 
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)

How to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected WorkerHow to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected Worker
 
+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...
+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...
+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...
 
Platformless Horizons for Digital Adaptability
Platformless Horizons for Digital AdaptabilityPlatformless Horizons for Digital Adaptability
Platformless Horizons for Digital Adaptability
 
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...
 
[BuildWithAI] Introduction to Gemini.pdf
[BuildWithAI] Introduction to Gemini.pdf[BuildWithAI] Introduction to Gemini.pdf
[BuildWithAI] Introduction to Gemini.pdf
 
Apidays New York 2024 - APIs in 2030: The Risk of Technological Sleepwalk by ...
Apidays New York 2024 - APIs in 2030: The Risk of Technological Sleepwalk by ...Apidays New York 2024 - APIs in 2030: The Risk of Technological Sleepwalk by ...
Apidays New York 2024 - APIs in 2030: The Risk of Technological Sleepwalk by ...
 
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
 
Introduction to Multilingual Retrieval Augmented Generation (RAG)
Introduction to Multilingual Retrieval Augmented Generation (RAG)Introduction to Multilingual Retrieval Augmented Generation (RAG)
Introduction to Multilingual Retrieval Augmented Generation (RAG)
 
Six Myths about Ontologies: The Basics of Formal Ontology
Six Myths about Ontologies: The Basics of Formal OntologySix Myths about Ontologies: The Basics of Formal Ontology
Six Myths about Ontologies: The Basics of Formal Ontology
 
Apidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, Adobe
Apidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, AdobeApidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, Adobe
Apidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, Adobe
 
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
 
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
 
ICT role in 21st century education and its challenges
ICT role in 21st century education and its challengesICT role in 21st century education and its challenges
ICT role in 21st century education and its challenges
 
Strategize a Smooth Tenant-to-tenant Migration and Copilot Takeoff
Strategize a Smooth Tenant-to-tenant Migration and Copilot TakeoffStrategize a Smooth Tenant-to-tenant Migration and Copilot Takeoff
Strategize a Smooth Tenant-to-tenant Migration and Copilot Takeoff
 
Corporate and higher education May webinar.pptx
Corporate and higher education May webinar.pptxCorporate and higher education May webinar.pptx
Corporate and higher education May webinar.pptx
 
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
 
Exploring Multimodal Embeddings with Milvus
Exploring Multimodal Embeddings with MilvusExploring Multimodal Embeddings with Milvus
Exploring Multimodal Embeddings with Milvus
 
Understanding the FAA Part 107 License ..
Understanding the FAA Part 107 License ..Understanding the FAA Part 107 License ..
Understanding the FAA Part 107 License ..
 
Artificial Intelligence Chap.5 : Uncertainty
Artificial Intelligence Chap.5 : UncertaintyArtificial Intelligence Chap.5 : Uncertainty
Artificial Intelligence Chap.5 : Uncertainty
 
Polkadot JAM Slides - Token2049 - By Dr. Gavin Wood
Polkadot JAM Slides - Token2049 - By Dr. Gavin WoodPolkadot JAM Slides - Token2049 - By Dr. Gavin Wood
Polkadot JAM Slides - Token2049 - By Dr. Gavin Wood
 

When do changes induce fixes?

  • 1. When Do Changes Induce Fixes? On Fridays. Jacek Śliwerski, Thomas Zimmermann, Andreas Zeller Saarland University
  • 2. The Risk of Change Which changes go wrong? How do we find such “bad” changes? What can we do with them? Idea: combine bug databases + version archives => locate fix-inducing changes
  • 3. The Risk of Change Which changes go wrong? How do we find such “bad” changes? What can we do with them? Idea: combine bug databases + version archives => locate fix-inducing changes
  • 4. Fix-Inducing Changes Fix-Inducing Changes are Changes that lead to problems as indicated by later fixes. Later: Example: ... ... if (foo==null) { if (foo!=null) { foo.bar(); foo.bar(); FIX-INDUCING FIX
  • 6. How to Locate Fix-Inducing Changes $ cvs annotate -r 1.17 Foo.java ... 19: 1.11 (john 12-Feb-03): public int a() { 20: 1.11 (john 12-Feb-03): return i/0; ... 39: 1.10 (mary 12-Jan-03): public int b() { 40: 1.14 (kate 23-May-03): return 42; ... 59: 1.10 (mary 17-Jan-03): public void c() { 60: 1.16 (mary 10-Jun-03): int i=0; 1.18 Fixed Bug 42233 Changed: a() b() c() line 20 40 60
  • 7. How to Locate Fix-Inducing Changes $ cvs annotate -r 1.17 Foo.java 20: 1.11 (john 12-Feb-03): return i/0; 40: 1.14 (kate 23-May-03): return 42; 60: 1.16 (mary 10-Jun-03): int i=0; 1.11 1.14 1.16 1.18 a() was b() was c() was Fixed Bug changed changed changed 42233 Changed: FIX-INDUCING FIX-INDUCING FIX-INDUCING a() b() c()
  • 8. Bug How to Locate Fix-Inducing Changes $ cvs annotate -r 1.17 Foo.java 20: 1.11 (john 12-Feb-03): return i/0; 40: 1.14 (kate 23-May-03): return 42; 60: 1.16 (mary 10-Jun-03): int i=0; Bug 42233 was reported. closed. 1.11 1.14 1.16 1.18 a() was b() was c() was Fixed Bug changed changed changed 42233 Changed: FIX-INDUCING FIX-INDUCING FIX-INDUCING a() b() c() BUG-INDUCING
  • 10. Large Transactions are Risky Average Number of Changed Files Bug- Not Bug- All Inducing Inducing Fix Not a Fix All 3.52 ECLIPSE, for MOZILLA the average is 3.58.
  • 11. Large Transactions are Risky Average Number of Changed Files Bug- Not Bug- All Inducing Inducing Fix 2.73 Not a Fix 3.81 All 3.52 ECLIPSE, for MOZILLA the other way round.
  • 12. Large Transactions are Risky Average Number of Changed Files Bug- Not Bug- All Inducing Inducing Fix 2.73 Not a Fix 3.81 All 7.49 2.61 3.52 ECLIPSE, for MOZILLA the same tendency.
  • 13. Large Transactions are Risky Average Number of Changed Files Bug- Not Bug- All Inducing Inducing Fix 3.82 2.08 2.73 Not a Fix 11.30 2.77 3.81 All 7.49 2.61 3.52 ECLIPSE, for MOZILLA a different distribution.
  • 14. Fridays are Risky, Tuesdays are not ;-) Frequency 11.3% Monday 18.4% 20.9% of all changes 10.4% Tuesday on Tuesday are fixes, 20.9% 11.1% 10.4% induce bugs. Wednesday 20.0% 12.1% Thursday 22.3% 12.2% Friday 24.0% 11.7% Saturday 14.7% 11.6% Sunday 16.9% 0% 5% 10% 15% 20% 25% 30% 35% 40% Fixes ECLIPSE Bug-Inducing Changes
  • 15. Fixes are very Risky Likelihood 8.2% Monday 25.1% that a Change 7.1% Tuesday 22.9% is Bug-Inducing 8.1% Wednesday 23.3% 22.9% of all fixes on 8.8% Thursday Tuesday induce bugs, 23.5% only 7.1% of changes 8.7% Friday 23.2% for new features do. 8.4% Saturday 30.3% 8.6% Sunday 26.4% 0% 5% 10% 15% 20% 25% 30% 35% 40% ECLIPSE Fixes New Features, Refactoring
  • 16. Is MOZILLA broken? Fix transactions are larger than regular transactions (4.39 vs 3.05 files). 48.5% of all revisions are fixes, 41.5% induce later bugs. A fix induces in 45.2% a later bugs, regular changes in “only” 38.1%.
  • 17. For earthquakes and crime rates... Risk depends on Locations The same with risk of changes!
  • 18. resolveClasspath() /* (non-Javadoc) * @see org.eclipse.jdt.launching.IRuntimeClasspathProvider#resolveClasspath * (org.eclipse.jdt.launching.IRuntimeClasspathEntry[], org.eclipse.debug.core.ILaunchConfiguration) */ public IRuntimeClasspathEntry[] resolveClasspath(IRuntimeClasspathEntry[] entries, ILaunchConfiguration configuration) throws CoreException { List all = new ArrayList(entries.length); for (int i = 0; i < entries.length; i++) { switch (entries[i].getType()) { case IRuntimeClasspathEntry.PROJECT: // a project resolves to itself for source lookup (rather than the class file output locations) all.add(entries[i]); break; 9 changes, case IRuntimeClasspathEntry.OTHER: IRuntimeClasspathEntry2 entry = (IRuntimeClasspathEntry2)entries[i]; if (entry.getTypeId().equals(DefaultProjectClasspathEntry.TYPE_ID)) { all of them fixes // add the resolved children of the project IRuntimeClasspathEntry[] children = entry.getRuntimeClasspathEntries(configuration); 8 bug-inducing changes IRuntimeClasspathEntry[] res = JavaRuntime.resolveSourceLookupPath(children, configuration); for (int j = 0; j < res.length; j++) { all.add(res[j]); one re-implementation } } break; default: IRuntimeClasspathEntry[] resolved =JavaRuntime.resolveRuntimeClasspathEntry(entries[i], configuration); for (int j = 0; j < resolved.length; j++) { all.add(resolved[j]); } break; } } return (IRuntimeClasspathEntry[])all.toArray(new IRuntimeClasspathEntry[all.size()]); }
  • 19.
  • 20. Movie with John Wayne (1962) Swahili for “Danger” HATARI Raising Risk Awareness
  • 21. HATARI: Annotations Unrisky Location (green) Risky Location (dark red)
  • 22. Conclusion Fix- and Bug-inducing changes are an measure for (past) risk. We make this risk visible for developers. HATARI will be released in August 2005 http://www.st.cs.uni-sb.de/softevo/ Until then: Don’t program on Fridays! ;-)