Published April 12, 2021 | Version v1

Online Appendix of "An Extensive Study of Smell-Aware Bug Localization"

  • 1. Tokyo Institute of Technology

Description

Prerequisites

  • Python 3 + pandas, scipy, numpy, matplotlib
  • JupyterLab or Jupyter Notebook

Files Overview

  • `smells/${PROJECT}-${VERSION}.xml`: Results of code smell detection by inFusion
  • `exp/${GROUP}/${PROJECT}/${BLT}_${PROJECT}_${PROJECT}_${VERSION}/recommended/${NUMBER}.txt`: Bug localization result rankings when using `${BLT}` in Bench4BL
  • `exp/${GROUP}/${PROJECT}/${BLT}_${PROJECT}_${PROJECT}_${VERSION}_output.txt`: Gold files in the rankings.
  • `result/${CONFIGURATION}/${BLT}/_${METRIC}.csv`: Summary of smell-aware bug localization results using `$CONFIGURATION` and `$BLT`, evaluated by `$METRIC`, which can be generated in Step 3
    • bid: Target bug ID
    • vid: Target version ID
    • base: Metric value of the baseline approach
    • value: Metric value when using the following alpha
    • alpha: Best (but smallest) alpha value
    • alphas: Best alpha values that maximizing the `$METRIC` (colon-separated)
    • total: Metric value before divided by the number of bugs
  • `cache/projects.csv.bz2`: A list of projects to be used
    • group: Project group name in Bench4BL
    • project: Project name
    • nbugs: Number of bug reports
    • nversions: Number of versions of the project
    • nsources: Average number of source files (among versions)
  • `cache/versions.csv.bz2`: A list of project versions (systems)
    • vid: Version ID (`${PROJECT}-${VERSION}`)
    • group: Project group name in Bench4BL
    • project: Project name
    • version: Version number
    • nsources: Number of source files
    • nbugs: Number of bug reports
    • nsmells: Number of smell instances
  • `cache/bugs.csv.bz2`: A list of bug reports to be used
    • bid: Bug ID (`${PROJECT}-${NUMBER}`)
    • group: Project group name
    • project: Project name
    • vid: Version ID to which the bug belongs
    • version: Version number
    • number: Bug number
  • `cache/smells.csv.bz2`: A list of smell instances, generated from the XML files in `smell/`
    • vid: Version ID
    • granularity: Granularity of the smell (`class` or `method`)
    • package: Package of the target module
    • class: Class of the target module
    • method: Target method if class-level smell, otherwise empty
    • file: Source filename
    • type: Type of the smell
    • severity: Severity of the smell
  • `cache/confs.csv.bz2`: A list of considered configurations, which can be generated in Step 3
    • name: Configuration name (basically `${GRANULARITY}_${AGGREGATOR}_${SELECTOR}`)
    • granularity: Granularity parameter (g)
    • aggregator: Aggregator parameter (a)
    • selector: Type selector parameter (s)
    • level: `basic` (1-150), `individual` (individual smells), `opt` (ideal (0))
  • `Bench4BL-patch/`: Patches for Bench4BL. See Step 1.

Since the files generated from Steps 1-3 that are necessary to run the scripts in Step 4 are contained in the archive, you can start from Step 4 directly.

Step 1. Running Bench4BL

  • Follow the instruction of repository cloning and archive downloading in https://github.com/exatoa/Bench4BL. We used the commit of Aug 8, 2019.
  • Add `Bench4BL-patch/VSM.jar` and `Bench4BL-patch/rVSM.jar` into `techniques/releases/` in Bench4BL.
  • Overwrite `scripts/launcher_Tool.py` with `Bench4BL-patch/launcher_Tool.jar` so that the added two techniques become available.
  • To run Bench4BL, the `Bench4BL-patch/Dockerfile` may be useful:
    • % docker run -it -v /path/to/Bench4BL:/mnt/exp/Bench4BL bench4bl /bin/bash
  • Put the generated results to `exp/`.

Step 2. Preprocessing ranking files

  • Run `preprocess.ipynb` so that the files will be generated in `preprocessed/`.
  • `preprocessed/${BLT}/${PROJECT}_${VERSION}/${NUMBER}.csv`: Bug localization result rankings attached with additional oracle and smell information, which can be generated in Step 2
    • rank: Rank in the ranking
    • gold: Whether the file is gold or not
    • file_name: Source filename
    • nscore: Similarity score obtained from the bug localization technique
    • class_smells: List of class-level smells with their severity (comma-separated)
    • method_smells: List of method-level smells with their severity (comma-separated)

Step 3. Applying smell-aware bug localization

  • Run `sabl.ipynb` so that the files in `result/` will be generated.

Step 4. Analysis

  • Run `analysis-rq1.ipynb` for RQ1, RQ3, and RQ4.
  • Run `analysis-rq2.ipynb` for RQ2. Files generated by Step 2 are needed, which are not included in the archive.
  • Run `analysis-rq3.ipynb` for RQ3.

Files

Files (1.0 GB)

Name Size
md5:c16672f2bc35fc92163a05c73dd6e81b
1.0 GB Download