SlideShare a Scribd company logo
1 of 27
Download to read 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?

More Related Content

More from Thomas Zimmermann

Data driven games user research
Data driven games user researchData driven games user research
Data driven games user researchThomas Zimmermann
 
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 reassignmentsThomas Zimmermann
 
Empirical Software Engineering at Microsoft Research
Empirical Software Engineering at Microsoft ResearchEmpirical Software Engineering at Microsoft Research
Empirical Software Engineering at Microsoft ResearchThomas Zimmermann
 
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 modelsThomas Zimmermann
 
Analytics for software development
Analytics for software developmentAnalytics for software development
Analytics for software developmentThomas Zimmermann
 
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 fixedThomas Zimmermann
 
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 ActivitiesThomas Zimmermann
 
Cross-project defect prediction
Cross-project defect predictionCross-project defect prediction
Cross-project defect predictionThomas Zimmermann
 
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 ActivitiesThomas Zimmermann
 
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 GraphsThomas Zimmermann
 
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 SourceThomas Zimmermann
 
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 Thomas Zimmermann
 
Got Myth? Myths in Software Engineering
Got Myth? Myths in Software EngineeringGot Myth? Myths in Software Engineering
Got Myth? Myths in Software EngineeringThomas Zimmermann
 
Mining Workspace Updates in CVS
Mining Workspace Updates in CVSMining Workspace Updates in CVS
Mining Workspace Updates in CVSThomas Zimmermann
 
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 DevelopmentThomas Zimmermann
 
esolang: Esoterische Programmiersprachen
esolang: Esoterische Programmiersprachenesolang: Esoterische Programmiersprachen
esolang: Esoterische ProgrammiersprachenThomas Zimmermann
 
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 RepositoriesThomas Zimmermann
 
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 APFELThomas Zimmermann
 

More from 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
 

Recently uploaded

SAP Build Work Zone - Overview L2-L3.pptx
SAP Build Work Zone - Overview L2-L3.pptxSAP Build Work Zone - Overview L2-L3.pptx
SAP Build Work Zone - Overview L2-L3.pptxNavinnSomaal
 
TeamStation AI System Report LATAM IT Salaries 2024
TeamStation AI System Report LATAM IT Salaries 2024TeamStation AI System Report LATAM IT Salaries 2024
TeamStation AI System Report LATAM IT Salaries 2024Lonnie McRorey
 
SIP trunking in Janus @ Kamailio World 2024
SIP trunking in Janus @ Kamailio World 2024SIP trunking in Janus @ Kamailio World 2024
SIP trunking in Janus @ Kamailio World 2024Lorenzo Miniero
 
Vertex AI Gemini Prompt Engineering Tips
Vertex AI Gemini Prompt Engineering TipsVertex AI Gemini Prompt Engineering Tips
Vertex AI Gemini Prompt Engineering TipsMiki Katsuragi
 
Connect Wave/ connectwave Pitch Deck Presentation
Connect Wave/ connectwave Pitch Deck PresentationConnect Wave/ connectwave Pitch Deck Presentation
Connect Wave/ connectwave Pitch Deck PresentationSlibray Presentation
 
DevoxxFR 2024 Reproducible Builds with Apache Maven
DevoxxFR 2024 Reproducible Builds with Apache MavenDevoxxFR 2024 Reproducible Builds with Apache Maven
DevoxxFR 2024 Reproducible Builds with Apache MavenHervé Boutemy
 
H2O.ai CEO/Founder: Sri Ambati Keynote at Wells Fargo Day
H2O.ai CEO/Founder: Sri Ambati Keynote at Wells Fargo DayH2O.ai CEO/Founder: Sri Ambati Keynote at Wells Fargo Day
H2O.ai CEO/Founder: Sri Ambati Keynote at Wells Fargo DaySri Ambati
 
Ensuring Technical Readiness For Copilot in Microsoft 365
Ensuring Technical Readiness For Copilot in Microsoft 365Ensuring Technical Readiness For Copilot in Microsoft 365
Ensuring Technical Readiness For Copilot in Microsoft 3652toLead Limited
 
