FauxPy: A Fault Localization Tool for Python
Mohammad Rezaalipour, Carlo A. Furia
TL;DR
FauxPy tackles the lack of Python-focused fault localization tools by offering seven techniques across four families (SBFL, MBFL, ST, PS) as a Pytest plugin that supports Pytest, Unittest, and Hypothesis. It demonstrates usage on simple examples and reports location rankings via CSV, highlighting the speed of SBFL and the heavier cost of MBFL, with ST fast but limited to crashes and PS limited to conditional predicates. In a large-scale evaluation on 135 BugsInPy bugs across 13 projects, SBFL and MBFL were most effective within the top-5 rankings, validating FauxPy's practical utility for Python code bases. The tool stores intermediate results in SQLite to enable debugging and further analysis and is openly available via PyPI and public repositories, enabling widespread adoption and future research.
Abstract
This paper presents FauxPy, a fault localization tool for Python programs. FauxPy supports seven well-known fault localization techniques in four families: spectrum-based, mutation-based, predicate switching, and stack trace fault localization. It is implemented as plugin of the popular Pytest testing framework, but also works with tests written for Unittest and Hypothesis (two other popular testing frameworks). The paper showcases how to use FauxPy on two illustrative examples, and then discusses its main features and capabilities from a user's perspective. To demonstrate that FauxPy is applicable to analyze Python projects of realistic size, the paper also summarizes the results of an extensive experimental evaluation that applied FauxPy to 135 real-world bugs from the BugsInPy curated collection. To our knowledge, FauxPy is the first open-source fault localization tool for Python that supports multiple fault localization families.
