Artifact for "Predictive Program Slicing via Execution Knowledge-Guided Dynamic Dependence Learning"
ND-Slicer is a learning-based predictive slicing tool. The source code, data, and model artifacts are publicly available on GitHub and Zenodo.
This section describes the preqrequisites, and contains instructions, to get the project up and running.
ND-Slicer
requires a GPU to run fast and produce the results. On machines without a GPU, note that it can be notoriously slow.
Currently, ND-Slicer
works well on Ubuntu OS, and can be set up easily with all the prerequisite packages by following these instructions (if conda
is already installed, update to the latest version with conda update conda
, and skip steps 1 - 3):
-
Download the latest, appropriate version of conda for your machine (tested with
conda 23.11.0
). -
Install it by running the
conda_install.sh
file, with the command:$ bash conda_install.sh
-
Add
conda
to bash profile:$ source ~/.bashrc
-
Navigate to
nd-slicer
(top-level directory) and create a conda virtual environment with the includedenvironment.yml
file using the following command:$ conda env create -f environment.yml
To test successful installation, make sure
autoslicer
appears in the list of conda environments returned withconda env list
. -
Activate the virtual environment with the following command:
$ conda activate autoslicer
Navigate to nd-slicer/data/
to find:
- Raw dataset file (
codenetmut_test.json
) -- use these files to build train/validation/test splits from scratch. - Processed dataset files (
{full|train|val|test}-dataset.jsonl
) -- use these files to benchmark predictive slicing approaches, or replicate intrinsic evaluation results in the paper (Section 5, Table 1).
Navigate to nd-slicer/outputs/
to find the trained model weights for CodeExecutor (B2), GraphCodeBERT+PointerTransformer (B3), GraphCodeBERT+Transformer (B4), CodeExecutor+PointerTransformer (B5), and CodeExecutor+Transformer (B6).
Navigate to nd-slicer/src/
to find the source code for running all the experiments/using ND-Slicer to predict dynamic slices for a Python program.
See link for details about replicating results in the paper, as well as using ND-Slicer
to predict slices for Python programs. Here's an executive summary of the same:
Experiment | Table # in Paper | Run Command(s) | Model Artifact(s) for Direct Inference |
---|---|---|---|
(RQ1) Intrinsic Evaluation on Executable Python Code | 1 | click here | CodeExecutor (B2) |
GraphCodeBERT + PointerTransformer (B3) | |||
GraphCodeBERT + Transformer (B4) | |||
CodeExecutor + PointerTransformer (B5) | |||
CodeExecutor + Transformer (B6) | |||
(RQ2) Intrinsic Evaluation on Non-Executable Python Code | - | click here | CodeExecutor + Transformer (B6) |
(RQ3) Extrinic Evaluation (Crash Detection) | 2 | click here | CodeExecutor + Transformer (B6) |
(RQ4) Qualitative Analysis (Statement Types) | 3 | click here | CodeExecutor + Transformer (B6) |
(RQ5) Qualitative Analysis (Execution Iterations) | 4 | click here | CodeExecutor + Transformer (B6) |
(RQ6) Inter-Procedural Analysis | - | click here | CodeExecutor + Transformer (B6) |
There are no specific guidelines for contributing, apart from a few general guidelines we tried to follow, such as:
- Code should follow PEP8 standards as closely as possible
- Code should carry appropriate comments, wherever necessary, and follow the docstring convention in the repository.
If you see something that could be improved, send a pull request!
We are always happy to look at improvements, to ensure that nd-slicer
, as a project, is the best version of itself.
If you think something should be done differently (or is just-plain-broken), please create an issue.
See the LICENSE file for more details.