How AI, OpenAI, and ChatGPT impact business and software.
How AI, OpenAI, and ChatGPT impact business and software.How AI, OpenAI, and ChatGPT impact business and software.
How AI, OpenAI, and ChatGPT impact business and software.Curtis Poe
 
"ML in Production",Oleksandr Bagan
"ML in Production",Oleksandr Bagan"ML in Production",Oleksandr Bagan
"ML in Production",Oleksandr BaganFwdays
 
Take control of your SAP testing with UiPath Test Suite
Take control of your SAP testing with UiPath Test SuiteTake control of your SAP testing with UiPath Test Suite
Take control of your SAP testing with UiPath Test SuiteDianaGray10
 
Powerpoint exploring the locations used in television show Time Clash
Powerpoint exploring the locations used in television show Time ClashPowerpoint exploring the locations used in television show Time Clash
Powerpoint exploring the locations used in television show Time Clashcharlottematthew16
 
TrustArc Webinar - How to Build Consumer Trust Through Data Privacy
TrustArc Webinar - How to Build Consumer Trust Through Data PrivacyTrustArc Webinar - How to Build Consumer Trust Through Data Privacy
TrustArc Webinar - How to Build Consumer Trust Through Data PrivacyTrustArc
 
DSPy a system for AI to Write Prompts and Do Fine Tuning
DSPy a system for AI to Write Prompts and Do Fine TuningDSPy a system for AI to Write Prompts and Do Fine Tuning
DSPy a system for AI to Write Prompts and Do Fine TuningLars Bell
 
Unraveling Multimodality with Large Language Models.pdf
Unraveling Multimodality with Large Language Models.pdfUnraveling Multimodality with Large Language Models.pdf
Unraveling Multimodality with Large Language Models.pdfAlex Barbosa Coqueiro
 
Scanning the Internet for External Cloud Exposures via SSL Certs
Scanning the Internet for External Cloud Exposures via SSL CertsScanning the Internet for External Cloud Exposures via SSL Certs
Scanning the Internet for External Cloud Exposures via SSL CertsRizwan Syed
 
Unleash Your Potential - Namagunga Girls Coding Club
Unleash Your Potential - Namagunga Girls Coding ClubUnleash Your Potential - Namagunga Girls Coding Club
Unleash Your Potential - Namagunga Girls Coding ClubKalema Edgar
 
DevEX - reference for building teams, processes, and platforms
DevEX - reference for building teams, processes, and platformsDevEX - reference for building teams, processes, and platforms
DevEX - reference for building teams, processes, and platformsSergiu Bodiu
 
"Subclassing and Composition – A Pythonic Tour of Trade-Offs", Hynek Schlawack
"Subclassing and Composition – A Pythonic Tour of Trade-Offs", Hynek Schlawack"Subclassing and Composition – A Pythonic Tour of Trade-Offs", Hynek Schlawack
"Subclassing and Composition – A Pythonic Tour of Trade-Offs", Hynek SchlawackFwdays
 

Recently uploaded (20)

SAP Build Work Zone - Overview L2-L3.pptx
SAP Build Work Zone - Overview L2-L3.pptxSAP Build Work Zone - Overview L2-L3.pptx
SAP Build Work Zone - Overview L2-L3.pptx
 
TeamStation AI System Report LATAM IT Salaries 2024
TeamStation AI System Report LATAM IT Salaries 2024TeamStation AI System Report LATAM IT Salaries 2024
TeamStation AI System Report LATAM IT Salaries 2024
 
SIP trunking in Janus @ Kamailio World 2024
SIP trunking in Janus @ Kamailio World 2024SIP trunking in Janus @ Kamailio World 2024
SIP trunking in Janus @ Kamailio World 2024
 
Vertex AI Gemini Prompt Engineering Tips
Vertex AI Gemini Prompt Engineering TipsVertex AI Gemini Prompt Engineering Tips
Vertex AI Gemini Prompt Engineering Tips
 
Connect Wave/ connectwave Pitch Deck Presentation
Connect Wave/ connectwave Pitch Deck PresentationConnect Wave/ connectwave Pitch Deck Presentation
Connect Wave/ connectwave Pitch Deck Presentation
 
