IAC 2024 - IA Fast Track to Search Focused AI Solutions
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);
}
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
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
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.