Before running the analysis notebooks:
- unzip the three zip files within this folder (callgraph_seq.zip, pycg_output.zip, DynaPyt_callgraphs.zip).
- create a Python virtual environement (Use Python 3.10 or above)
python3.10 -m venv .venv source .venv/bin/activate
- Install requirments
pip install -r requirements.txt
You can reproduce the plots of the overview of the benchmark by running the notebook: dypybench_overview_plots.ipynb
In this part we generate Dynamic Call Graphs using DynaPyt and we also generate Static Call Graphs using PyCG, then we compare them.
To generate a dynamic call graph for a project (e.g, project 1), the following commands should be executed (note that it takes on average around 4 Hours to complete the generation per project, so run carefully)
# Run test (necessary to setup the project)
python3 dypybench.py --test 1
# Run instrumentation
python3 dypybench.py --dynapyt_instrument 1 --dynapyt_file ./text/includes.txt --dynapyt_analysis CallGraph
# Run the analysis
python3 dypybench.py --dynapyt_run 1 --dynapyt_analysis CallGraph
Once the the commands finished executed, a json file would appear under the project folder (~/temp/project1).
To generate a static call graph for a given project, run the following commands (For documentation, check: https://github.com/vitsalis/PyCG):
# Run test (necessary to setup the project)
python3 dypybench.py --test 1
# call PyCG
pycg --package project1 $(find project1 -type f -name "*.py") -o project1.json
The analysis of callgraphs was done in the notebook: callgraphs.ipynb
# Run LExecutor instrumentation
python3 dypybench.py --lex_instrument 1 --lex_file ./text/includes.txt
# Generate Traces
python3 dypybench.py --lex_test 1
A ".h5" file would be generate within the project folder.
To retrain LExector, follow the instruction of the LExecutor repository.
The plot presented in the paper can reproduced by calling the Python script: generate_lexecutor_acc.py
Example on project 1.
# Run test (necessary to setup the project)
python3 dypybench.py --test 1
# Run instrumentation
python3 dypybench.py --dynapyt_instrument 1 --dynapyt_file ./text/includes.txt --dynapyt_analysis CallGraphSeq
# Run the analysis
python3 dypybench.py --dynapyt_run 1 --dynapyt_analysis CallGraphSeq
The specification mining is done in the notebooks: spec_mine.ipynb and plots_sec4.3.ipynb