SlideShare a Scribd company logo
ChangeCommander
Recommending Method Invocation
Context Changes

Beat Fluri, Jonas Zuberbühler, and Harald C. Gall
s.e.a.l. - software evolution & architecture lab
Department of Informatics
University of Zurich, Switzerland




         University of Zurich
         Department of Informatics                  software evolution & architecture lab
Which changes fix bugs?


Bug fix change study on Eclipse
  43 plugins from Platform, JDT, and PDE


15% of bugs fixes contain context changes
of method invocation statements
Which changes fix bugs?


Bug fix change study on Eclipse
  43 plugins from Platform, JDT, and PDE


15% of bugs fixes contain context changes
of method invocation statements


            Method Invocation Context Change
            Moving a method invocation into the
            then or the else-part of an if-statement.
Which changes fix bugs?


Bug fix change study on Eclipse
  43 plugins from Platform, JDT, and PDE

         visited.add(outputFolder);
15% of bugs fixes contain context changes
of method invocation statements


            Method Invocation Context Change
            Moving a method invocation into the
            then or the else-part of an if-statement.
Which changes fix bugs?


Bug fix change study on Eclipse
  43 pluginsif (!visited.contains(outputFolder)) {
             from Platform, JDT, and PDE

              visited.add(outputFolder);
15% of bugs fixes contain context changes
of method invocation statements
         }

          Method Invocation Context Change
          Moving a method invocation into the
          then or the else-part of an if-statement.
Context changes tend to be similar

Similar conditions for all methods




Similar conditions for specific methods
Context changes tend to be similar

Similar conditions for all methods

  if (myObject != null) {            if (list != null) {
  	 	 list.add(myObject);            	 	 list.add(myObject);
  }                                  }




Similar conditions for specific methods
Context changes tend to be similar

Similar conditions for all methods

  if (myObject != null) {            if (list != null) {
  	 	 list.add(myObject);            	 	 list.add(myObject);
  }                                  }




Similar conditions for specific methods

  if (!list.contains(myObject)) {
  	 	 list.add(myObject);
  }
Pattern extraction process
Pattern extraction process
          Context
          changes
Pattern extraction process
          Context
          changes
Pattern extraction process
          Context
          changes
Pattern extraction process
          Context    Invocation
          changes   aggregation
Pattern extraction process
          Context    Invocation    Pattern
          changes   aggregation   extraction
Pattern extraction process
          Context    Invocation    Pattern
          changes   aggregation   extraction
Invocation aggregation


Method invocations   Invocation signature




list.add(myObject)   java.util.List.add(MyClass)
Invocation aggregation


Method invocations   Invocation signature




list.add(myObject)   java.util.List.add(MyClass)
Invocation aggregation


Method invocations   Invocation signature




list.add(myObject)   java.util.List.add(MyClass)
Invocation aggregation

    Method invocation    Invocation signature
    list.add(anObject)   java.util.List.add(MyClass)
Invocation aggregation

    Method invocation    Invocation signature
    list.add(anObject)   java.util.List.add(MyClass)




    Same Package
Invocation aggregation

    Method invocation    Invocation signature
    list.add(anObject)   java.util.List.add(MyClass)




    Same Package

      Imports
Invocation aggregation

    Method invocation          Invocation signature
    list.add(anObject)         java.util.List.add(MyClass)




                         JDT




    Same Package

      Imports
Invocation aggregation

    Method invocation          Invocation signature
    list.add(anObject)         java.util.List.add(MyClass)




                         JDT




    Same Package

      Imports
Invocation aggregation

    Method invocation          Invocation signature
    list.add(anObject)         java.util.List.add(MyClass)




                                       Post Resolver


                         JDT
                                       Match in scope
                                       variables

                                       Match in imports

                                       ...

    Same Package

      Imports
Invocation aggregation

    Method invocation          Invocation signature
    list.add(anObject)         java.util.List.add(MyClass)




                                       Post Resolver


                         JDT
                                       Match in scope
                                       variables

                                       Match in imports

                                       ...

    Same Package

      Imports
Pattern extraction


Aggregated invocations     Context change patterns




list != null &&            <qualifier> != null

!list.contains(myObject)   !<qualifier>.contains(<argument_0>)



list.add(myObject)
Pattern extraction


Aggregated invocations     Context change patterns




list != null &&            <qualifier> != null

!list.contains(myObject)   !<qualifier>.contains(<argument_0>)



list.add(myObject)
Pattern extraction


Aggregated invocations     Context change patterns




list != null &&            <qualifier> != null

!list.contains(myObject)   !<qualifier>.contains(<argument_0>)



list.add(myObject)
Pattern extraction

       Aggregated invocations     Context change patterns
       list != null &&            <qualifier> != null
       !list.contains(myObject)
                                  !<qualifier>.contains(<argument_0>)




  Split compound
  conditions into
  single conditions
Pattern extraction

       Aggregated invocations                    Context change patterns
       list != null &&                           <qualifier> != null
       !list.contains(myObject)
                                                 !<qualifier>.contains(<argument_0>)




  Split compound
  conditions into          Token streams for
  single conditions        - conditions
                           - method invocation
Pattern extraction

       Aggregated invocations                    Context change patterns
       list != null &&                           <qualifier> != null
       !list.contains(myObject)
                                                 !<qualifier>.contains(<argument_0>)




  Split compound
  conditions into          Token streams for
  single conditions        - conditions
                           - method invocation
Pattern extraction

       Aggregated invocations                    Context change patterns
       list != null &&                           <qualifier> != null
       !list.contains(myObject)
                                                 !<qualifier>.contains(<argument_0>)




  Split compound
  conditions into          Token streams for
  single conditions        - conditions
                           - method invocation


                        list.add(myObject)
