A JupyterLab extension that uses an agent-based model to detect buggy and vulnerable code.
This extension is composed of a Python package named bugspyter
for the server extension and a NPM package named bugspyter
for the frontend extension.
- JupyterLab >= 4.0.0
To start using Bugspyter, follow these installation and execution steps:
- First clone this repository to your local system.
- In this current working directory, run
docker build --no-cache -t bugspyter:dev .
- Once the application has been built, run:
docker run --rm -it \
-p 8888:8888 \
-e NB_UID="$(id -u)" -e NB_GID="$(id -g)" \
-v "$PWD":/home/jovyan/bugspyter \
bugspyter:dev bash
- In the Docker shell, run:
pip install -e .
- In the same Docker shell, start JupyterLab:
jupyter lab --ip 0.0.0.0 --no-browser
- Open the printed URL in your browser (http://localhost:8888/…).
- You should see the Bugspyter icon at the top right of the ribbon bar.
If you are seeing the frontend extension, but it is not working, check that the server extension is enabled:
jupyter server extension listIf the server extension is installed and enabled, but you are not seeing the frontend extension, check the frontend extension is installed:
jupyter labextension listIf it is installed, try:
jupyter lab clean
jupyter lab build
We provide helper scripts to help automate the process of running evaluations.
To run evaluations on Santana et al.'s dataset:
- First extract the notebooks by running:
bash experiments/extract_notebooks_Santana.sh experiments/implementation_notebooks_Santana.csv
- Run
python ./automate/run_all_Santana.py
Note: Update CHOSEN_MODEL, SELECTED_LLM, SELECTED_MODEL, and API_KEY in automate/run_all_Santana.py (or set them as environment variables) before running.
To run evaluations on JunoBench's benchmark dataset:
- First clone the repository on HuggingFace in the open terminal:
git clone https://huggingface.co/datasets/PELAB-LiU/JunoBench
- Follow the instruction for
docker pullon their HuggingFace Repo:
docker pull yarinamomo/kaggle_python_env:latest
- In the terminal for this active JunoBench project, run:
docker run \
-v "$(pwd):/junobench_env" \
-v "PATH_TO_CLONED_BUGSPYTER_REPO":/home/jovyan/bugspyter/" \
-w /junobench_env \
-p 8888:8888 \
-it yarinamomo/kaggle_python_env:latest \
bash
- In the Docker shell, run:
pip install -e /home/jovyan/bugspyter
- Run
python /home/jovyan/bugspyter/automate/run_all_JunoBench.py
