Learning user friendly type-error messages

Author:

Wu Baijun1,Campora III John Peter1,Chen Sheng1

Affiliation:

1. University of Louisiana at Lafayette, USA

Abstract

Type inference is convenient by allowing programmers to elide type annotations, but this comes at the cost of often generating very confusing and opaque type error messages that are of little help to fix type errors. Though there have been many successful attempts at making type error messages better in the past thirty years, many classes of errors are still difficult to fix. In particular, current approaches still generate imprecise and uninformative error messages for type errors arising from errors in grouping constructs like parentheses and brackets. Worse, a recent study shows that these errors usually take more than 10 steps to fix and occur quite frequently (around 45% to 60% of all type errors) in programs written by students learning functional programming. We call this class of errors, nonstructural errors . We solve this problem by developing Learnskell, a type error debugger that uses machine learning to help diagnose and deliver high quality error messages, for programs that contain nonstructural errors. While previous approaches usually report type errors on typing constraints or on the type level, Learnskell generates suggestions on the expression level. We have performed an evaluation on more than 1,500 type errors, and the result shows that Learnskell is quite precise. It can correctly capture 86% of all nonstructural errors and locate the error cause with a precision of 63%/87% with the first 1/3 messages, respectively. This is several times more than the precision of state-of-the-art compilers and debuggers. We have also studied the performance of Learnskell and found out that it scales to large programs.

Publisher

Association for Computing Machinery (ACM)

Subject

Safety, Risk, Reliability and Quality,Software

Reference56 articles.

1. Mining source code repositories at massive scale using language modeling

2. Fig. 12. A comparison of oversampling techniques. We use the short names SMO and SMO-CV for SMOTE Fig. 12. A comparison of oversampling techniques. We use the short names SMO and SMO-CV for SMOTE

3. Matej Balog Alexander L. Gaunt Marc Brockschmidt Sebastian Nowozin and Daniel Tarlow. 2016. DeepCoder: Learning to Write Programs. CoRR abs/1611.01989 (2016). http://arxiv.org/abs/1611.01989 Matej Balog Alexander L. Gaunt Marc Brockschmidt Sebastian Nowozin and Daniel Tarlow. 2016. DeepCoder: Learning to Write Programs. CoRR abs/1611.01989 (2016). http://arxiv.org/abs/1611.01989

4. Pavol Bielik Veselin Raychev and Martin T. Vechev. 2016b. Learning a Static Analyzer from Data. CoRR abs/1611.01752 (2016). http://arxiv.org/abs/1611.01752 Pavol Bielik Veselin Raychev and Martin T. Vechev. 2016b. Learning a Static Analyzer from Data. CoRR abs/1611.01752 (2016). http://arxiv.org/abs/1611.01752

Cited by 7 articles. 订阅此论文施引文献 订阅此论文施引文献,注册后可以免费订阅5篇论文的施引文献,订阅后可以查看论文全部施引文献

1. Using Compiler Errors Messages to Feedback High School Students Through Machine Learning Methods;Advances in Computational Intelligence;2023-11-09

2. Efficient counter-factual type error debugging;Science of Computer Programming;2020-12

3. The history of Standard ML;Proceedings of the ACM on Programming Languages;2020-06-12

4. Compiler Error Messages Considered Unhelpful;Proceedings of the Working Group Reports on Innovation and Technology in Computer Science Education;2019-12-18

5. Automatic diagnosis and correction of logical errors for functional programming assignments;Proceedings of the ACM on Programming Languages;2018-10-24

同舟云学术

1.学者识别学者识别

2.学术分析学术分析

3.人才评估人才评估

"同舟云学术"是以全球学者为主线,采集、加工和组织学术论文而形成的新型学术文献查询和分析系统,可以对全球学者进行文献检索和人才价值评估。用户可以通过关注某些学科领域的顶尖人物而持续追踪该领域的学科进展和研究前沿。经过近期的数据扩容,当前同舟云学术共收录了国内外主流学术期刊6万余种,收集的期刊论文及会议论文总量共计约1.5亿篇,并以每天添加12000余篇中外论文的速度递增。我们也可以为用户提供个性化、定制化的学者数据。欢迎来电咨询!咨询电话:010-8811{复制后删除}0370

www.globalauthorid.com

TOP

Copyright © 2019-2024 北京同舟云网络信息技术有限公司
京公网安备11010802033243号  京ICP备18003416号-3