An experimental Python library for program slicing that decomposes source code using various dependence graphs to aid in code analysis and refactoring.
Program Slicing. Experimental library.
This tool is designed for developers and researchers who need to analyze and decompose source code to identify method refactoring opportunities or understand code dependencies. It can be used as a command-line tool or integrated as a Python submodule for automated security analysis or DevSecOps workflows.
Requires Python 3.9 and a compatible C compiler installed. Access to the global network is needed for pip installation. The tool can be used both as a CLI and as a submodule within other Python projects, enabling flexible integration in security automation and DevSecOps pipelines.
git clone git@github.com:acheshkov/program_slicing.git
cd program_slicing
git submodule update --recursive --init
pip3 install ./program_slicing
python cli.py slice MyProjectPath
Decompose source code in the specified project directory using complete computation slicing.
python cli.py slice MyFile.java
Decompose a single source file using program slicing.
python cli.py slice MyProjectPath --output MyResultPath
Decompose source code and save the slice decomposition results to a specified directory.
python cli.py slice MyFile.java --output MyResultPath
Decompose a single source file and save the output to a specified file or directory.