Dynamically typed programming languages are popular in education and the software industry. While presenting a low barrier to entry, they suffer from run-time type errors and longer-term problems in code quality and maintainability. Statically typed languages, while showing strength in these aspects, lack in learnability and ease of use. In particular, fixing type errors poses challenges to both novice users and experts. Further, compiler-type error messages are presented in a static way that is biased toward the first occurrence of the error in the program code. To help users resolve such type errors, we introduce ChameleonIDE, a type debugging tool that presents type errors to the user in an unbiased way, allowing them to explore the full context of where the errors could occur. Programmers can interactively verify the steps of reasoning against their intention. Through three studies involving real programmers, we showed that ChameleonIDE is more effective in fixing type errors than traditional text-based error messages. This difference is more significant in harder tasks. Further, programmers actively using ChameleonIDE's interactive features are shown to be more efficient in fixing type errors than passively reading the type error output.
翻译:动态类型编程语言在教育和软件行业中广受欢迎。虽然入门门槛较低,但它们存在运行时类型错误以及代码质量和可维护性方面的长期问题。静态类型语言尽管在这些方面具有优势,但在易学性和易用性上有所欠缺。特别是,修复类型错误对新手用户和专家都构成了挑战。此外,编译器类型错误消息以静态方式呈现,且偏向于程序代码中首次出现的错误位置。为了帮助用户解决此类类型错误,我们引入了ChameleonIDE,这是一种类型调试工具,以无偏方式向用户呈现类型错误,允许他们探索错误可能发生的完整上下文。程序员可以交互式地验证推理步骤是否符合预期意图。通过三项涉及真实程序员的研究,我们证明ChameleonIDE在修复类型错误方面比传统的基于文本的错误消息更有效。这种差异在更困难的任务中更为显著。此外,与被动阅读类型错误输出相比,主动使用ChameleonIDE交互式功能的程序员在修复类型错误方面效率更高。