arXivDaily arXiv每日学术速递 周一至周五更新
arXiv 1907.07803cs.SE
收藏

堆栈溢出:一种提取语法错误和修复语料库的方法

Syntax and Stack Overflow: A methodology for extracting a corpus of syntax errors and fixes

Alexander William Wong, Amir Salimi, Shaiful Chowdhury, Abram Hindle

摘要:

在研究如何发现和修复语法错误时,一个问题是如何获得自然的和有代表性的语法错误示例。大多数语法错误数据集都不是免费的,开放的和公共的,或者它们是从新手程序员那里提取的,并不代表一般开发人员会犯的语法错误。所有技能水平的程序员都会在Stack Overflow上发布问题和答案,其中可能包含源代码片段以及相应的文本和标签。许多代码片段不进行解析,因此它们很适合形成语法错误和更正的语料库。我们的主要贡献是一种方法,用于提取自然的语法错误和相应的人工修复,以帮助语法错误的研究。Python抽象语法树解析器用于确定从SOTorrent数据集提取的代码块的初步错误和更正。我们通过在Python解释器中执行更正来进一步分析我们的代码。我们应用我们的方法生成了一个包含62,965个Python Stack Overflow代码片段的公共数据集,其中包含相应的标记、错误和堆栈跟踪。我们发现,Stack Overflow用户所犯的错误与学生开发人员或随机突变所犯的错误不匹配,这意味着该领域存在严重的代表性风险。最后,我们公开分享我们的数据集,以便未来的研究人员可以重用和扩展我们的语法错误和修复。

英文摘要:

One problem when studying how to find and fix syntax errors is how to get natural and representative examples of syntax errors. Most syntax error datasets are not free, open, and public, or they are extracted from novice programmers and do not represent syntax errors that the general population of developers would make. Programmers of all skill levels post questions and answers to Stack Overflow which may contain snippets of source code along with corresponding text and tags. Many snippets do not parse, thus they are ripe for forming a corpus of syntax errors and corrections. Our primary contribution is an approach for extracting natural syntax errors and their corresponding human made fixes to help syntax error research. A Python abstract syntax tree parser is used to determine preliminary errors and corrections on code blocks extracted from the SOTorrent data set. We further analyzed our code by executing the corrections in a Python interpreter. We applied our methodology to produce a public data set of 62,965 Python Stack Overflow code snippets with corresponding tags, errors, and stack traces. We found that errors made by Stack Overflow users do not match errors made by student developers or random mutations, implying there is a serious representativeness risk within the field. Finally we share our dataset openly so that future researchers can re-use and extend our syntax errors and fixes.

机构、总结、中文摘要均由AI分析而来,可能存在错误,请以论文正文为准。

↑