Pattern extraction

       Aggregated invocations                    Context change patterns
       list != null &&                           <qualifier> != null
       !list.contains(myObject)
                                                 !<qualifier>.contains(<argument_0>)




  Split compound
  conditions into          Token streams for
  single conditions        - conditions
                           - method invocation


                        list.add(myObject)
Pattern extraction

       Aggregated invocations                    Context change patterns
       list != null &&                           <qualifier> != null
       !list.contains(myObject)
                                                 !<qualifier>.contains(<argument_0>)




  Split compound
  conditions into          Token streams for
  single conditions        - conditions
                           - method invocation


                        list.add(myObject)
Recommendation
Recommendation
Recommendation
Recommendation



                 java.util.List.add(MyClass)
Recommendation



                 java.util.List.add(MyClass)
Recommendation



                 java.util.List.add(MyClass)
Recommendation



                          java.util.List.add(MyClass)




           x
               x

       Surrounding if
       already contains
       condition

       Filter predefined
       method
       invocations
Recommendation



                          java.util.List.add(MyClass)




           x
               x

       Surrounding if
       already contains
       condition

       Filter predefined
       method
       invocations
ChangeCommander
A first validation

Split history
Training set: Past context changes up to a
certain release
Test set: Context changes after that
particular release

Recommended context change
True positive (TP): in test set
False positive (FP): not in test set
False negative (FN): context change in test set but not recommended
A first validation


           Project       TP   #B     FP   FN

           ArgoUML       29   11   4675   75

           Azureus       15    3      -   82

           Eclipse JDT   51   27      -   158

           Eclipse PDE   35   25   8011   46

           jEdit          1    0   1307   13
A first validation


           Project       TP   #B     FP   FN

           ArgoUML       29   11   4675   75

           Azureus       15    3      -   82

           Eclipse JDT   51   27      -   158

           Eclipse PDE   35   25   8011   46

           jEdit          1    0   1307   13
Conclusions

                                 Recommending context changes
                                 We leverages context change data to
                                 suggest corresponding modifications on
                                 existing or newly added method
                                 invocations.



ChangeCommander
By integrating our recommendation
approach into the development
process, we aim at reducing future
bugs.

More Related Content

What's hot

Refactoring In Tdd The Missing Part
Refactoring In Tdd The Missing PartRefactoring In Tdd The Missing Part
Refactoring In Tdd The Missing PartGabriele Lana
 
Use of Apache Commons and Utilities
Use of Apache Commons and UtilitiesUse of Apache Commons and Utilities
Use of Apache Commons and UtilitiesPramod Kumar
 
JDK Power Tools
JDK Power ToolsJDK Power Tools
JDK Power Tools
Tobias Lindaaker
 
