Szegedi fejlesztés: Az első manuálisan validált, reprodukálható Python hibagyűjtemény

Szegedi fejlesztés: Az első manuálisan validált, reprodukálható Python hibagyűjtemény
Forrás: Unsplash - Behnam Norouzi

A Python napjaink egyik legnépszerűbb programozási nyelve, mégis kevés olyan hibatár áll rendelkezésre, amely valós, reprodukálható hibákat tartalmaz. Ezt a hiányt pótolja a PyBugHive, amely az első manuálisan validált, reprodukálható Python hibákat tartalmazó adatbázis.

Az adatbázis első verziója 149 hibát tartalmaz 11 nyílt forráskódú projektből, biztosítva a kutatók számára a pontos elemzési lehetőséget. Az adatbázis fejlesztését a Szegedi Tudományegyetem kutatói végezték, az Európai Uniós RRF-2.3.1-21-2022-00004 projekt, valamint a Nemzeti Kutatási, Fejlesztési és Innovációs Alap támogatásával. Eredményeiket a "PyBugHive: A Comprehensive Database of Manually Validated, Reproducible Python Bugs" című tanulmányban (Gábor et al., 2024) ismertették.

A PyBugHive-ot szigorú szelekciós eljárással állították össze. A hibákat manuálisan ellenőrizték, valós fejlesztői javításokkal dokumentálták, és azokat környezeti beállításokkal tesztelve reprodukálták. Az adatbázisban megtalálhatóak a hibajegyek összegzései, a kapcsolódó patchek, valamint a tesztesetek, amelyek kimutatják a hiba jelenlétét. A PyBugHive ezenfelül kiterjeszthetőséget is biztosít, amely lehetővé teszi további hibák beillesztését. Az adatok pontosságát igazolja, hogy sem a Pylint, sem a Bandit statikus elemző eszköz nem volt képes automatikusan felismerni a hibák egyikét sem, igazolva, hogy a hibatár valóban nem-triviális eseteket tartalmaz.

Források:

PyBugHive: A Comprehensive Database of Manually Validated, Reproducible Python Bugs
Python is currently the number one language in the TIOBE index and has been the second most popular language on GitHub for years. But so far, there are only a few bug databases that contain bugs for Python projects and even fewer in which bugs can be reproduced. In this paper, we present a manually curated database of reproducible Python bugs called PyBugHive. The initial version of PyBugHive is a benchmark of 149 real, manually validated bugs from 11 Python projects. Each entry in our database contains the summary of the bug report, the corresponding patch, and the test cases that expose the given bug. PyBugHive features a rich command line interface for accessing both the buggy and fixed versions of the programs and provides the abstraction for executing the corresponding test cases. The interface facilitates highly reproducible empirical research and tool comparisons in fields such as testing, automated program repair, or bug prediction. The usage of our database is demonstrated through a use case involving a large language model, GPT-3.5. First, we evaluated the bug detection capabilities of the model with the help of the bug repository. Using multiple prompts, we found out that GPT-3.5 was able to detect 67 out of 149 bugs (45%). Furthermore, we leveraged the constructed bug dataset in assessing the automatic program repair capabilities of GPT-3.5 by comparing the generated fixes with the real patches contained in the dataset. However, its performance was far worse in this task compared to bug detection, as it was able to fix only one of the detected issues.