Efficient Counter-factual Type Error Debugging

Sheng Chen, Baijun Wu
{"title":"Efficient Counter-factual Type Error Debugging","authors":"Sheng Chen, Baijun Wu","doi":"10.1109/TASE.2019.00-13","DOIUrl":null,"url":null,"abstract":"Type inference is an important part of functional programming languages and has been increasingly adopted to imperative programming. However, providing effective error messages in response to type inference failures (due to type errors in programs) continues to be a challenge. Type error messages generated by compilers and existing error debugging approaches often point to bogus error locations or lack sufficient information for removing the type error, making error debugging ineffective. Counter-factual typing (CFT) addressed this problem by generating comprehensive error messages with each message includes a rich set of information. However, CFT has a large response time, making it too slow for interactive use. In particular, our recent study shows that programmers usually have to go through multiple iterations of updating and recompiling programs to remove a type error. Interestingly, our study also reveals that program updates are minor in each iteration during type error debugging. We exploit this fact and develop eCFT, an efficient version of CFT, which doesn't recompute all error fixes from scratch for each updated program but only recomputes error fixes that are changed in response to the update. Our key observation is that minor program changes lead to minor error suggestion changes. eCFT is based on principal typing, a typing scheme more amenable to reuse previous typing results. We have evaluated our approach and found it is about 12.4× faster than CFT in updating error fixes.","PeriodicalId":183749,"journal":{"name":"2019 International Symposium on Theoretical Aspects of Software Engineering (TASE)","volume":"20 1","pages":"0"},"PeriodicalIF":0.0000,"publicationDate":"2019-07-01","publicationTypes":"Journal Article","fieldsOfStudy":null,"isOpenAccess":false,"openAccessPdf":"","citationCount":"1","resultStr":null,"platform":"Semanticscholar","paperid":null,"PeriodicalName":"2019 International Symposium on Theoretical Aspects of Software Engineering (TASE)","FirstCategoryId":"1085","ListUrlMain":"https://doi.org/10.1109/TASE.2019.00-13","RegionNum":0,"RegionCategory":null,"ArticlePicture":[],"TitleCN":null,"AbstractTextCN":null,"PMCID":null,"EPubDate":"","PubModel":"","JCR":"","JCRName":"","Score":null,"Total":0}
引用次数: 1

Abstract

Type inference is an important part of functional programming languages and has been increasingly adopted to imperative programming. However, providing effective error messages in response to type inference failures (due to type errors in programs) continues to be a challenge. Type error messages generated by compilers and existing error debugging approaches often point to bogus error locations or lack sufficient information for removing the type error, making error debugging ineffective. Counter-factual typing (CFT) addressed this problem by generating comprehensive error messages with each message includes a rich set of information. However, CFT has a large response time, making it too slow for interactive use. In particular, our recent study shows that programmers usually have to go through multiple iterations of updating and recompiling programs to remove a type error. Interestingly, our study also reveals that program updates are minor in each iteration during type error debugging. We exploit this fact and develop eCFT, an efficient version of CFT, which doesn't recompute all error fixes from scratch for each updated program but only recomputes error fixes that are changed in response to the update. Our key observation is that minor program changes lead to minor error suggestion changes. eCFT is based on principal typing, a typing scheme more amenable to reuse previous typing results. We have evaluated our approach and found it is about 12.4× faster than CFT in updating error fixes.
查看原文
分享 分享
微信好友 朋友圈 QQ好友 复制链接
本刊更多论文
有效的反事实类型错误调试
类型推断是函数式编程语言的重要组成部分,在命令式编程中得到越来越多的应用。然而,在响应类型推断失败(由于程序中的类型错误)时提供有效的错误消息仍然是一个挑战。编译器和现有错误调试方法生成的类型错误消息通常指向虚假的错误位置,或者缺乏足够的信息来消除类型错误,从而使错误调试无效。反事实类型(CFT)通过生成全面的错误消息来解决这个问题,每个消息都包含一组丰富的信息。然而,CFT有很大的响应时间,使得它对于交互式使用来说太慢了。特别是,我们最近的研究表明,程序员通常必须经历多次更新和重新编译程序的迭代,以消除类型错误。有趣的是,我们的研究还表明,在类型错误调试期间,程序更新在每次迭代中都是次要的。我们利用这一事实并开发了eCFT,这是CFT的一个有效版本,它不会为每个更新的程序从头开始重新计算所有错误修复,而只会重新计算响应更新而更改的错误修复。我们的主要观察是,较小的程序更改会导致较小的错误建议更改。eCFT基于主体类型,这是一种更易于重用以前的类型结果的类型方案。我们已经评估了我们的方法,发现它在更新错误修复方面比CFT快12.4倍。
本文章由计算机程序翻译,如有差异,请以英文原文为准。
求助全文
约1分钟内获得全文 去求助
来源期刊
自引率
0.00%
发文量
0
期刊最新文献
IMSpec: An Extensible Approach to Exploring the Incorrect Usage of APIs A Quantitative Safety Verification Approach for the Decision-making Process of Autonomous Driving Distributed Mediator Hardware Tripartite Synapse Architecture based on Stochastic Computing A Denotational Semantics for Dynamic Architectures
×
引用
GB/T 7714-2015
复制
MLA
复制
APA
复制
导出至
BibTeX EndNote RefMan NoteFirst NoteExpress
×
×
提示
您的信息不完整,为了账户安全,请先补充。
现在去补充
×
提示
您因"违规操作"
具体请查看互助需知
我知道了
×
提示
现在去查看 取消
×
提示
确定
0
微信
客服QQ
Book学术公众号 扫码关注我们
反馈
×
意见反馈
请填写您的意见或建议
请填写您的手机或邮箱
已复制链接
已复制链接
快去分享给好友吧!
我知道了
×
扫码分享
扫码分享
Book学术官方微信
Book学术文献互助
Book学术文献互助群
群 号:481959085
Book学术
文献互助 智能选刊 最新文献 互助须知 联系我们:info@booksci.cn
Book学术提供免费学术资源搜索服务,方便国内外学者检索中英文文献。致力于提供最便捷和优质的服务体验。
Copyright © 2023 Book学术 All rights reserved.
ghs 京公网安备 11010802042870号 京ICP备2023020795号-1