- The
catcoderdirectory contains the source code of our approach CatCoder, benchmark datasets and evaluation scripts - The
resultsdirectory contains evaluation results used in the paper, including the metric values and detailed generated code
- Linux
- Python 3.10+
- NVIDIA GPUs (with enough VRAM for LLMs)
- Install Defects4J and its dependencies (please refer to the instructions at https://defects4j.org/)
- Install Rust, Cargo and rust-analyzer (by running
curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | shand thenrustup component add rust-analyzer)
- A clean
condaenvironment is recommended, so that the following operations only affect a specific environment. - cd into
catcoder/rustand unzipcrates.zipto the current directory. - To run evaluation code, install the dependencies by running
pip install -r requirements.txtincatcoder. - To use CatCoder's code for further research, it has to be configured in addition to the previous steps:
- cd into
catcoder/tools/java, and runpython setup.py install. - cd into
catcoder/tools/intellirust, and run./configure && cargo cmd install.
- cd into
- To run the experiments in the paper, and evaluate CatCoder (and other methods/LLMs) on the benchmarks:
- cd into
catcoder/{java|rust}, modify the__main__block (specify the method and the model for evaluation) inevaluation.py, and then runpython evaluation.py. (The context data of all methods, including the baselines, has already been generated and stored in the benchmark datasets)
- cd into
- For further research:
- The benchmark datasets are located at
catcoder/{java|rust}/datasets. catcoder/tools,catcoder/{java|rust}/retrieve_relevant_code.pyandcatcoder/{java|rust}/extract_type_context.pycontain the implementation of CatCoder.
- The benchmark datasets are located at