Let's go Developer 2011 sendai Let's go Java Developer (Programming Language ...
Let's go Developer 2011 sendai Let's go Java Developer (Programming Language ...Let's go Developer 2011 sendai Let's go Java Developer (Programming Language ...
Let's go Developer 2011 sendai Let's go Java Developer (Programming Language ...
Uehara Junji
 
Beyond Java: 자바 8을 중심으로 본 자바의 혁신
Beyond Java: 자바 8을 중심으로 본 자바의 혁신Beyond Java: 자바 8을 중심으로 본 자바의 혁신
Beyond Java: 자바 8을 중심으로 본 자바의 혁신
Sungchul Park
 
Oleksandr Valetskyy - DI vs. IoC
Oleksandr Valetskyy - DI vs. IoCOleksandr Valetskyy - DI vs. IoC
Oleksandr Valetskyy - DI vs. IoC
Oleksandr Valetskyy
 
Easy Going Groovy 2nd season on DevLOVE
Easy Going Groovy 2nd season on DevLOVEEasy Going Groovy 2nd season on DevLOVE
Easy Going Groovy 2nd season on DevLOVE
Uehara Junji
 
Javascript basic course
Javascript basic courseJavascript basic course
Javascript basic courseTran Khoa
 
Java best practices
Java best practicesJava best practices
Java best practices
Ray Toal
 
Annotation Processing in Android
Annotation Processing in AndroidAnnotation Processing in Android
Annotation Processing in Android
emanuelez
 
Refactoring to Java 8 (Devoxx BE)
Refactoring to Java 8 (Devoxx BE)Refactoring to Java 8 (Devoxx BE)
Refactoring to Java 8 (Devoxx BE)
Trisha Gee
 
QTP Online Training
QTP Online Training QTP Online Training
QTP Online Training
G Chandra Reddy
 
Java Programming - 04 object oriented in java
Java Programming - 04 object oriented in javaJava Programming - 04 object oriented in java
Java Programming - 04 object oriented in java
Danairat Thanabodithammachari
 
javascript-cheat-sheet-v1_1
javascript-cheat-sheet-v1_1javascript-cheat-sheet-v1_1
javascript-cheat-sheet-v1_1brecke
 
The uniform interface is 42
The uniform interface is 42The uniform interface is 42
The uniform interface is 42
Yevhen Bobrov
 
Autoboxing and unboxing
Autoboxing and unboxingAutoboxing and unboxing
Autoboxing and unboxing
Geetha Manohar
 
Joose @jsconf
Joose @jsconfJoose @jsconf
Joose @jsconfmalteubl
 
Grammatical Optimization
Grammatical OptimizationGrammatical Optimization
Grammatical Optimization
adil raja
 

What's hot (20)

Refactoring In Tdd The Missing Part
Refactoring In Tdd The Missing PartRefactoring In Tdd The Missing Part
Refactoring In Tdd The Missing Part
 
Use of Apache Commons and Utilities
Use of Apache Commons and UtilitiesUse of Apache Commons and Utilities
Use of Apache Commons and Utilities
 
JDK Power Tools
JDK Power ToolsJDK Power Tools
JDK Power Tools
 
Let's go Developer 2011 sendai Let's go Java Developer (Programming Language ...
Let's go Developer 2011 sendai Let's go Java Developer (Programming Language ...Let's go Developer 2011 sendai Let's go Java Developer (Programming Language ...
Let's go Developer 2011 sendai Let's go Java Developer (Programming Language ...
 
Beyond Java: 자바 8을 중심으로 본 자바의 혁신
Beyond Java: 자바 8을 중심으로 본 자바의 혁신Beyond Java: 자바 8을 중심으로 본 자바의 혁신
Beyond Java: 자바 8을 중심으로 본 자바의 혁신
 
Oleksandr Valetskyy - DI vs. IoC
Oleksandr Valetskyy - DI vs. IoCOleksandr Valetskyy - DI vs. IoC
Oleksandr Valetskyy - DI vs. IoC
 
Easy Going Groovy 2nd season on DevLOVE
Easy Going Groovy 2nd season on DevLOVEEasy Going Groovy 2nd season on DevLOVE
Easy Going Groovy 2nd season on DevLOVE
 
Javascript basic course
Javascript basic courseJavascript basic course
Javascript basic course
 
Java best practices
Java best practicesJava best practices
Java best practices
 
Annotation Processing in Android
Annotation Processing in AndroidAnnotation Processing in Android
Annotation Processing in Android
 
Refactoring to Java 8 (Devoxx BE)
Refactoring to Java 8 (Devoxx BE)Refactoring to Java 8 (Devoxx BE)
Refactoring to Java 8 (Devoxx BE)
 
QTP Online Training
QTP Online Training QTP Online Training
QTP Online Training
 
Java Programming - 04 object oriented in java
Java Programming - 04 object oriented in javaJava Programming - 04 object oriented in java
Java Programming - 04 object oriented in java
 
javascript-cheat-sheet-v1_1
javascript-cheat-sheet-v1_1javascript-cheat-sheet-v1_1
javascript-cheat-sheet-v1_1
 
The uniform interface is 42
The uniform interface is 42The uniform interface is 42
The uniform interface is 42
 
Jstl 8
Jstl 8Jstl 8
Jstl 8
 
Autoboxing and unboxing
Autoboxing and unboxingAutoboxing and unboxing
Autoboxing and unboxing
 
Joose @jsconf
Joose @jsconfJoose @jsconf
Joose @jsconf
 
JRuby hacking guide
JRuby hacking guideJRuby hacking guide
JRuby hacking guide
 
Grammatical Optimization
Grammatical OptimizationGrammatical Optimization
Grammatical Optimization
 

Viewers also liked

Why Is Obesity A Political Problem
Why Is Obesity A Political ProblemWhy Is Obesity A Political Problem
Why Is Obesity A Political Problemndaniels33
 
Karen Hill SIGMA-EU event on Public administration reform challenges Skopje 1...
Karen Hill SIGMA-EU event on Public administration reform challenges Skopje 1...Karen Hill SIGMA-EU event on Public administration reform challenges Skopje 1...
Karen Hill SIGMA-EU event on Public administration reform challenges Skopje 1...
Support for Improvement in Governance and Management SIGMA
 
The Russian Provisional Government & its problems
The Russian Provisional Government & its problemsThe Russian Provisional Government & its problems
The Russian Provisional Government & its problemscolek2014
 
Android ipm 20110409
Android ipm 20110409Android ipm 20110409
Android ipm 20110409
Tetsuyuki Kobayashi
 
Report ethics in government service
Report ethics in government serviceReport ethics in government service
Report ethics in government serviceLouie Medinaceli
 
Dynamism of Philippine Administrative System and its Role to National Develop...
Dynamism of Philippine Administrative System and its Role to National Develop...Dynamism of Philippine Administrative System and its Role to National Develop...
Dynamism of Philippine Administrative System and its Role to National Develop...
Mhd Faheem Aliuden
 
Philippine Administrative System (PAS)
Philippine Administrative System  (PAS)Philippine Administrative System  (PAS)
Philippine Administrative System (PAS)
Jo Balucanag - Bitonio
 
Political and administrative structure
Political and administrative structurePolitical and administrative structure
Political and administrative structureAlex Francis Cabrera
 
DPA 102 Philippine Administrative System
DPA 102 Philippine Administrative SystemDPA 102 Philippine Administrative System
DPA 102 Philippine Administrative System
Jo Balucanag - Bitonio
 
Karen Hill, presentation,SIGMA Bilateral Event,Principles of Public Administr...
Karen Hill, presentation,SIGMA Bilateral Event,Principles of Public Administr...Karen Hill, presentation,SIGMA Bilateral Event,Principles of Public Administr...
Karen Hill, presentation,SIGMA Bilateral Event,Principles of Public Administr...
Support for Improvement in Governance and Management SIGMA
 

Viewers also liked (11)

Why Is Obesity A Political Problem
Why Is Obesity A Political ProblemWhy Is Obesity A Political Problem
Why Is Obesity A Political Problem
 
Karen Hill SIGMA-EU event on Public administration reform challenges Skopje 1...
Karen Hill SIGMA-EU event on Public administration reform challenges Skopje 1...Karen Hill SIGMA-EU event on Public administration reform challenges Skopje 1...
Karen Hill SIGMA-EU event on Public administration reform challenges Skopje 1...
 
The Russian Provisional Government & its problems
The Russian Provisional Government & its problemsThe Russian Provisional Government & its problems
The Russian Provisional Government & its problems
 
Pscn
PscnPscn
Pscn
 
Android ipm 20110409
Android ipm 20110409Android ipm 20110409
Android ipm 20110409
 
Report ethics in government service
Report ethics in government serviceReport ethics in government service
Report ethics in government service
 
Dynamism of Philippine Administrative System and its Role to National Develop...
Dynamism of Philippine Administrative System and its Role to National Develop...Dynamism of Philippine Administrative System and its Role to National Develop...
Dynamism of Philippine Administrative System and its Role to National Develop...
 
Philippine Administrative System (PAS)
Philippine Administrative System  (PAS)Philippine Administrative System  (PAS)
Philippine Administrative System (PAS)
 
Political and administrative structure
Political and administrative structurePolitical and administrative structure
Political and administrative structure
 
DPA 102 Philippine Administrative System
DPA 102 Philippine Administrative SystemDPA 102 Philippine Administrative System
DPA 102 Philippine Administrative System
 
Karen Hill, presentation,SIGMA Bilateral Event,Principles of Public Administr...
Karen Hill, presentation,SIGMA Bilateral Event,Principles of Public Administr...Karen Hill, presentation,SIGMA Bilateral Event,Principles of Public Administr...
Karen Hill, presentation,SIGMA Bilateral Event,Principles of Public Administr...
 

Similar to Recommending Method Invocation Context Changes

NetBeans Plugin Development: JRebel Experience Report
NetBeans Plugin Development: JRebel Experience ReportNetBeans Plugin Development: JRebel Experience Report
NetBeans Plugin Development: JRebel Experience ReportAnton Arhipov
 
Test-Driven Development for TYPO3
Test-Driven Development for TYPO3Test-Driven Development for TYPO3
Test-Driven Development for TYPO3Oliver Klee
 
Test-driven Development for TYPO3
Test-driven Development for TYPO3Test-driven Development for TYPO3
Test-driven Development for TYPO3Oliver Klee
 
Pragmatic unittestingwithj unit
Pragmatic unittestingwithj unitPragmatic unittestingwithj unit
Pragmatic unittestingwithj unit
liminescence
 
Intro to Testing in Zope, Plone
Intro to Testing in Zope, PloneIntro to Testing in Zope, Plone
Intro to Testing in Zope, Plone
Quintagroup
 
SOLID mit Java 8
SOLID mit Java 8SOLID mit Java 8
SOLID mit Java 8
Roland Mast
 
javascript-cheat-sheet-v1_1
javascript-cheat-sheet-v1_1javascript-cheat-sheet-v1_1
javascript-cheat-sheet-v1_1brecke
 
Java q ref 2018
Java q ref 2018Java q ref 2018
Java q ref 2018
Christopher Akinlade
 
Tools09 – Reusing & Composing Tests with Traits
Tools09 – Reusing & Composing Tests with TraitsTools09 – Reusing & Composing Tests with Traits
Tools09 – Reusing & Composing Tests with Traits
Damien Pollet
 
EContent_11_2023_04_09_11_30_38_Unit_3_Objects_and_Classespptx__2023_03_20_12...
EContent_11_2023_04_09_11_30_38_Unit_3_Objects_and_Classespptx__2023_03_20_12...EContent_11_2023_04_09_11_30_38_Unit_3_Objects_and_Classespptx__2023_03_20_12...
EContent_11_2023_04_09_11_30_38_Unit_3_Objects_and_Classespptx__2023_03_20_12...
vekariyakashyap
 
Generic Programming
Generic ProgrammingGeneric Programming
Generic Programming
PingLun Liao
 
Introduction to Client-Side Javascript
Introduction to Client-Side JavascriptIntroduction to Client-Side Javascript
Introduction to Client-Side Javascript
Julie Iskander
 
Java custom annotations example
Java custom annotations exampleJava custom annotations example
Java custom annotations example
Milton José Ferreira
 
DynaMine: Finding Common Error Patterns by Mining Software Revision Histories
DynaMine: Finding Common Error Patterns by Mining Software Revision HistoriesDynaMine: Finding Common Error Patterns by Mining Software Revision Histories
DynaMine: Finding Common Error Patterns by Mining Software Revision Histories
Thomas Zimmermann
 
Test-Driven Development for TYPO3 @ T3CON12DE
Test-Driven Development for TYPO3 @ T3CON12DETest-Driven Development for TYPO3 @ T3CON12DE
Test-Driven Development for TYPO3 @ T3CON12DEOliver Klee
 
The Anatomy of Analysis Tools (EVO 2008)
The Anatomy of Analysis Tools (EVO 2008)The Anatomy of Analysis Tools (EVO 2008)
The Anatomy of Analysis Tools (EVO 2008)
Tudor Girba
 
Leveraging Scala Macros for Better Validation
Leveraging Scala Macros for Better ValidationLeveraging Scala Macros for Better Validation
Leveraging Scala Macros for Better Validation
Tomer Gabel
 
Spring 3.1 and MVC Testing Support
Spring 3.1 and MVC Testing SupportSpring 3.1 and MVC Testing Support
Spring 3.1 and MVC Testing Support
Sam Brannen
 
Java Annotation Processing: A Beginner Walkthrough
Java Annotation Processing: A Beginner WalkthroughJava Annotation Processing: A Beginner Walkthrough
Java Annotation Processing: A Beginner Walkthrough
Mahfuz Islam Bhuiyan
 

Similar to Recommending Method Invocation Context Changes (20)

NetBeans Plugin Development: JRebel Experience Report
NetBeans Plugin Development: JRebel Experience ReportNetBeans Plugin Development: JRebel Experience Report
NetBeans Plugin Development: JRebel Experience Report
 
Test-Driven Development for TYPO3
Test-Driven Development for TYPO3Test-Driven Development for TYPO3
Test-Driven Development for TYPO3
 
Test-driven Development for TYPO3
Test-driven Development for TYPO3Test-driven Development for TYPO3
Test-driven Development for TYPO3
 
Pragmatic unittestingwithj unit
Pragmatic unittestingwithj unitPragmatic unittestingwithj unit
Pragmatic unittestingwithj unit
 
Intro to Testing in Zope, Plone
Intro to Testing in Zope, PloneIntro to Testing in Zope, Plone
Intro to Testing in Zope, Plone
 
SOLID mit Java 8
SOLID mit Java 8SOLID mit Java 8
SOLID mit Java 8
 
Testing untestable code - DPC10
Testing untestable code - DPC10Testing untestable code - DPC10
Testing untestable code - DPC10
 
javascript-cheat-sheet-v1_1
javascript-cheat-sheet-v1_1javascript-cheat-sheet-v1_1
javascript-cheat-sheet-v1_1
 
Java q ref 2018
Java q ref 2018Java q ref 2018
Java q ref 2018
 
Tools09 – Reusing & Composing Tests with Traits
Tools09 – Reusing & Composing Tests with TraitsTools09 – Reusing & Composing Tests with Traits
Tools09 – Reusing & Composing Tests with Traits
 
EContent_11_2023_04_09_11_30_38_Unit_3_Objects_and_Classespptx__2023_03_20_12...
EContent_11_2023_04_09_11_30_38_Unit_3_Objects_and_Classespptx__2023_03_20_12...EContent_11_2023_04_09_11_30_38_Unit_3_Objects_and_Classespptx__2023_03_20_12...
EContent_11_2023_04_09_11_30_38_Unit_3_Objects_and_Classespptx__2023_03_20_12...
 
Generic Programming
Generic ProgrammingGeneric Programming
Generic Programming
 
Introduction to Client-Side Javascript
Introduction to Client-Side JavascriptIntroduction to Client-Side Javascript
Introduction to Client-Side Javascript
 
Java custom annotations example
Java custom annotations exampleJava custom annotations example
Java custom annotations example
 
DynaMine: Finding Common Error Patterns by Mining Software Revision Histories
DynaMine: Finding Common Error Patterns by Mining Software Revision HistoriesDynaMine: Finding Common Error Patterns by Mining Software Revision Histories
DynaMine: Finding Common Error Patterns by Mining Software Revision Histories
 
Test-Driven Development for TYPO3 @ T3CON12DE
Test-Driven Development for TYPO3 @ T3CON12DETest-Driven Development for TYPO3 @ T3CON12DE
Test-Driven Development for TYPO3 @ T3CON12DE
 
The Anatomy of Analysis Tools (EVO 2008)
The Anatomy of Analysis Tools (EVO 2008)The Anatomy of Analysis Tools (EVO 2008)
The Anatomy of Analysis Tools (EVO 2008)
 
Leveraging Scala Macros for Better Validation
Leveraging Scala Macros for Better ValidationLeveraging Scala Macros for Better Validation
Leveraging Scala Macros for Better Validation
 
Spring 3.1 and MVC Testing Support
Spring 3.1 and MVC Testing SupportSpring 3.1 and MVC Testing Support
Spring 3.1 and MVC Testing Support
 
Java Annotation Processing: A Beginner Walkthrough
Java Annotation Processing: A Beginner WalkthroughJava Annotation Processing: A Beginner Walkthrough
Java Annotation Processing: A Beginner Walkthrough
 

Recently uploaded

Uni Systems Copilot event_05062024_C.Vlachos.pdf
Uni Systems Copilot event_05062024_C.Vlachos.pdfUni Systems Copilot event_05062024_C.Vlachos.pdf
Uni Systems Copilot event_05062024_C.Vlachos.pdf
Uni Systems S.M.S.A.
 
Secstrike : Reverse Engineering & Pwnable tools for CTF.pptx
Secstrike : Reverse Engineering & Pwnable tools for CTF.pptxSecstrike : Reverse Engineering & Pwnable tools for CTF.pptx
Secstrike : Reverse Engineering & Pwnable tools for CTF.pptx
nkrafacyberclub
 
UiPath Test Automation using UiPath Test Suite series, part 5
UiPath Test Automation using UiPath Test Suite series, part 5UiPath Test Automation using UiPath Test Suite series, part 5
UiPath Test Automation using UiPath Test Suite series, part 5
DianaGray10
 
Mind map of terminologies used in context of Generative AI
Mind map of terminologies used in context of Generative AIMind map of terminologies used in context of Generative AI
Mind map of terminologies used in context of Generative AI
Kumud Singh
 
Observability Concepts EVERY Developer Should Know -- DeveloperWeek Europe.pdf
Observability Concepts EVERY Developer Should Know -- DeveloperWeek Europe.pdfObservability Concepts EVERY Developer Should Know -- DeveloperWeek Europe.pdf
Observability Concepts EVERY Developer Should Know -- DeveloperWeek Europe.pdf
Paige Cruz
 
Removing Uninteresting Bytes in Software Fuzzing
Removing Uninteresting Bytes in Software FuzzingRemoving Uninteresting Bytes in Software Fuzzing
Removing Uninteresting Bytes in Software Fuzzing
Aftab Hussain
 
GraphSummit Singapore | Neo4j Product Vision & Roadmap - Q2 2024
GraphSummit Singapore | Neo4j Product Vision & Roadmap - Q2 2024GraphSummit Singapore | Neo4j Product Vision & Roadmap - Q2 2024
GraphSummit Singapore | Neo4j Product Vision & Roadmap - Q2 2024
Neo4j
 
FIDO Alliance Osaka Seminar: The WebAuthn API and Discoverable Credentials.pdf
FIDO Alliance Osaka Seminar: The WebAuthn API and Discoverable Credentials.pdfFIDO Alliance Osaka Seminar: The WebAuthn API and Discoverable Credentials.pdf
FIDO Alliance Osaka Seminar: The WebAuthn API and Discoverable Credentials.pdf
FIDO Alliance
 
A tale of scale & speed: How the US Navy is enabling software delivery from l...
A tale of scale & speed: How the US Navy is enabling software delivery from l...A tale of scale & speed: How the US Navy is enabling software delivery from l...
A tale of scale & speed: How the US Navy is enabling software delivery from l...
sonjaschweigert1
 
Enchancing adoption of Open Source Libraries. A case study on Albumentations.AI
Enchancing adoption of Open Source Libraries. A case study on Albumentations.AIEnchancing adoption of Open Source Libraries. A case study on Albumentations.AI
Enchancing adoption of Open Source Libraries. A case study on Albumentations.AI
Vladimir Iglovikov, Ph.D.
 
20240609 QFM020 Irresponsible AI Reading List May 2024
20240609 QFM020 Irresponsible AI Reading List May 202420240609 QFM020 Irresponsible AI Reading List May 2024
20240609 QFM020 Irresponsible AI Reading List May 2024
Matthew Sinclair
 
Encryption in Microsoft 365 - ExpertsLive Netherlands 2024
Encryption in Microsoft 365 - ExpertsLive Netherlands 2024Encryption in Microsoft 365 - ExpertsLive Netherlands 2024
Encryption in Microsoft 365 - ExpertsLive Netherlands 2024
Albert Hoitingh
 
Free Complete Python - A step towards Data Science
Free Complete Python - A step towards Data ScienceFree Complete Python - A step towards Data Science
Free Complete Python - A step towards Data Science
RinaMondal9
 
Pushing the limits of ePRTC: 100ns holdover for 100 days
Pushing the limits of ePRTC: 100ns holdover for 100 daysPushing the limits of ePRTC: 100ns holdover for 100 days
Pushing the limits of ePRTC: 100ns holdover for 100 days
Adtran
 
Generative AI Deep Dive: Advancing from Proof of Concept to Production
Generative AI Deep Dive: Advancing from Proof of Concept to ProductionGenerative AI Deep Dive: Advancing from Proof of Concept to Production
Generative AI Deep Dive: Advancing from Proof of Concept to Production
Aggregage
 
National Security Agency - NSA mobile device best practices
National Security Agency - NSA mobile device best practicesNational Security Agency - NSA mobile device best practices
National Security Agency - NSA mobile device best practices
Quotidiano Piemontese
 
Introduction to CHERI technology - Cybersecurity
Introduction to CHERI technology - CybersecurityIntroduction to CHERI technology - Cybersecurity
Introduction to CHERI technology - Cybersecurity
mikeeftimakis1
 
By Design, not by Accident - Agile Venture Bolzano 2024
By Design, not by Accident - Agile Venture Bolzano 2024By Design, not by Accident - Agile Venture Bolzano 2024
By Design, not by Accident - Agile Venture Bolzano 2024
Pierluigi Pugliese
 
みなさんこんにちはこれ何文字まで入るの?40文字以下不可とか本当に意味わからないけどこれ限界文字数書いてないからマジでやばい文字数いけるんじゃないの?えこ...
みなさんこんにちはこれ何文字まで入るの?40文字以下不可とか本当に意味わからないけどこれ限界文字数書いてないからマジでやばい文字数いけるんじゃないの?えこ...みなさんこんにちはこれ何文字まで入るの?40文字以下不可とか本当に意味わからないけどこれ限界文字数書いてないからマジでやばい文字数いけるんじゃないの?えこ...
みなさんこんにちはこれ何文字まで入るの?40文字以下不可とか本当に意味わからないけどこれ限界文字数書いてないからマジでやばい文字数いけるんじゃないの?えこ...
名前 です男
 
GraphSummit Singapore | The Art of the Possible with Graph - Q2 2024
GraphSummit Singapore | The Art of the  Possible with Graph - Q2 2024GraphSummit Singapore | The Art of the  Possible with Graph - Q2 2024
GraphSummit Singapore | The Art of the Possible with Graph - Q2 2024
Neo4j
 

Recently uploaded (20)

Uni Systems Copilot event_05062024_C.Vlachos.pdf
Uni Systems Copilot event_05062024_C.Vlachos.pdfUni Systems Copilot event_05062024_C.Vlachos.pdf
Uni Systems Copilot event_05062024_C.Vlachos.pdf
 
Secstrike : Reverse Engineering & Pwnable tools for CTF.pptx
Secstrike : Reverse Engineering & Pwnable tools for CTF.pptxSecstrike : Reverse Engineering & Pwnable tools for CTF.pptx
Secstrike : Reverse Engineering & Pwnable tools for CTF.pptx
 
UiPath Test Automation using UiPath Test Suite series, part 5
UiPath Test Automation using UiPath Test Suite series, part 5UiPath Test Automation using UiPath Test Suite series, part 5
UiPath Test Automation using UiPath Test Suite series, part 5
 
Mind map of terminologies used in context of Generative AI
Mind map of terminologies used in context of Generative AIMind map of terminologies used in context of Generative AI
Mind map of terminologies used in context of Generative AI
 
Observability Concepts EVERY Developer Should Know -- DeveloperWeek Europe.pdf
Observability Concepts EVERY Developer Should Know -- DeveloperWeek Europe.pdfObservability Concepts EVERY Developer Should Know -- DeveloperWeek Europe.pdf
Observability Concepts EVERY Developer Should Know -- DeveloperWeek Europe.pdf
 
Removing Uninteresting Bytes in Software Fuzzing
Removing Uninteresting Bytes in Software FuzzingRemoving Uninteresting Bytes in Software Fuzzing
Removing Uninteresting Bytes in Software Fuzzing
 
GraphSummit Singapore | Neo4j Product Vision & Roadmap - Q2 2024
GraphSummit Singapore | Neo4j Product Vision & Roadmap - Q2 2024GraphSummit Singapore | Neo4j Product Vision & Roadmap - Q2 2024
GraphSummit Singapore | Neo4j Product Vision & Roadmap - Q2 2024
 
FIDO Alliance Osaka Seminar: The WebAuthn API and Discoverable Credentials.pdf
FIDO Alliance Osaka Seminar: The WebAuthn API and Discoverable Credentials.pdfFIDO Alliance Osaka Seminar: The WebAuthn API and Discoverable Credentials.pdf
FIDO Alliance Osaka Seminar: The WebAuthn API and Discoverable Credentials.pdf
 
A tale of scale & speed: How the US Navy is enabling software delivery from l...
A tale of scale & speed: How the US Navy is enabling software delivery from l...A tale of scale & speed: How the US Navy is enabling software delivery from l...
A tale of scale & speed: How the US Navy is enabling software delivery from l...
 
Enchancing adoption of Open Source Libraries. A case study on Albumentations.AI
Enchancing adoption of Open Source Libraries. A case study on Albumentations.AIEnchancing adoption of Open Source Libraries. A case study on Albumentations.AI
Enchancing adoption of Open Source Libraries. A case study on Albumentations.AI
 
20240609 QFM020 Irresponsible AI Reading List May 2024
20240609 QFM020 Irresponsible AI Reading List May 202420240609 QFM020 Irresponsible AI Reading List May 2024
20240609 QFM020 Irresponsible AI Reading List May 2024
 
Encryption in Microsoft 365 - ExpertsLive Netherlands 2024
Encryption in Microsoft 365 - ExpertsLive Netherlands 2024Encryption in Microsoft 365 - ExpertsLive Netherlands 2024
Encryption in Microsoft 365 - ExpertsLive Netherlands 2024
 
Free Complete Python - A step towards Data Science
Free Complete Python - A step towards Data ScienceFree Complete Python - A step towards Data Science
Free Complete Python - A step towards Data Science
 
Pushing the limits of ePRTC: 100ns holdover for 100 days
Pushing the limits of ePRTC: 100ns holdover for 100 daysPushing the limits of ePRTC: 100ns holdover for 100 days
Pushing the limits of ePRTC: 100ns holdover for 100 days
 
Generative AI Deep Dive: Advancing from Proof of Concept to Production
Generative AI Deep Dive: Advancing from Proof of Concept to ProductionGenerative AI Deep Dive: Advancing from Proof of Concept to Production
Generative AI Deep Dive: Advancing from Proof of Concept to Production
 
National Security Agency - NSA mobile device best practices
National Security Agency - NSA mobile device best practicesNational Security Agency - NSA mobile device best practices
National Security Agency - NSA mobile device best practices
 
Introduction to CHERI technology - Cybersecurity
Introduction to CHERI technology - CybersecurityIntroduction to CHERI technology - Cybersecurity
Introduction to CHERI technology - Cybersecurity
 
By Design, not by Accident - Agile Venture Bolzano 2024
By Design, not by Accident - Agile Venture Bolzano 2024By Design, not by Accident - Agile Venture Bolzano 2024
By Design, not by Accident - Agile Venture Bolzano 2024
 
みなさんこんにちはこれ何文字まで入るの?40文字以下不可とか本当に意味わからないけどこれ限界文字数書いてないからマジでやばい文字数いけるんじゃないの?えこ...
みなさんこんにちはこれ何文字まで入るの?40文字以下不可とか本当に意味わからないけどこれ限界文字数書いてないからマジでやばい文字数いけるんじゃないの?えこ...みなさんこんにちはこれ何文字まで入るの?40文字以下不可とか本当に意味わからないけどこれ限界文字数書いてないからマジでやばい文字数いけるんじゃないの?えこ...
みなさんこんにちはこれ何文字まで入るの?40文字以下不可とか本当に意味わからないけどこれ限界文字数書いてないからマジでやばい文字数いけるんじゃないの?えこ...
 
GraphSummit Singapore | The Art of the Possible with Graph - Q2 2024
GraphSummit Singapore | The Art of the  Possible with Graph - Q2 2024GraphSummit Singapore | The Art of the  Possible with Graph - Q2 2024
GraphSummit Singapore | The Art of the Possible with Graph - Q2 2024
 

Recommending Method Invocation Context Changes

  • 1. ChangeCommander Recommending Method Invocation Context Changes Beat Fluri, Jonas Zuberbühler, and Harald C. Gall s.e.a.l. - software evolution & architecture lab Department of Informatics University of Zurich, Switzerland University of Zurich Department of Informatics software evolution & architecture lab
  • 2. Which changes fix bugs? Bug fix change study on Eclipse 43 plugins from Platform, JDT, and PDE 15% of bugs fixes contain context changes of method invocation statements
  • 3. Which changes fix bugs? Bug fix change study on Eclipse 43 plugins from Platform, JDT, and PDE 15% of bugs fixes contain context changes of method invocation statements Method Invocation Context Change Moving a method invocation into the then or the else-part of an if-statement.
  • 4. Which changes fix bugs? Bug fix change study on Eclipse 43 plugins from Platform, JDT, and PDE visited.add(outputFolder); 15% of bugs fixes contain context changes of method invocation statements Method Invocation Context Change Moving a method invocation into the then or the else-part of an if-statement.
  • 5. Which changes fix bugs? Bug fix change study on Eclipse 43 pluginsif (!visited.contains(outputFolder)) { from Platform, JDT, and PDE visited.add(outputFolder); 15% of bugs fixes contain context changes of method invocation statements } Method Invocation Context Change Moving a method invocation into the then or the else-part of an if-statement.
  • 6. Context changes tend to be similar Similar conditions for all methods Similar conditions for specific methods
  • 7. Context changes tend to be similar Similar conditions for all methods if (myObject != null) { if (list != null) { list.add(myObject); list.add(myObject); } } Similar conditions for specific methods
  • 8. Context changes tend to be similar Similar conditions for all methods if (myObject != null) { if (list != null) { list.add(myObject); list.add(myObject); } } Similar conditions for specific methods if (!list.contains(myObject)) { list.add(myObject); }
  • 10. Pattern extraction process Context changes
  • 11. Pattern extraction process Context changes
  • 12. Pattern extraction process Context changes
  • 13. Pattern extraction process Context Invocation changes aggregation
  • 14. Pattern extraction process Context Invocation Pattern changes aggregation extraction
  • 15. Pattern extraction process Context Invocation Pattern changes aggregation extraction
  • 16. Invocation aggregation Method invocations Invocation signature list.add(myObject) java.util.List.add(MyClass)
  • 17. Invocation aggregation Method invocations Invocation signature list.add(myObject) java.util.List.add(MyClass)
  • 18. Invocation aggregation Method invocations Invocation signature list.add(myObject) java.util.List.add(MyClass)
  • 19. Invocation aggregation Method invocation Invocation signature list.add(anObject) java.util.List.add(MyClass)
  • 20. Invocation aggregation Method invocation Invocation signature list.add(anObject) java.util.List.add(MyClass) Same Package
  • 21. Invocation aggregation Method invocation Invocation signature list.add(anObject) java.util.List.add(MyClass) Same Package Imports
  • 22. Invocation aggregation Method invocation Invocation signature list.add(anObject) java.util.List.add(MyClass) JDT Same Package Imports
  • 23. Invocation aggregation Method invocation Invocation signature list.add(anObject) java.util.List.add(MyClass) JDT Same Package Imports
  • 24. Invocation aggregation Method invocation Invocation signature list.add(anObject) java.util.List.add(MyClass) Post Resolver JDT Match in scope variables Match in imports ... Same Package Imports
  • 25. Invocation aggregation Method invocation Invocation signature list.add(anObject) java.util.List.add(MyClass) Post Resolver JDT Match in scope variables Match in imports ... Same Package Imports
  • 26. Pattern extraction Aggregated invocations Context change patterns list != null && <qualifier> != null !list.contains(myObject) !<qualifier>.contains(<argument_0>) list.add(myObject)
  • 27. Pattern extraction Aggregated invocations Context change patterns list != null && <qualifier> != null !list.contains(myObject) !<qualifier>.contains(<argument_0>) list.add(myObject)
  • 28. Pattern extraction Aggregated invocations Context change patterns list != null && <qualifier> != null !list.contains(myObject) !<qualifier>.contains(<argument_0>) list.add(myObject)
  • 29. Pattern extraction Aggregated invocations Context change patterns list != null && <qualifier> != null !list.contains(myObject) !<qualifier>.contains(<argument_0>) Split compound conditions into single conditions
  • 30. Pattern extraction Aggregated invocations Context change patterns list != null && <qualifier> != null !list.contains(myObject) !<qualifier>.contains(<argument_0>) Split compound conditions into Token streams for single conditions - conditions - method invocation
  • 31. Pattern extraction Aggregated invocations Context change patterns list != null && <qualifier> != null !list.contains(myObject) !<qualifier>.contains(<argument_0>) Split compound conditions into Token streams for single conditions - conditions - method invocation
  • 32. Pattern extraction Aggregated invocations Context change patterns list != null && <qualifier> != null !list.contains(myObject) !<qualifier>.contains(<argument_0>) Split compound conditions into Token streams for single conditions - conditions - method invocation list.add(myObject)
  • 33. Pattern extraction Aggregated invocations Context change patterns list != null && <qualifier> != null !list.contains(myObject) !<qualifier>.contains(<argument_0>) Split compound conditions into Token streams for single conditions - conditions - method invocation list.add(myObject)
  • 34. Pattern extraction Aggregated invocations Context change patterns list != null && <qualifier> != null !list.contains(myObject) !<qualifier>.contains(<argument_0>) Split compound conditions into Token streams for single conditions - conditions - method invocation list.add(myObject)
  • 38. Recommendation java.util.List.add(MyClass)
  • 39. Recommendation java.util.List.add(MyClass)
  • 40. Recommendation java.util.List.add(MyClass)
  • 41. Recommendation java.util.List.add(MyClass) x x Surrounding if already contains condition Filter predefined method invocations
  • 42. Recommendation java.util.List.add(MyClass) x x Surrounding if already contains condition Filter predefined method invocations
  • 44. A first validation Split history Training set: Past context changes up to a certain release Test set: Context changes after that particular release Recommended context change True positive (TP): in test set False positive (FP): not in test set False negative (FN): context change in test set but not recommended
  • 45. A first validation Project TP #B FP FN ArgoUML 29 11 4675 75 Azureus 15 3 - 82 Eclipse JDT 51 27 - 158 Eclipse PDE 35 25 8011 46 jEdit 1 0 1307 13
  • 46. A first validation Project TP #B FP FN ArgoUML 29 11 4675 75 Azureus 15 3 - 82 Eclipse JDT 51 27 - 158 Eclipse PDE 35 25 8011 46 jEdit 1 0 1307 13
  • 47. Conclusions Recommending context changes We leverages context change data to suggest corresponding modifications on existing or newly added method invocations. ChangeCommander By integrating our recommendation approach into the development process, we aim at reducing future bugs.