DevoxxFR 2024 Reproducible Builds with Apache Maven
DevoxxFR 2024 Reproducible Builds with Apache MavenDevoxxFR 2024 Reproducible Builds with Apache Maven
DevoxxFR 2024 Reproducible Builds with Apache Maven
 
H2O.ai CEO/Founder: Sri Ambati Keynote at Wells Fargo Day
H2O.ai CEO/Founder: Sri Ambati Keynote at Wells Fargo DayH2O.ai CEO/Founder: Sri Ambati Keynote at Wells Fargo Day
H2O.ai CEO/Founder: Sri Ambati Keynote at Wells Fargo Day
 
Ensuring Technical Readiness For Copilot in Microsoft 365
Ensuring Technical Readiness For Copilot in Microsoft 365Ensuring Technical Readiness For Copilot in Microsoft 365
Ensuring Technical Readiness For Copilot in Microsoft 365
 
How AI, OpenAI, and ChatGPT impact business and software.
How AI, OpenAI, and ChatGPT impact business and software.How AI, OpenAI, and ChatGPT impact business and software.
How AI, OpenAI, and ChatGPT impact business and software.
 
"ML in Production",Oleksandr Bagan
"ML in Production",Oleksandr Bagan"ML in Production",Oleksandr Bagan
"ML in Production",Oleksandr Bagan
 
Take control of your SAP testing with UiPath Test Suite
Take control of your SAP testing with UiPath Test SuiteTake control of your SAP testing with UiPath Test Suite
Take control of your SAP testing with UiPath Test Suite
 
Powerpoint exploring the locations used in television show Time Clash
Powerpoint exploring the locations used in television show Time ClashPowerpoint exploring the locations used in television show Time Clash
Powerpoint exploring the locations used in television show Time Clash
 
TrustArc Webinar - How to Build Consumer Trust Through Data Privacy
TrustArc Webinar - How to Build Consumer Trust Through Data PrivacyTrustArc Webinar - How to Build Consumer Trust Through Data Privacy
TrustArc Webinar - How to Build Consumer Trust Through Data Privacy
 
DSPy a system for AI to Write Prompts and Do Fine Tuning
DSPy a system for AI to Write Prompts and Do Fine TuningDSPy a system for AI to Write Prompts and Do Fine Tuning
DSPy a system for AI to Write Prompts and Do Fine Tuning
 
E-Vehicle_Hacking_by_Parul Sharma_null_owasp.pptx
E-Vehicle_Hacking_by_Parul Sharma_null_owasp.pptxE-Vehicle_Hacking_by_Parul Sharma_null_owasp.pptx
E-Vehicle_Hacking_by_Parul Sharma_null_owasp.pptx
 
Unraveling Multimodality with Large Language Models.pdf
Unraveling Multimodality with Large Language Models.pdfUnraveling Multimodality with Large Language Models.pdf
Unraveling Multimodality with Large Language Models.pdf
 
Scanning the Internet for External Cloud Exposures via SSL Certs
Scanning the Internet for External Cloud Exposures via SSL CertsScanning the Internet for External Cloud Exposures via SSL Certs
Scanning the Internet for External Cloud Exposures via SSL Certs
 
Unleash Your Potential - Namagunga Girls Coding Club
Unleash Your Potential - Namagunga Girls Coding ClubUnleash Your Potential - Namagunga Girls Coding Club
Unleash Your Potential - Namagunga Girls Coding Club
 
DevEX - reference for building teams, processes, and platforms
DevEX - reference for building teams, processes, and platformsDevEX - reference for building teams, processes, and platforms
DevEX - reference for building teams, processes, and platforms
 
"Subclassing and Composition – A Pythonic Tour of Trade-Offs", Hynek Schlawack
"Subclassing and Composition – A Pythonic Tour of Trade-Offs", Hynek Schlawack"Subclassing and Composition – A Pythonic Tour of Trade-Offs", Hynek Schlawack
"Subclassing and Composition – A Pythonic Tour of Trade-Offs", Hynek Schlawack
 

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! ;-)