[Paper Review] How Often Do Single-Statement Bugs Occur? The ManySStuBs4J Dataset
This paper introduces the ManySStuBs4J dataset, comprising 153,652 single-statement bug-fix changes from 1,000 popular open-source Java projects, annotated for 16 common bug templates. It finds that 33.47% of these single-statement bugs match known templates, indicating that a significant portion of simple bugs can be repaired with a small set of predefined patterns, with an estimated frequency of one such bug per 1,600–2,500 lines of code.
Program repair is an important but difficult software engineering problem. One way to achieve acceptable performance is to focus on classes of simple bugs, such as bugs with single statement fixes, or that match a small set of bug templates. However, it is very difficult to estimate the recall of repair techniques for simple bugs, as there are no datasets about how often the associated bugs occur in code. To fill this gap, we provide a dataset of 153,652 single statement bug-fix changes mined from 1,000 popular open-source Java projects, annotated by whether they match any of a set of 16 bug templates, inspired by state-of-the-art program repair techniques. In an initial analysis, we find that about 33% of the simple bug fixes match the templates, indicating that a remarkable number of single-statement bugs can be repaired with a relatively small set of templates. Further, we find that template fitting bugs appear with a frequency of about one bug per 1,600-2,500 lines of code (as measured by the size of the project's latest version). We hope that the dataset will prove a resource for both future work in program repair and studies in empirical software engineering.
Motivation & Objective
- To address the lack of real-world data on the frequency and prevalence of single-statement bugs in production code.
- To enable accurate evaluation of program repair techniques by providing a large-scale, annotated dataset of real-world simple bugs.
- To estimate the recall of template-based repair methods by measuring how often such bugs occur in practice.
- To support future research in automated debugging, fault localization, and machine learning for code repair.
Proposed method
- Mining 1,000 popular open-source Java Maven projects using version control history to extract single-statement bug-fix changes.
- Annotating each fix with one or more of 16 predefined bug templates inspired by state-of-the-art program repair techniques.
- Focusing on bugs that compile both before and after repair, labeled as 'simple stupid bugs' (SStuBs) due to their trivial nature.
- Creating two dataset versions: a smaller one (25,539 changes) restricted to Maven-buildable projects with test suites, and a larger one (153,652 changes) covering all 1,000 projects.
- Using project size (latest version) to estimate the frequency of SStuBs per lines of code.
- Releasing the dataset via Zenodo and a public GitHub repository for reproducibility and reuse.
Experimental results
Research questions
- RQ1How frequently do single-statement bugs occur in real-world open-source Java projects?
- RQ2What percentage of single-statement bug fixes match a predefined set of common repair templates?
- RQ3How does the frequency of SStuB occurrences scale with project size, measured in lines of code?
- RQ4To what extent can template-based repair techniques achieve recall on real-world data?
- RQ5How useful is the dataset for evaluating machine learning-based fault localization and repair methods?
Key findings
- Approximately 33.47% of the 153,652 single-statement bug fixes in the large dataset match at least one of the 16 predefined repair templates.
- The smaller dataset version showed a similar match rate of 33.04%, indicating consistent template coverage across project types.
- SStuBs occur at a frequency of about one per 1,600 lines of code in the smaller dataset and one per 2,500 lines in the larger dataset.
- The dataset contains 63,923 SStuB instances in the large version and 10,231 in the smaller version, providing substantial data for evaluation.
- The dataset is publicly available via Zenodo and GitHub, supporting reproducible research in program repair and empirical software engineering.
- The availability of test suites in a subset of projects enables evaluation of test-based repair and fault localization techniques.
Read this paper
Open the full text in the Nubint reader and ask about any passage as you read.
Read this paper on NubintThis review was generated by AI from the original paper. Please check the paper before citing it.