https://github.com/haaleo/bug-prediction
Python package to predict bugs using the complexity of code changes
https://github.com/haaleo/bug-prediction
bug bug-detection bug-prediction bugs change complexity entropy fault fault-detection fault-prediction prediciton
Last synced: 23 days ago
JSON representation
Python package to predict bugs using the complexity of code changes
- Host: GitHub
- URL: https://github.com/haaleo/bug-prediction
- Owner: HaaLeo
- License: bsd-3-clause
- Created: 2019-05-20T10:56:46.000Z (almost 7 years ago)
- Default Branch: master
- Last Pushed: 2021-06-18T21:03:59.000Z (almost 5 years ago)
- Last Synced: 2025-04-07T04:32:44.825Z (12 months ago)
- Topics: bug, bug-detection, bug-prediction, bugs, change, complexity, entropy, fault, fault-detection, fault-prediction, prediciton
- Language: Python
- Size: 395 KB
- Stars: 4
- Watchers: 1
- Forks: 1
- Open Issues: 1
-
Metadata Files:
- Readme: README.md
- Changelog: CHANGELOG.md
- License: LICENSE.txt
Awesome Lists containing this project
README
# bugprediction
[](https://github.com/HaaLeo/bug-prediction/stargazers)
[](https://travis-ci.org/HaaLeo/bug-prediction) [](https://codecov.io/gh/HaaLeo/bug-prediction) [](http://makeapullrequest.com)
[](https://www.paypal.me/LeoHanisch/3eur)
## Description
This repository enables you to calculate the history complexity metric Ahmed E. Hassan introduced at the [2009 IEEE 31st International Conference on Software Engineering](https://ieeexplore.ieee.org/document/5070510) in May 2009 (DOI: 10.1109/ICSE.2009.5070510) and use it for the prediction of the amount of bugs.
The implementation was part of the course [Software Qualität](https://campus.tum.de/tumonline/wbLv.wbShowLVDetail?pStpSpNr=950402174) at the Technical University of Munich in summer 2019.
The training data set was derived from the data set that Marco D'Ambros, Michele Lanza and Romain Robbes used in their paper [An Extensive Comparison of Bug Prediction Approaches](https://ieeexplore.ieee.org/document/5463279). The original data set is available at http://bug.inf.usi.ch/index.php.
## Installation
### From Source
```
git clone git@github.com:HaaLeo/bug-prediction.git
cd bug-prediction
pipenv install
pipenv shell
python -m bugprediction --version
```
## Usage
To print all available options:
```
python -m bugprediction --help
```
Training is currently only possible from source. To do so run the edit the `train.py` to your needs and run it.
### API
In order to use the API you need to bundle and install the package:
```
python setup.py sdist bdist_wheel
pip install dist/bugprediction-0.0.1.tar.gz
```
Then you can use tha API like shown bellow:
```python
from bugprediction import calculate_hcm, predict
history_complexity_metric, _ = calculate_hcm(**kwargs)
prediction_map = predict(hcm_map, **args)
```
## Contribution
If you found a bug or are missing a feature do not hesitate to [file an issue](https://github.com/HaaLeo/bug-prediction/issues/new/choose).
Pull Requests are welcome!
## Support
When you like this package make sure to [star the repository](https://github.com/HaaLeo/bug-prediction/stargazers). I am always looking for new ideas and feedback.
In addition, it is possible to [donate via paypal](https://www.paypal.me/LeoHanisch/3eur).