This project includes an automation script to streamline the process of generating and comparing "buggy" and "fixed" versions of the code snippets.
-
Download
label_app.html -
Copy the values from the line starting with
const PAIRS =todata/data.json -
Ensure the script executable:
chmod +x run_all.sh
-
Run the automation script: Execute the script from the root of the project directory.
./run_all.sh
The run_all.sh script performs the following sequence of actions:
- Generates Buggy Code: It runs
python3 main.py buggy_code, which creates a.javafile in theoutput/directory for each code snippet's "buggy" version. - Stages Changes: It executes
git add .to stage the newly created buggy files. - Generates Fixed Code: It then runs
python3 main.py fixed_code, which overwrites the existing files with the "fixed" versions of the code.
After the script completes, you can easily view the differences between the buggy and fixed versions of each file using standard Git commands.
To see the changes for all files, run:
git diffTo see the changes for a specific file:
git diff output/S1.javaTo clean the output, run the clean.sh script:
./clean.sh-
Run the script with
python main.py buggy_code
NOTE: The
buggy_codevalue from each element indata.jsonwill be written tooutput/<id>.java -
Stage the files in output/
git add output/
-
Run the script again with
python main.py fixed_code`
You should now be able to see the diff in each java file.