This folder contains the curated components, tools, and data used in the APR-with-mined-human-patterns project. It bundles the EnCus replication package, change collectors, pre-built pools and example results.
Summary
Collector/: Jupyter notebooks, scripts and raw outputs used to collect change vectors and build candidate pools. Contains datasets (dataset/) andoutputs/with collected candidate files and indices.CommitVectorData/: Precomputed change-vector datasets and related README describing how vectors are organized (GumTree3.0, GumTree4.0, LAS formats and per-project folders).EnCus/: The main EnCus implementation with build scripts, Dockerfiles, and components such ascore/ChangeCollector,confix/(APR), andLCE/(Longest Common subsequence Extractor). This folder is intended for building and experimenting with the full EnCus pipeline.EnCus_Real_Scenario/: A Docker-ready variant of EnCus tailored for reproducible experiments and thedirect-filesworkflow. This folder includes: Use this folder for fast, container-based testing of single-file cases or reproducible experiments.Example_Result/: Example output runs and saved results demonstrating successful runs (e.g., Closure examples).Helper/: Utility scripts and helper tools such as GumTree maker wrappers, SZZ tooling, CSV post-processing tools, and commit extraction helpers used throughout the pipeline.
Quick start (Docker, recommended)
- Build the image:
docker compose build
docker compose up -d- Enter the running container:
docker compose exec encus /bin/bash- From inside the container, run the default test (debug mode uses Closure-14 example):
python3 launcher.py --debugDirect files mode (no Defects4J)
EnCus provides a direct-files mode so you can run the pipeline with two plain Java files instead of preparing a Defects4J checkout. This is useful for quick experiments, debugging, and CI-friendly tests.
What you need
- Two Java files:
BBIC.javaandBIC.java(BBIC = the buggy/target file; BIC = the other version used by the pipeline). Place them somewhere accessible to the launcher or inside the container when using Docker. - Ensure
SPI.inicontains the following keys (or use the exampleSPI_direct_files_docker.ini):
mode = direct-files
bbic_file_path = /absolute/or/container/path/to/BBIC.java
bic_file_path = /absolute/or/container/path/to/BIC.java
JAVA_HOME_8 = /path/to/java8How it works (brief)
- The launcher maps the provided file paths into
ChangeCollectorinputs and creates minimal metadata so the rest of EnCus (LCE, pool selection, ConFix) can run without a full git/Defects4J workflow. run_direct_files_docker.shis an example wrapper that: switches JDKs with SDKMAN, copies or mounts the input files into the container workspace, and runslauncher.py -c SPI_direct_files_docker.ini.- ConFix and ChangeCollector were adjusted so the direct-files flow uses sane defaults: pool path and classpath are inferred or set to container-friendly defaults, and common system-scoped dependencies are added to ConFix's runtime classpath.
Quick run (Docker example)
# Start container (from repo root)
docker compose up -d
# Use the example runner (it sets up SDKMAN/JDK and runs launcher with the example ini)
./EnCus_Real_Scenario/run_direct_files_docker.shQuick run (local, no Docker)
- Edit
SPI.inior a copy (e.g.,SPI_direct_files_local.ini) and setmode = direct-filesand the two file paths. - Ensure
JAVA_HOME_8points to a JDK 8 installation. - Run:
python3 launcher.py -c SPI_direct_files_local.iniTroubleshooting notes
- Missing
JAVA_HOME_8: ConFix requires JDK 8 for compilation and runtime. SetJAVA_HOME_8inSPI.inior use the wrapper scripts that switch JDKs via SDKMAN. - Classpath/NoClassDefFoundError: If ConFix reports missing classes, ensure
core/confixdependencies (e.g.,las.jar,jcodelib.jar) are reachable. The Docker image includes fixes that add these to the runtime classpath. - File path issues: Use absolute paths inside
SPI.iniwhen running in Docker, or mount the host directory into the container at a known location. - Use
--debugfor a quick sanity run (python3 launcher.py --debug) which executes a faster example flow to validate the environment.
Outputs
- Results (logs,
diff.txtif a patch is found) are written to thebyproducts/directory inside the EnCus variant you ran (EnCus_Real_Scenario/byproductswhen using that folder). Check timestamps and nested folders for the specific run.
Tips
- If you plan to run many single-file experiments, create a small wrapper script that validates file paths, sets
SPI.inikeys, and calls the Docker example runner to ensure reproducibility.
Contributing and support
If you plan to modify components or re-run collection pipelines, please ensure you have the required JDK versions (8 and 17), Gradle and Maven available. Use the included preconfig.sh to help install required tools when running locally (non-Docker).
License & citation Please cite the original EnCus paper when using this code for research: https://ieeexplore.ieee.org/abstract/document/10989047