Skip to content

Commit cea4449

Browse files
committed
Reduce duplication
1 parent 640715b commit cea4449

File tree

6 files changed

+15
-39
lines changed

6 files changed

+15
-39
lines changed

scripts/experiment-scripts/README.md

Lines changed: 4 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -10,33 +10,11 @@ These scripts execute various configurations of the mutation analysis and defect
1010
detection driver scripts, collect results, and generate the corresponding
1111
figures and tables.
1212

13-
### Setup
13+
## Setup
1414

1515
To set up the environment, refer to the `scripts/prerequisites.md` file.
1616

17-
#### Python Dependencies
18-
19-
Before running any experiment scripts, ensure the following Python packages are installed:
20-
21-
* `pandas`
22-
* `matplotlib`
23-
* `seaborn`
24-
25-
Install these packages using your preferred Python package manager. For example:
26-
27-
**With pip:**
28-
29-
```sh
30-
pip install pandas matplotlib seaborn
31-
```
32-
33-
**With uv:**
34-
35-
```sh
36-
uv pip install pandas matplotlib seaborn
37-
```
38-
39-
### Running Scripts
17+
## Running Scripts
4018

4119
To generate the desired figures or tables from the paper, run the corresponding
4220
shell script. For example, to generate **Figure 7**, use:
@@ -45,7 +23,7 @@ shell script. For example, to generate **Figure 7**, use:
4523
./mutation-fig7.sh
4624
```
4725

48-
* To generate **Table 4 (defect detection)**:
26+
To generate **Table 4 (defect detection)**:
4927

5028
```sh
5129
./defects4j-table4.sh
@@ -57,7 +35,7 @@ Each script is documented at the top of its file with:
5735
* What input parameters or configuration it expects
5836
* What output files it will produce and where
5937

60-
### Output
38+
## Output
6139

6240
Each experiment script writes its output to the `results/` directory. This includes:
6341

scripts/experiment-scripts/defects4j-table4.sh

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -42,11 +42,8 @@ if [ -z "$PYTHON_EXECUTABLE" ]; then
4242
exit 1
4343
fi
4444

45-
# Clean up previous run artifacts
46-
rm -rf "$GRT_TESTING_ROOT"/build/defects4j-src/*
47-
rm -rf "$GRT_TESTING_ROOT"/build/randoop-tests/*
48-
rm -rf "$GRT_TESTING_ROOT"/build/evosuite-tests/*
49-
rm -rf "$GRT_TESTING_ROOT"/build/evosuite-report/*
45+
# Clean up previous run artifacts.
46+
make -C "$GRT_TESTING_ROOT" clean
5047
rm -f "$GRT_TESTING_ROOT"/results/table4.pdf
5148
rm -f "$GRT_TESTING_ROOT"/results/table4.csv
5249

scripts/experiment-scripts/mutation-fig7.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@ SCRIPT_NAME=$(basename -- "$0")
3737
GRT_TESTING_ROOT="$(realpath "$SCRIPT_DIR"/../)"
3838
. "$SCRIPT_DIR"/common.sh
3939

40-
# Clean up previous run artifacts
40+
# Clean up previous run artifacts.
4141
make -C "$GRT_TESTING_ROOT" clean
4242
rm -f "$GRT_TESTING_ROOT"/results/fig7.pdf
4343
rm -f "$GRT_TESTING_ROOT"/results/fig7.csv

scripts/experiment-scripts/mutation-fig8-9.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,7 @@ GRT_TESTING_ROOT="$(realpath "$SCRIPT_DIR"/../)"
4242

4343
. "$SCRIPT_DIR"/common.sh
4444

45-
# Clean up previous run artifacts
45+
# Clean up previous run artifacts.
4646
make -C "$GRT_TESTING_ROOT" clean
4747
rm -f "$GRT_TESTING_ROOT"/results/fig8-9.pdf
4848
rm -f "$GRT_TESTING_ROOT"/results/fig8-9.csv

scripts/mutation-randoop.sh

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -561,10 +561,11 @@ for i in $(seq 1 "$NUM_LOOP"); do
561561
exec 1>> "$RESULT_DIR"/mutation_output.txt 2>&1
562562
fi
563563

564-
# We cd into the result directory because Randoop generates jacoco.exec in the
565-
# directory in which it is run. This is a concurrency issue since multiple
566-
# runs will output a jacoco file to the exact same spot. Each result directory
567-
# is unique to each instance of this script.
564+
# We cd into the result directory (which is unique to each execution
565+
# of this script) because Randoop generates `jacoco.exec` in the
566+
# directory in which it is run. Otherwise, there would be a
567+
# concurrency issue since multiple runs will output a jacoco file to
568+
# the exact same spot.
568569
cd "$RESULT_DIR"
569570

570571
GENERATOR_COMMAND=(

scripts/prerequisites.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -73,6 +73,6 @@ export JAVA11_HOME=/path/to/your/java11
7373
This is needed because different scripts require different Java versions:
7474

7575
* **Defect scripts** (via [Defects4J](https://github.com/rjust/defects4j))
76-
require **Java 11**.
76+
require **Java 11**.
7777
* **Mutation scripts** (via [Major](https://github.com/rjust/major))
78-
require **Java 8**.
78+
require **Java 8**.

0 commit comments

Comments
 (0)