This repository contains a collection of bugs on PHP applications curated by mining Github Repositories.
bugsPHP contains 513 bugs from the following open-source projects:
Project name | Number of bugs |
---|---|
cakephp--cakephp | 33 |
briannesbitt--Carbon | 11 |
composer--composer | 18 |
doctrine--dbal | 9 |
w7corp--easywechat | 9 |
laravel--framework | 94 |
googleapis--google-api-php-client | 3 |
spatie--laravel-permission | 6 |
magento--magento2 | 23 |
Seldaek--monolog | 7 |
doctrine--orm | 15 |
PHP-CS-Fixer--PHP-CS-Fixer | 82 |
nikic--PHP-Parser | 3 |
PHPOffice--PhpSpreadsheet | 12 |
symfony--symfony | 188 |
- Download the test repositories archive file here, and put it next to the
main.py
script. Do not extract the archive; the script is designed to handle it automatically. - Install required dependencies:
sudo apt install p7zip-full php-all-dev pip install --user pydash
The command-line interface includes the following commands:
- -p: Project name
- -b: Bug number
- -t: task
- checkout: checks-out the source code
- install: install the necessary packages
- test: run all the test cases
- failing-test-only: run only failing test cases
- -v: bug version
- buggy: the original buggy code
- fixed: bug fixed code with updated test cases
- -o: output path where the source code should be checkout
- Checks-out the source code for a given bug
python3 main.py -p composer--composer -b 1 -t checkout -v fixed -o /content/tmp/
- Install the necessary packages
python3 main.py -p composer--composer -b 1 -t install -v fixed -o /content/tmp/
- Run all the test cases
python3 main.py -p composer--composer -b 1 -t test -v fixed -o /content/tmp/
- Run failing test cases
python3 main.py -p composer--composer -b 1 -t failing-test-only -v fixed -o /content/tmp/
You can find the training dataset in here, It contains 5 zip files and json file with meta info.
- unzip the zip files.
- use the following path formats to find bugs. (repo_owner, repo_name, and bug_no can find in the meta.json file)
- {repo_owner}--{repo_name}/{repo_name}/{bug_no}/buggy
- {repo_owner}--{repo_name}/{repo_name}/{bug_no}/fixed
- Ridwan Shariffdeen
- Sandareka Wickramanayake
- K.D. Pramod
- W.T.N. De Silva
- W.U.K. Thabrew
BugsPHP: A dataset for Automated Program Repair in PHP
K.D. Pramod, W.T.N. De Silva, W.U.K. Thabrew, Ridwan Salihin Shariffdeen, Sandareka Wickramanayake
21st International Conference on Mining Software Repositories, Lisbon, Portugal, 2024
This work was partially supported by a Singapore Ministry of Education (MoE) Tier3 grant “Automated Program Repair”, MOE-MOET32021-0001.
This project is licensed under the MIT License - see the LICENSE file for details
If you use BugsPHP in your research work, we would highly appreciate it if you cited the following paper:
@inproceedings{bugsphp,
author = {K.D. Pramod, W.T.N. De Silva, W.U.K. Thabrew, Ridwan Shariffdeen, Sandareka Wickramanayake},
title = {BugsPHP: A dataset for Automated Program Repair in PHP},
year = {2024},
booktitle={Proceedings of the 21st International Conference on Mining Software Repositories},
location = {Lisbon, Portugal},
series = {MSR '24},
doi={10.1145/3643991.3644884}
}