A Parsing Technique for Enhancing Compiler Syntax Error Messages for Student Programmers

Contribution: This full research paper presents an innovative parsing technique that aims to improve syntax error messages for undergraduate students. The quality of syntax error messages generated by the new parsing technique was evaluated and compared with the messages produced by mainstream compilers. Background: Unfortunately, compiler error messages are often unhelpful. The study explains some intrinsic challenges faced in generating good syntax error messages and presents a global, local, and expression-level (GLE) parsing technique to overcome some of these challenges. GLE is a 3-phase parsing that prioritizes the parsing of the large code components over diving into all the details. The first phase parses the functional structures and ignores errors in the syntax of the smaller constructions. The second phase parses the control structures and ignores errors in the expressions and other statements. The third phase parses the expressions and statements excluded from phase two. Research Question: Can GLE parsing techniques help generate better syntax error messages? Methodology: The study evaluated the quality of syntax error messages generated by the proposed GLE parsing technique. The evaluation was done in a controlled experiment and within-group design where participants found and fixed errors in erroneous programs using accompanying error messages from different compilers. The independent variable is the compiler type. The dependent variable is the quality of syntax error messages. The quality of syntax error messages is measured by three factors: the success rate of finding errors in erroneous programs, the success rate of fixing syntax errors in erroneous programs, and mean-time-to-find and -fix erroneous programs. Three questions were used to evaluate the “helping in finding errors” quality of the error message: 1) what is the error in the program? 2) in which line is the error? 3) what is the cause of the error? One question was used to evaluate the quality of “helping in fixing errors”: “how to fix the error?” The time that participants used to find and fix a program was calculated. The participants were 51 undergraduate students in the Computer Science and Engineering department at the New Mexico Institute of Mining and Technology. Findings: The results show there is a significant statistical difference in finding errors and fixing erroneous programs using messages generated by the proposed GLE parsing technique and two mainstream compilers: GNU GCC and Microsoft Visual C++. No significant difference exists in the time-to-find and -fix. The result indicates that the proposed GLE parsing technique can help generate better error messages for undergraduate students.

Authors

Institutions

Publication Details

Published
2024-10-13
DOI
https://doi.org/10.1109/fie61694.2024.10893401
Primary Topic
Software Testing and Debugging Techniques
Type
article
Field-Weighted Citation Impact
0.00
Controls
|||
ALL TIME
JAN
FEB
MAR
APR
MAY
JUN
JUL
AUG
SEP
OCT
article

A Parsing Technique for Enhancing Compiler Syntax Error Messages for Student Programmers

Tonia A. Dousay, Sana Algaraibeh, Clinton Jeffery, Terence Soule
Software Testing and Debugging Techniques
article

A Parsing Technique for Enhancing Compiler Syntax Error Messages for Student Programmers

Tonia A. Dousay, Sana Algaraibeh, Clinton Jeffery, Terence Soule
article en

Abstract

Contribution: This full research paper presents an innovative parsing technique that aims to improve syntax error messages for undergraduate students. The quality of syntax error messages generated by the new parsing technique was evaluated and compared with the messages produced by mainstream compilers. Background: Unfortunately, compiler error messages are often unhelpful. The study explains some intrinsic challenges faced in generating good syntax error messages and presents a global, local, and expression-level (GLE) parsing technique to overcome some of these challenges. GLE is a 3-phase parsing that prioritizes the parsing of the large code components over diving into all the details. The first phase parses the functional structures and ignores errors in the syntax of the smaller constructions. The second phase parses the control structures and ignores errors in the expressions and other statements. The third phase parses the expressions and statements excluded from phase two. Research Question: Can GLE parsing techniques help generate better syntax error messages? Methodology: The study evaluated the quality of syntax error messages generated by the proposed GLE parsing technique. The evaluation was done in a controlled experiment and within-group design where participants found and fixed errors in erroneous programs using accompanying error messages from different compilers. The independent variable is the compiler type. The dependent variable is the quality of syntax error messages. The quality of syntax error messages is measured by three factors: the success rate of finding errors in erroneous programs, the success rate of fixing syntax errors in erroneous programs, and mean-time-to-find and -fix erroneous programs. Three questions were used to evaluate the “helping in finding errors” quality of the error message: 1) what is the error in the program? 2) in which line is the error? 3) what is the cause of the error? One question was used to evaluate the quality of “helping in fixing errors”: “how to fix the error?” The time that participants used to find and fix a program was calculated. The participants were 51 undergraduate students in the Computer Science and Engineering department at the New Mexico Institute of Mining and Technology. Findings: The results show there is a significant statistical difference in finding errors and fixing erroneous programs using messages generated by the proposed GLE parsing technique and two mainstream compilers: GNU GCC and Microsoft Visual C++. No significant difference exists in the time-to-find and -fix. The result indicates that the proposed GLE parsing technique can help generate better error messages for undergraduate students.

University of Alaska Anchorage (US), University of Idaho (US), New Mexico Institute of Mining and Technology (US)
Quality Education
Openalex Percentile: Top 72%
Software Testing and Debugging Techniques
AI Navigator

Ask Laika to Summarize, Analyze, and Connect papers live on the map.

Summarize Papers & Methodologies

Extract key findings, datasets, and comparative methods across publications.

Benchmark Rankings & Visual Analytics

Rank top research institutions, authors, funders, topics, and journals by Field-Weighted Citation Impact (FWCI) and paper volume with instant charts.

Connect Distant Disciplines

Bridge topological clusters on the map to find hidden collaborative intersections.