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

被引:6
作者
Wong, Alexander William [1 ]
Salimi, Amir [1 ]
Chowdhury, Shaiful [1 ]
Hindle, Abram [1 ]
机构
[1] Univ Alberta, Dept Comp Sci, Edmonton, AB, Canada
来源
2019 IEEE INTERNATIONAL CONFERENCE ON SOFTWARE MAINTENANCE AND EVOLUTION (ICSME 2019) | 2019年
关键词
stack overflow; natural; syntax errors; !text type='python']python[!/text; mining software repositories;
D O I
10.1109/ICSME.2019.00048
中图分类号
TP31 [计算机软件];
学科分类号
081202 ; 0835 ;
摘要
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.
引用
收藏
页码:318 / 322
页数:5
相关论文
共 14 条
[11]  
Pritchard D., 2015, P 6 WORKSHOP EVALUAT, P1
[12]   On the "Naturalness" of Buggy Code [J].
Ray, Baishakhi ;
Hellendoorn, Vincent ;
Godhane, Saheel ;
Tu, Zhaopeng ;
Bacchelli, Alberto ;
Devanbu, Premkumar .
2016 IEEE/ACM 38TH INTERNATIONAL CONFERENCE ON SOFTWARE ENGINEERING (ICSE), 2016, :428-439
[13]  
Santos EA, 2018, 2018 25TH IEEE INTERNATIONAL CONFERENCE ON SOFTWARE ANALYSIS, EVOLUTION AND REENGINEERING (SANER 2018), P311, DOI 10.1109/SANER.2018.8330219
[14]  
Tabanao Emily S., 2011, P 7 INT WORKSH COMP, P85, DOI [10.1145/2016911.2016930, DOI 10.1145/2016911.2016930]