Longitudinal Analysis of the Applicability of Program Repair on Past Commits
Open science repository with scripts and data about our paper.
Tool
The jar file of the tool is included in the "tool" folder. RSCommitDetector is built on top of Coming and the name of the jar file is "coming.jar". In this folder, "commands.sh" shows some sample commands for executing the tool.
The source code of the tool is not available here to prevent from causing problems for the double-blind review.
Output
The "output" folder contains the zipped output of running RSCommitDetector on 72 repositories of Bears.
Results
The "results" folder contains the results of analyses. In addition to "selected-commits.csv", it also includes the change patterns that we have used to encode the search space of repair tools. It also includes the results of running RSCommitDetector on ground-truth patches (in answer to RQ3).
results/selected-commits.csv
contains results of a manual evaluation on the precision of RSCommitDetector.
The meaning of scores in the "evaluation result" column is determined according to the following table:
Score | Meaning |
---|---|
0 | The commit is not an instance of the tool at all |
1 | The commit is not an instance of the tool but could have been with small changes (currently, there is no instance of this type) |
2 | The commit is an instance of the tool |
Two clarifications:
- We call a commit an instance of tool X iff: the AST changes in ".java" files of the commit are the same as AST changes in a patch in the search space of X.
- We suppose that repair tools extract ingredients from the same file as where the change is made.
The assumed functionality of repair tools
Arja
Strategies:
- A statement is removed.
- A statement is replaced by a new statement.
- A new statement is added.
Ingredients: The new statement is copy of an existing statement where the variables, methods called, and literals can be replaced by ingredients from the tool scope (i.e. changed file).
Cardumen
Strategies
- An expression is replaced by a new expression.
Ingredients The new expression should be a copy of an existing expression where the variables and literals can be replaced by ingredients from the tool scope (i.e. changed file).
Elixir
Section III.B of this paper.
JGenProg
Strategies:
- A statement is removed.
- A statement is replaced by a new statement.
- A new statement is added.
Ingredients: The new statement is a copy of an existing statement. Note that a statement can be a block containing multiple substatements.
JKali
Strategies:
- A statement is removed.
- The condition of an if statement is change to true or false.
- A return statement is added. The return value should be either null, 0, or -1.
JMutRepair
Strategies:
- The operator of a binary if condition is changed.
- The operator of a unary if condition is changed.
NPEfix
Table 1 of this paper.
Nopol
Strategies:
- The condition of an if statement is replaced by a new one.
- A statement is wrapped insided an if statement.
Ingredients In both strategies, the variables, literals, and method calls used in the if condition should be selected from the tool scope (i.e. changed file).
Review Process
Determining Instances of Tools
The manual experiment for measuring the precision should be performed according to these steps:
- Downloed the CSV file.
- Open the commit links for your target tool (X) one by one.
- For each commit:
- Suppose that repair tool X is executed on the old source code and S is the set of its search space.
- Check if the AST of the new source code is equal to the AST of any members of S.
- If yes: put 2 in the evaluation result cell of the corresponding row.
- If no but could have been with some small changes: put 1 in the evaluation result cell of the corresponding row.
- If no, not at all: put 0 in the evaluation result cell of the corresponding row.
- If you have any comments about this commit, write it in the comment cell.
- Save the modified csv file and create a pull request. There might be some conflicts, don't worry; we will fix it later.
Determining Bug-fix Commits
The manual experiment for determining the bug-fix detected commits.
- Clone this repository.
- Open the "results/detected_checked_on_all.csv" file. Open the commit links assigned to you.
- If it is a bug-fix commit, put "bug-fix" at the end of the line.
- If it is not a bug-fix commit, put "non-bug-fix" at the end of the line.
- If you are very confused and cannot decide about it, put "dont-know" at the end of the line.
- Save the file and create a pull request with the updated version.
Please have these points in mind while doing the analysis:
- A bug-fix commit is a change to the behavior of the application, which only affects a small fraction of the input space, in order to align the actual behavior with the expected behavior.
- To classify the commit as bug-fix or not, the annotator analyzes both the diff and the message of the commit. Examples of bug-fix commits are: 'fix bug #1234' (message), add a null check (code).
- A fix in the test suite is not a bug-fix.
- Commits that only change logs are not bug-fix commits.