I run this project in Intellij with Maven, so you might want to do that as well.
I use Anaconda to manage the Python environement.
To create the environment, run conda env create -f environment.yml
.
Then every time you want to activate the environment, run conda activate multiedit-empiricalstudy
.
-
Get coverage data for projects by running the
multiedit.coverage.DoCoverageExperiments
main class. It will run the analysis on all bugs in Bears and Defects4J that are listed indata/multitest_multiedit.txt
. -
The data files are in
data/coverage-experiments
. I recommend moving these files so that future executions ofmultiedit.coverage.DoCoverageExperiments
andmultiedit.coverage.DoCoverageExperimentsBuggy
do not overwrite these files. If you would like to use the data I've already collected, the data I use for my experiments is indata/coverage-experiments/coverage-data-final
. -
The coverage analysis isn't 100% accurate, so manually move some of the bugs between different categories. The decisions I made are listed in
data/coverage-experiments/README.md
. -
To draw the plots, change the
folder
variable insrc/main/python/coverage.py
to the folder where your data is in, contained in a list. Then runsrc/main/python/coverage.py
from the root folder of this repository (to ensure that the relative paths work).
-
Get coverage data by running the
multiedit.coverage.DoCoverageExperimentsBuggy
main class (a slightly different class than the one in the previous experiment). At the top ofmultiedit.coverage.DoCoverageExperimentsBuggy
, there is a flag calledintersectPatch
. This flag can be toggled to report all coverage results, or only line numbers in the patch. -
Similarly to the previous experiment, the resulting data can be found in
data/coverage-experiments
. The data I used in these experiments can be found in 4 folders:data/coverage-experiments/buggy-versions
anddata/coverage-experiments/buggy-versions-only-bears
for coverage of the entire buggy programs, anddata/coverage-experiments/buggy-versions-locations-only
anddata/coverage-experiments/buggy-versions-locations-only-bears
for coverage results for patch locations. -
This time I didn't do any post processing (but you could!)
-
In
src/main/python/coverage_buggy_program.py
, change the variables at the top forbuggy_coverage_folders
andexp_1_folder_name
to the folder where you stored the results of step 2 and the folder where you stored the results of experiment 1, respectively. Then runsrc/main/python/coverage_buggy_program.py
from the root directory of this repository.
-
Make sure you have the coverage results from Experiments 1 and 2 (Steps 1-3 in both experiments).
-
At the top of
src/main/python/statements_in_diffs.py
, change thecoverage_buggy
andcoverage_patched
to the folders where the coverage results are stored. -
Run
src/main/python/statements_in_diffs.py
. This produces two outputs:data/uncovered_chunk_classification.json
has the classifications for each deleted/modified locations in the buggy version, and standard output has the classification for added/modified lines in the patched version as well as basic statistics on the number of lines/chunks. -
Run
src/main/python/plot_uncovered_chunks.py
. This creates a plot of the classification of deleted/modified locations in the buggy version of the programs. The standard output also has the classifications for all the deleted/modified lines (similar to the output of the previous step). -
I did the rest of the coverage analysis in a spreadsheet, from the output of the previous two steps.