Git Product home page Git Product logo

bugspots's Introduction

bugspots

What is bugspots?

Bugspots is a Python implementation of the bug prediction algorithm used at Google. It also embed a command-line interface which can be used to list the "hot spots" of a Git repository.

What is a hot spot?

A hot spot is merely a file that is bug-prone.

How does it work?

The algorithm is very simple and to the point: it gives each file a score based on its number of bug-fixing commits and their age, and then return a descending-ordered list of the files based on their score, filtering commits that are no longer at HEAD.

What is a bug-fixing commit?

Any commit whose purpose is to fix an issue. They are identified by message, using the same pattern as GitHub, which is:

(?i)(fix(e[sd])?|close[sd]?) #[1-9][0-9]*

What is the formula used?

\textrm{score}{\left(i\right)}=\sum_{i=0}^n\frac{1}{1+e^{\left(-12t_i+12\right)}}

where ti is the timestamp of the ith commit, normalized between 0 and 1 (0 being the date of the first commit in the repository and 1 being the date of the last commit in the repository), and n is the number of bug-fixing commits.

Installation

$ pip install bugspots

Command-line usage

$ bugspots.py -h

Python example

import bugspots
b = bugspots.Bugspots()
for hotspot in b.get_hotspots():
    print " %6.3f %s" % (hotspot.score, hotspot.filename)

bugspots's People

Contributors

d0vs avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar

bugspots's Issues

Python 3 support

Hi, I'd be willing to implement python 3 support and possibly do further work and improvements as needed. However I'll drop python2 support because that's too cumbersome for me (if nobody else adds it.)

Shall I fork or do we want to work together?

Integrate better with git

If you rename the executable to ex. git-bugspots and put it in the path, the main git-program will integrate with it.

Ex. try putting git-helloworld somewhere in your path:

#!/bin/sh
echo "Hello, Git"

And then run it though git:

> git helloworld
Hello, Git

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.