We revisit the performance of template-based APR to build comprehensive knowledge about the effectiveness of fix patterns, and to highlight the importance of complementary steps such as fault localization or donor code retrieval. To that end, we first investigate the literature to collect, summarize and label recurrently-used fix patterns. Based on the investigation, we build TBar, a straightforward APR tool that systematically attempts to apply these fix patterns to program bugs. We thoroughly evaluate TBar on the Defects4J benchmark. In particular, we assess the actual qualitative and quantitative diversity of fix patterns, as well as their effectiveness in yielding plausible or correct patches. Eventually, we find that, assuming a perfect fault localization, TBar correctly/plausibly fixes 74/101 bugs. Replicating a standard and practical pipeline of APR assessment, we demonstrate that TBar correctly fixes 43 bugs from Defects4J, an unprecedented performance in the literature (including all approaches, i.e., template-based, stochastic mutation-based or synthesis-based APR).
Handwritten Text Recognition for manuscripts and early printed texts
TBar: Revisiting Template-based Automated Program Repair
1. TBar: Revisiting Template-based
Automated Program Repair
Kui LIU, Anil Koyuncu, Dongsun Kim and Tegawendé F. Bissyandé
SnT, University of Luxembourg, Luxembourg
2019-07-17, Wednesday @ISSTA 2019, Beijing, China
2. 1
> Fix Pattern
Fix pattern: e.g., PAR, kim2013ICSE [23].
Fix template: e.g., SOFix, liu2018SANER [40].
Abstract modification: e.g., SimFix, jiang2018ISSTA [18].
Mutation operator: e.g., CapGen, wen2018ICSE [69].
Modification rule: e.g., ssFix, xin2017ASE [74].
Code transform: e.g., Genesis, long2017FSE [41].
Program transformation schemas: e.g., SketchFix, hua2018ICSE[17].
“A fix pattern is a pair of a code context representing a buggy code entity
and a set of related change operations, which can be applied to a given
buggy code entity to generate fixing code.” ---- Liu et al. TSE 2018 [35].
FP: <Code Context, {Change Operations}>
4. 3
> Study Methodology
1. SLR: Systematically review the APR literature related to fix patterns.
2. Taxonomy: enumerate and summarize fix patterns.
3. A Baseline Repair Tool: implement a comprehensive pattern based APR tool.
4. Empirical Study on Performance and Sensitiveness.
6. 5
> Fix Pattern Inference in the Literature
1. Manual Summarization.
2. Automated Mining.
3. Pre-definition.
4. Statistics of Actions.
1) Pan et al. EMSE-2009, 27 fix patterns, 5 Java projects.
2) Kim et al. ICSE-2013, 10 fix patterns, 62,656 patches.
1) Long et al. FSE-2017, 108 fix patterns for 3 kinds of defects.
2) Liu and Zhong, SANER-2018, 12 fix patterns, Stack Overflow.
1) Saha et al. ASE-2017, 11 fix patterns, on the top of PAR.
2) Hua et al. ICSE-2018, 6 fix patterns.
1) Wen et al. ICSE-2018, top-30 frequent code change actions.
2) Jiang et al. ISSTA-2018, top-16 frequent code change actions.
7. 6
> Fixing a Bug with a Fix Pattern
--- a/source/org/jfree/chart/renderer/category/AbstractCategoryItemRenderer.java
+++ b/source/org/jfree/chart/renderer/category/AbstractCategoryItemRenderer.java
@ -1796,4 +1796,4 @
CategoryDataset dataset = this.plot.getDataset(index);
- if (dataset != null) {
+ if (dataset == null) {
return result;
}
A Defects4J Bug Chart-1.
Action Type: Update,
Granularity: Expression.
Spread: Single statement.
Fix Pattern: Mutate Operator.
16. 15
> Experiment #1: TBar with Perfect Fault Localization
Research Questions :
RQ1. How many bugs from Defects4J can be correctly fixed by
fix patterns from our taxonomy?
RQ2. Can each Defects4J bug be fixed by different fix patterns?
RQ3. What are the properties of fix patterns that are successfully
used to fix bugs?
17. 16
> RQ1: Number of Fixed Bugs
Project Chart
(C)
Closure
(Cl)
Lang
(L)
Math
(M)
Mockito
(Mc)
Time
(T)
Total
# fully
fixed bugs
12/13 20/26 13/18 23/25 3/3 3/6 74/101
# partially
fixed bugs
2/4 3/6 1/4 0/4 0/0 1/1 7/20
Number of bugs fixed by fix patterns in TBar with perfect fault localization
18. 17
> Limitation and Discussion
1. Insufficient fix patterns.
2. Less effective search of fix ingredients.
public String generateToolTipFragment(String toolTipText) {
- return " title="" + toolTipText
+ return " title="" + ImageMapUtilities.htmlEscape(toolTipText)
+ "" alt=""";
}
Matchable fix pattern: FP9.2.
Donor code searching
in “local” file
19. 18
> RQ2: Number of Fix Patterns vs. Fixing Bugs
28
9
2
1
38
10
5
3
10
4
4
3
1
1
1
1
1
2
3
4
5
>5#FIX
PATTERNS
P #1 #2 #3 #4
It is important to select appropriate fix patterns for different bugs.
20. 19
> RQ3: Fix Pattern Properties
85
49
24
4
43
32
18
2
Update Insert Delete Move
#fixedbugs
122
38
2
54
39
2
Expression Statement Method
140
22
71
24
Single Multiple
Plausibly BUT Incorrectly fixed bugs. Correctly fixed bugs.
a. Change Actions b. Change Granularity c. Changed Spread
Repair performance is different among fix patterns properties.
22. 21
> Experiment #2: TBar with Normal Fault Localization
Research Questions:
RQ4. What performance can be achieved by TBar in a standard
and practical repair scenario?
RQ5. To what extent are the fix pattern based repair tool sensitive
to noise in fault localization (i.e., spotting bug positions)?
23. 22
> RQ4: Performance Comparison with the State-of-the-Art
TBar outperforms all recent state-of-the-art APR tools
that were evaluated on the Defects4J dataset.
24. 23
> RQ5: Fault Localization Sensitiveness
Fault localization noise has a significant impact on
the performance of TBar.
Plausibly but incorrectly fixed bugs
24 1514
1
Fully fixed Partially fixed
#fixed
bugs
incorrect position
correct position
26. 25
> SUMMARY
10
> TBar: Template-Based automated program repair
Overall Workflow of TBar.
GZoltar and Ochiai
23
> Standard Practical Performance
https://github.com/SerVal-DTF/TBar
Hinweis der Redaktion
Good morning, every one, my name is Kui Liu.
I am a PhD student from University of Luxembourg.
In a recent decade, different APR tools have been proposed to fix bugs in different ways.
Our work is to build a new base line to encourage people for advancing program repair.
Fix Pattern is defined as a pair …
It is also names as ..
In the literature, fix patterns have been widely used in program repair. And have achieved promising results.
However, different tools use different fix patterns. It is not qualified.
How diverse are the fix patterns used by the state-of-the-art?
This study is trying to answer these questions.
To answer these questions, this work consists of four parts.
Forum like stack overflow.
Looking at this patch, we can find that the action type is “update”, replacing the buggy operator with another one.
The directly impacted granularity is an operator, which is a kind of expression, so the granularity of this fix pattern is Expression.
This fix pattern is mutating operator, that means, only one statement will be impacted by it.
So the spread is single statement.
According to a literature review, we summarized fix patterns into 15 categories.
So that, the 15 categories include 35 fix patterns.
Let’s take a look at the properties of these 35 fix patterns.
From the aspect of action types. There are 4 types.
With the AST node information, we will match fix patterns for the statement in terms of breadth first search.
Change condExp1 with condExp2, the question is where do we find the ccocndExp2.
Now, let us take a look at the repair …
In this experiment, we focus on these three questions.
We have two kinds of results: fully fixed bugs and partially fixed bugs.
There results are very promising.
However,
Y-axis
The correct patches are mainly generated by update and insert action type fix patterns.
Expresion, and Statement, and Single,
However, they also can generate more plausible patches than others.
We further compare the performance of TBar with the state-of-the-art.
Assessment of TBar
Checking ICSE2019 Paper
This baseline outperforms the state-of-the-art in terms of the number of fixed bugs.