Platform for Machine Learning projects on Software Engineering
Перейти к файлу
Ayush Shridhar 7afccd64b9 Raise NotImplementedError in get_distance methods of Similarity models that don't implement it yet (#805) 2019-07-29 15:07:36 +02:00
bugbug Raise NotImplementedError in get_distance methods of Similarity models that don't implement it yet (#805) 2019-07-29 15:07:36 +02:00
http_service Clean cached predictions when a bug gets updated (#786) 2019-07-26 16:47:54 +02:00
infra Fix copy-paste typo with the new indexing schema (#801) 2019-07-28 20:38:05 +02:00
scripts Add an option to use nltk's tokenizer instead of plain split() (#718) 2019-07-29 14:13:13 +02:00
tests Consider remote DB as old if the remote version file returns any HTTP error 2019-07-27 02:05:11 +02:00
.dockerignore Update root dockerignore (#266) 2019-04-12 12:31:52 +02:00
.flake8 Remove useless comment 2019-06-11 17:28:45 +02:00
.gitignore Add .coverage file to .gitignore 2019-06-11 20:06:14 +02:00
.isort.cfg Add a WIP script to find bug-introducing commits (#748) 2019-07-22 14:41:34 +02:00
.pre-commit-config.yaml Update pre-commit repositories 2019-07-17 12:26:24 +02:00
.taskcluster.yml Use my email as owner of CI tasks, or dependabot PRs fail 2019-07-22 11:49:17 +02:00
CODE_OF_CONDUCT.md Remove trailing whitespaces from CODE_OF_CONDUCT.md 2019-05-14 17:31:02 +02:00
CONTRIBUTING.md Clarify unassigned issues rules 2019-07-12 11:54:51 +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 Add a short description about bugbug (#574) 2019-06-10 11:05:30 +02:00
VERSION Version 0.0.85 2019-07-29 12:40:04 +02:00
docker-compose.yml Remove bugs_retrieval image and use the base image instead in its place (#691) 2019-07-12 14:17:41 +02:00
extra-nlp-requirements.txt Bump gensim from 3.7.3 to 3.8.0 (#744) 2019-07-22 12:11:11 +02:00
extra-nn-requirements.txt Update tensorflow from 1.13.1 to 1.14.0 (#599) 2019-06-18 22:49:19 -07: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 Bump numpy from 1.16.4 to 1.17.0 (#796) 2019-07-26 22:23:37 +02:00
run.py Support feature importance visualization for multiclass problems (#662) 2019-07-23 11:27:52 +02:00
setup.py Add a WIP script to find bug-introducing commits (#748) 2019-07-22 14:41:34 +02:00
test-requirements.txt Bump pytest from 5.0.0 to 5.0.1 (#764) 2019-07-22 12:27:55 +02:00

README.md

bugbug

Task Status

Bugbug aims at leveraging machine learning techniques to help with bug and quality management, and other software engineering tasks.

More information on the Mozilla hacks blog: https://hacks.mozilla.org/2019/04/teaching-machines-to-triage-firefox-bugs/

Classifiers

  • assignee - The aim of this classifier is to suggest an appropriate assignee for a bug.

  • backout - The aim of this classifier is to detect patches that might be more likely to be backed-out (because of build or test failures). It could be used for test prioritization/scheduling purposes.

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

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

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

  • defect - 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%).

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

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

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

  • 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.

  • regressionrange - The aim of this classifier is to detect regression bugs that have a regression range vs those that don't.

  • regressor - The aim of this classifier is to detect patches which are more likely to cause regressions. It could be used to make riskier patches undergo more scrutiny.

  • stepstoreproduce - The aim of this classifier is to detect bugs that have steps to reproduce vs those that don't.

  • 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.

Setup

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

Auto-formatting

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

Every time you will try to commit, pre-commit will run checks on your files to make sure they follow our style standards and they aren't affected by some simple issues. If the checks fail, pre-commit won't let you commit.

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.