This is a repository for the paper
Technical Debt Remediation in Python: A Case Study on the Apache Software Ecosystem
It contains the replication package of the study reported in the aforementioned paper.
Most of the workload to replicate this project is automated through scripts.
To reduce the effort further, we also automated the creation of an environment for the study.
The instruction to create the environment and replicate the study are described in the following.
- Install VirtualBox
- Install Vagrant
- Install the plugin
vagrant-docker-compose
. In your command prompt or terminal, run:
$ vagrant plugin install vagrant-docker-compose
- (Optional) Install the plugin
vagrant-vbguest
(VirtualBox Guest Additions). In your command prompt or terminal, run:
$ vagrant plugin install vagrant-vbguest
The VM is controlled via Vagrant and contains the configured environment to run all scripts for this study. Mainly, the VM provides:
- SonarQube (version 7.6-community)
- PostgreSQL (version 11, to store SonarQube data)
- Jupyter + Python + libraries (to run scripts)
Whenever you boot the VM, the environment is initialized and SonarQube is available at http://localhost:9000.
You can control the VM via a command prompt (Windows) or terminal (Linux + MacOS). For that, you:
- Open a command prompt or terminal
- On it, navigate to the root folder of this repository
- Execute one of the following commands
There are several commands available, but we focus on the ones necessary for the study.
# Boot the VM
$ vagrant up
# Stop the VM
$ vagrant halt
# Purge the VM
$ vagrant destroy
# Connect (via SSH) to the VM
$ vagrant ssh
Important Notes
The first boot (or the boot after purging) takes a long time, as it will:
- download and configure the VM
- download and configure the tools (e.g., SonarQube)
The next boots are much quicker as you just "turn the machine on"
Purging the VM will delete all VM files except for the ones in this folder (and subfolders).
Before you run the scripts for the study, you have to configure SonarQube as follows:
-
Change the General Settings in the following way:
- Administration -> Configuration -> General (set each value instead of default value):
- Keep only one analysis a day after -> 876000
- Keep only one analysis a week after -> 5200
- Keep only one analysis a month after -> 5200
- Keep only analyses with a version event after -> 10400
- Delete all analyses after -> 10400
- Delete closed issues after -> 36500
-
Activate more Python rules:
- Quality Profiles -> Python -> Sonar way, from the drop-down menu click on Copy and set a name
- Then click on Inactive and then Bulk Change -> Activate In...
- Back to Quality Profiles and set the new profile as Default (from the drop-down)
To collect the data for the study, you must follow the instructions described in the Jupyter notebook at study.d/Data-Collection.ipynb
. For that:
-
Open Jupyter Lab on your browser (password: sonar)
-
There is a file tree on the left, click on
Data-Collection.ipynb