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

动态程序切片如何改变开发者诊断渐进运行时类型错误的方式

Dynamic Program Slices Change How Developers Diagnose Gradual Run-Time Type Errors

Felipe Bañados Schwerter, Ronald Garcia, Reid Holmes, Karim Ali

AI总结:

针对渐进类型系统运行时类型错误调试困难及责备报告误导的问题,提出基于动态程序切片的TypeSlicer工具,并通过Wizard-of-Oz用户研究验证其能帮助开发者提供有效的更改建议。

摘要:

渐进类型系统允许开发者声明某些类型由编译器强制执行(即静态类型),而将其他类型留待运行时检查强制执行(即动态类型)。当运行时检查失败时,调试渐进类型程序变得繁琐,因为这些失败可能发生在做出不一致类型假设的原始位置很远的地方。为了减轻开发者的这一负担,一些渐进类型语言会针对给定的类型不一致生成一份责备报告。然而,这些报告有时会误导,因为它们可能指向无需修改即可停止错误的程序点。为了克服责备报告的局限性,我们提出使用动态程序切片作为替代方法,帮助程序员调试运行时类型错误。我们描述了TypeSlicer的概念验证,该工具会在运行时检查失败时向开发者展示动态程序切片。我们进行了一项Wizard-of-Oz用户研究,通过一系列与TypeScript程序的模拟交互来调查开发者对动态程序切片的反应。这项形成性研究表明,开发者能够理解并应用动态切片信息,在调试运行时类型错误时提供更改建议。

英文摘要:

A gradual type system allows developers to declare certain types to be enforced by the compiler (i.e., statically typed), while leaving other types to be enforced via runtime checks (i.e., dynamically typed). When runtime checks fail, debugging gradually typed programs becomes cumbersome, because these failures may arise far from the original point where an inconsistent type assumption is made. To ease this burden on developers, some gradually typed languages produce a blame report for a given type inconsistency. However, these reports are sometimes misleading, because they might point to program points that do not need to be changed to stop the error. To overcome the limitations of blame reports, we propose using dynamic program slicing as an alternative approach to help programmers debug run-time type errors. We describe a proof-of-concept for TypeSlicer, a tool that would present dynamic program slices to developers when a runtime check fails. We performed a Wizard-of-Oz user study to investigate how developers respond to dynamic program slices through a set of simulated interactions with TypeScript programs. This formative study shows that developers can understand and apply dynamic slice information to provide change recommendations when debugging runtime type errors.

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

↑