Skip to main content
QUICK REVIEW

[論文レビュー] Characterizing Bugs in Python and R Data Analytics Programs

Shibbir Ahmed, Mohammad Wardat|arXiv (Cornell University)|Jun 14, 2023
Software Engineering ResearchComputer Science被引用数 3
ひとこと要約

本研究は、主要なデータ分析ライブラリにおける5,068件のStack Overflow投稿および1,800件のGitHubバグ修正コミットを用いて、PythonおよびRのデータ分析プログラムにおけるバグを特徴づけた。その結果、論理バグ(Logic Bugs)が最も頻発しており、Pythonではデータ前処理およびパrameter設定ミスのバグが多く、Rではデータフローおよびパッケージ変更関連のバグが多いことが判明した。ただし、同等のパッケージ間においては、言語間で強い相関関係が見られた。

ABSTRACT

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.

研究の動機と目的

  • RおよびPythonで書かれたデータ分析プログラムにおけるバグの頻度、種別、根本原因を理解すること。
  • バグの種別、根本原因、およびそれらがプログラム実行に及える持続的影響との関係を調査すること。
  • 同等のRおよびPythonのデータ分析パッケージ間におけるバグパターンの共通性と相違点を特定すること。
  • 今後の自動デバッグおよび修復研究のための、大規模かつ手作業で検証済みのRおよびPythonバグデータセットを提供すること。
  • 実証的発見に基づき、データ分析教育、ツール開発、ライブラリ設計の最良実践を支援すること。

提案手法

  • 主要なRおよびPythonのデータ分析ライブラリから、5,068件のStack Overflow投稿および1,800件のGitHubバグ修正コミットを収集・分析した。
  • 分析対象として、ggplot2、dplyr、tidyrなど、11のタグ数が最も多いRパッケージと、Pandas、Scikit-learn、Matplotlibなど、7つのタグ数が最も多いPythonパッケージを選定した。
  • バグを種別(例:論理バグ、データバグ、データフローバグ)、根本原因(例:データ分析の誤解、不適切なパrameter設定)、影響(例:パフォーマンス低下、誤った出力)に手作業で分類した。
  • GitHubコミットおよびStack Overflow投稿のキュレート済みデータセットを用いて、バグ頻度、根本原因、修正の複雑さのパターンを同定した。
  • 一貫性を確保するため、RおよびPythonのエコシステム全体にわたって適用可能な修正版バグ分類法を採用した。
  • RとPythonの比較分析を実施し、言語固有の傾向およびバグパターンにおける言語間相関関係を同定した。

実験結果

リサーチクエスチョン

  • RQ1RQ1: RおよびPythonのデータ分析プログラムにおいて、最も頻発するバグの種別は何か?
  • RQ2RQ2: データ分析プログラムにおけるバグの一般的な根本原因は何か?
  • RQ3RQ3: データ分析タスクにおけるバグの種別、根本原因、およびそれらの影響との関係は何か?
  • RQ4RQ4: データ分析プログラムにおけるバグの持続的影響は何か?
  • RQ5RQ5: 異なるデータ分析ライブラリは、バグの種別において共通性を示すか?

主な発見

  • 論理バグ(LB)は、両言語で最も頻発するバグ種別であり、調査対象データセット全体でそれぞれ559件(R)および1,210件(Python)の事例が確認された。
  • データバグ(DB)は、Python(1,210件)においてR(559件)よりも顕著に多く発生しており、主にデータ前処理エラーに起因する。
  • データフローバグ(DFB)は、R(544件)においてPython(1,132件)よりも顕著に多く発生しており、主にデータパイプラインにおける暗黙の途中結果に起因する。
  • データ分析の誤解(CDA)は、両言語でバグの主な根本原因であり、次いで不適切なデータ分析パrameter設定(IDAP)が続く。
  • パッケージ/ライブラリの変更(APIC)は、RにおいてPythonよりも多くのバグを引き起こしている一方、パッケージの誤選択および競合(PLMC)は、Pythonにおいてより頻発している。
  • 言語的および手法的差異が存在するが、同等のRおよびPythonパッケージ間において、バグ種別および根本原因の面で強い相関関係が確認された。

この論文を読む

Nubintのビューアで原文を開き、読みながら気になる箇所をすぐに質問できます。

Nubintでこの論文を読む

このレビューはAIが論文の原文をもとに作成しました。引用する前に原文をご確認ください。