[Paper Review] Characterizing Bugs in Python and R Data Analytics Programs
This study characterizes bugs in Python and R data analytics programs using 5,068 Stack Overflow posts and 1,800 GitHub bug-fix commits across major data analytics libraries. It reveals that Logic Bugs are most frequent, with Python facing more data preprocessing and parameter misconfiguration bugs, while R has more data flow and package change-related issues, despite strong cross-language correlations in bug patterns across comparable packages.
R and Python are among the most popular languages used in many critical data analytics tasks. However, we still do not fully understand the capabilities of these two languages w.r.t. bugs encountered in data analytics tasks. What type of bugs are common? What are the main root causes? What is the relation between bugs and root causes? How to mitigate these bugs? We present a comprehensive study of 5,068 Stack Overflow posts, 1,800 bug fix commits from GitHub repositories, and several GitHub issues of the most used libraries to understand bugs in R and Python. Our key findings include: while both R and Python have bugs due to inexperience with data analysis, Python see significantly larger data preprocessing bugs compared to R. Developers experience significantly more data flow bugs in R because intermediate results are often implicit. We also found changes and bugs in packages and libraries cause more bugs in R compared to Python while package or library misselection and conflicts cause more bugs in Python than R. While R has a slightly higher readability barrier for data analysts, the statistical power of R leads to a less number of bad performance bugs. In terms of data visualization, R packages have significantly more bugs than Python libraries. We also identified a strong correlation between comparable packages in R and Python despite their linguistic and methodological differences. Lastly, we contribute a large dataset of manually verified R and Python bugs.
Motivation & Objective
- To understand the frequency, types, and root causes of bugs in data analytics programs written in R and Python.
- To investigate the relationship between bug types, root causes, and their persistent effects on program execution.
- To identify commonalities and differences in bug patterns across comparable R and Python data analytics packages.
- To provide a large, manually verified dataset of R and Python bugs for future research in automated debugging and repair.
- To inform best practices in data analytics education, tooling, and library design based on empirical findings.
Proposed method
- Collected and analyzed 5,068 Stack Overflow posts and 1,800 GitHub bug-fix commits from top R and Python data analytics libraries.
- Selected the eleven most tagged R packages (e.g., ggplot2, dplyr, tidyr) and seven most tagged Python packages (e.g., Pandas, Scikit-learn, Matplotlib) for analysis.
- Manually categorized bugs into types (e.g., Logic, Data, Data Flow), root causes (e.g., Confusion with Data Analysis, Incorrect Parameters), and effects (e.g., performance, incorrect output).
- Used a curated dataset of GitHub commits and Stack Overflow posts to identify patterns in bug frequency, root causes, and fix complexity.
- Applied a modified bug taxonomy to classify bugs and their impacts, ensuring consistency across R and Python ecosystems.
- Conducted comparative analysis between R and Python to identify language-specific trends and cross-language correlations in bug patterns.
Experimental results
Research questions
- RQ1RQ1: What classes of bugs are most frequent in data analytics programs in R and Python?
- RQ2RQ2: What are the common root causes of bugs in data analytics programs?
- RQ3RQ3: What is the relationship among bug types, root causes, and their effects in data analytics tasks?
- RQ4RQ4: What are the persistent effects of bugs in data analytics programs?
- RQ5RQ5: Do different data analytics libraries exhibit commonalities in terms of bug types?
Key findings
- Logic Bugs (LB) are the most frequent bug type in both R and Python, with 559 and 1,210 instances respectively across the studied datasets.
- Data Bugs (DB) are significantly more common in Python (1,210 instances) than in R (559 instances), primarily due to data preprocessing errors.
- Data Flow Bugs (DFB) are more prevalent in R (544 instances) than in Python (1,132 instances), largely due to implicit intermediate results in data pipelines.
- Confusion with Data Analysis (CDA) is the top root cause of bugs in both languages, followed by Incorrect Data Analysis Parameters (IDAP).
- Package/library changes (APIC) cause more bugs in R than in Python, while package mis-selection and conflicts (PLMC) are more frequent in Python.
- Despite linguistic and methodological differences, there is a strong correlation between comparable R and Python packages in terms of bug types and root causes.
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.