Platform for Machine Learning projects on Software Engineering
Перейти к файлу
Ayush Shridhar b41170baa5 Add training task for the StepsToReproduce model (#441) 2019-05-22 21:43:11 +02:00
bugbug Import rs_parsepatch only when needed 2019-05-22 16:09:09 +02:00
http_service Update flask from 1.0.2 to 1.0.3 (#459) 2019-05-18 01:46:16 +02:00
infra Add training task for the StepsToReproduce model (#441) 2019-05-22 21:43:11 +02:00
scripts Fix command to train defect/enhancement/task model (#476) 2019-05-21 14:46:57 +02:00
tests Add tests for seniority calculation (#480) 2019-05-22 00:53:11 +02:00
.dockerignore Update root dockerignore (#266) 2019-04-12 12:31:52 +02:00
.flake8 Pre commit setup (#252) 2019-04-09 15:57:29 +02:00
.gitignore Add a new tasks for updating bugbug hook (#289) 2019-04-18 21:20:04 +02:00
.isort.cfg Import rs_parsepatch only when needed 2019-05-22 16:09:09 +02:00
.pre-commit-config.yaml Add a pre-commit hook using codespell (#411) 2019-05-16 17:24:18 +02:00
.taskcluster.yml Add a central place where the models are defined (#398) 2019-05-16 15:34:38 +02:00
CODE_OF_CONDUCT.md Remove trailing whitespaces from CODE_OF_CONDUCT.md 2019-05-14 17:31:02 +02:00
CONTRIBUTING.md Move Contributing section to CONTRIBUTING.md (#406) 2019-05-14 15:51:31 +02:00
LICENSE First commit 2018-03-11 20:12:35 +00:00
MANIFEST.in Move Keras as an optional dependency (#319) 2019-04-26 18:50:02 +02:00
README.md Move Contributing section to CONTRIBUTING.md (#406) 2019-05-14 15:51:31 +02:00
VERSION Version 0.0.30 2019-05-21 16:22:26 +02:00
comment_level_labeler.py Add a central place where the models are defined (#398) 2019-05-16 15:34:38 +02:00
docker-compose.yml Add basic check method and check script (#341) 2019-05-10 12:20:23 +02:00
extra-nlp-requirements.txt Update spacy from 2.1.3 to 2.1.4 (#396) 2019-05-12 12:17:30 +02:00
extra-nn-requirements.txt Add a central place where the models are defined (#398) 2019-05-16 15:34:38 +02:00
pytest.ini Add a mock DB for tests to avoid downloading the full DB (#273) 2019-04-18 14:01:25 +02:00
requirements.txt Update xgboost from 0.82 to 0.90 (#472) 2019-05-21 00:14:05 +02:00
run.py Add a RegressionRange model (#449) 2019-05-18 13:03:57 +02:00
setup.cfg Enable several flake8 checkers 2018-09-21 16:45:04 +02:00
setup.py Add basic check method and check script (#341) 2019-05-10 12:20:23 +02:00
test-requirements.txt Initial tests for repository module (#377) 2019-05-14 11:30:56 +02:00

README.md

bugbug

Classifiers

  • bug vs feature - Bugs on Bugzilla aren't always bugs. Sometimes they are feature requests, refactorings, and so on. The aim of this classifier is to distinguish between bugs that are actually bugs and bugs that aren't. The dataset currently contains 2110 bugs, the accuracy of the current classifier is ~93% (precision ~95%, recall ~94%).

  • defect vs feature vs task - Extension of the previous classifier to detect differences also between feature requests and development tasks.

  • component - The aim of this classifier is to assign product/component to (untriaged) bugs.

  • regression vs non-regression - Bugzilla has a regression keyword to identify bugs that are regressions. Unfortunately it isn't used consistently. The aim of this classifier is to detect bugs that are regressions.

  • tracking - The aim of this classifier is to detect bugs to track.

  • uplift - The aim of this classifier is to detect bugs for which uplift should be approved and bugs for which uplift should not be approved.

  • devdocneeded - The aim of this classifier is to detect bugs which should be documented for developers.

  • qaneeded - The aim of this classifier is to detect bugs that would need QA verification.

  • bugtype - The aim of this classifier is to classify bugs according to their type.

Setup

Run pip install -r requirements.txt and pip install -r test-requirements.txt

If you update the bugs database, run xz -v9 -k data/bugs.json. If you update the commits database, run xz -v9 -k data/commits.json.

Usage

Run the run.py script to perform training / classification. The first time run.py is executed, the --train argument should be used to automatically download databases containing bugs and commits data.

Running the repository mining script

  1. Clone https://hg.mozilla.org/mozilla-central/.
  2. Run ./mach vcs-setup in the directory where you have cloned mozilla-central.
  3. Enable the pushlog, hgmo and mozext extensions. For example, if you are on Linux, add the following to the extensions section of the ~/.hgrc file:
    pushlog = ~/.mozbuild/version-control-tools/hgext/pushlog
    hgmo = ~/.mozbuild/version-control-tools/hgext/hgmo
    mozext = ~/.mozbuild/version-control-tools/hgext/mozext
    firefoxtree = ~/.mozbuild/version-control-tools/hgext/firefoxtree
    
  4. Run the repository.py script, with the only argument being the path to the mozilla-central repository.

Note: the script will take a long time to run (on my laptop more than 7 hours). If you want to test a simple change and you don't intend to actually mine the data, you can modify the repository.py script to limit the number of analyzed commits. Simply add limit=1024 to the call to the log command.

Structure of the project

  • bugbug/labels contains manually collected labels;
  • bugbug/db.py is an implementation of a really simple JSON database;
  • bugbug/bugzilla.py contains the functions to retrieve bugs from the Bugzilla tracking system;
  • bugbug/repository.py contains the functions to mine data from the mozilla-central (Firefox) repository;
  • bugbug/bug_features.py contains functions to extract features from bug/commit data;
  • bugbug/model.py contains the base class that all models derive from;
  • bugbug/models contains implementations of specific models;
  • bugbug/nn.py contains utility functions to include Keras models into a scikit-learn pipeline;
  • bugbug/utils.py contains misc utility functions;
  • bugbug/nlp contains utility functions for NLP;
  • bugbug/labels.py contains utility functions for handling labels;
  • bugbug/bug_snapshot.py contains a module to play back the history of a bug.

Auto-formatting setup

This project is using pre-commit. Please run pre-commit install to install the git pre-commit hooks on your clone.

Then every time you will try to commit, it will check that the files are correctly formatted before letting you commit.