Statically-annotated types have been shown to aid developers in a number of programming tasks, and this benefit holds true even when static type checking is not used. It is hypothesized that this is because developers use type annotations as in-code documentation. In this study, we aim to provide evidence that developers use type annotations as in-code documentation. Understanding this hypothesized use will help to understand how, and in what contexts, developers use type information; additionally, it may help to design better development tools and inform educational decisions. To provide this evidence, we conduct an eye tracking study with 26 undergraduate students to determine if they read type annotations during code comprehension and bug localization in the TypeScript language. We found that developers do not look directly at lines containing type annotations or type declarations more often when they are present, in either code summarization or bug localization tasks. The results have implications for tool builders to improve the availability of type information, the development community to build good standards for use of type annotations, and education to enforce deliberate teaching of reading patterns.


翻译:静态类型标注已被证明能在多种编程任务中辅助开发者,即使在不使用静态类型检查的情况下这种益处依然存在。假设这是因为开发者将类型标注视为代码内文档。本研究旨在提供证据证明开发者确实将类型标注作为代码内文档使用。理解这种假设性用途将有助于了解开发者如何以及在何种情境下使用类型信息;此外,这可能有助于设计更好的开发工具并为教育决策提供参考。为提供证据,我们对26名本科生进行了眼动追踪研究,以确定他们在理解TypeScript代码和定位缺陷时是否会阅读类型标注。研究发现,无论是在代码总结任务还是缺陷定位任务中,当存在类型标注或类型声明时,开发者并不会更频繁地直接注视包含这些内容的代码行。该结果对工具开发者改进类型信息的呈现方式、开发社区建立类型标注使用的良好规范、以及教育领域加强阅读模式的有意识教学都具有启示意义。

0
下载
关闭预览

相关内容

基于深度学习的伪装目标检测研究进展
专知会员服务
30+阅读 · 2025年4月12日
干货 | 视频显著性目标检测(文末附有完整源码)
计算机视觉战队
38+阅读 · 2019年9月3日
从Seq2seq到Attention模型到Self Attention(一)
量化投资与机器学习
76+阅读 · 2018年10月8日
深度学习在文本分类中的应用
AI研习社
13+阅读 · 2018年1月7日
国家自然科学基金
0+阅读 · 2017年12月31日
国家自然科学基金
4+阅读 · 2015年12月31日
国家自然科学基金
1+阅读 · 2015年12月31日
国家自然科学基金
2+阅读 · 2015年12月31日
国家自然科学基金
3+阅读 · 2015年12月31日
国家自然科学基金
7+阅读 · 2015年12月31日
国家自然科学基金
0+阅读 · 2015年12月31日
国家自然科学基金
0+阅读 · 2015年12月31日
国家自然科学基金
12+阅读 · 2015年12月31日
VIP会员
相关VIP内容
基于深度学习的伪装目标检测研究进展
专知会员服务
30+阅读 · 2025年4月12日
相关基金
国家自然科学基金
0+阅读 · 2017年12月31日
国家自然科学基金
4+阅读 · 2015年12月31日
国家自然科学基金
1+阅读 · 2015年12月31日
国家自然科学基金
2+阅读 · 2015年12月31日
国家自然科学基金
3+阅读 · 2015年12月31日
国家自然科学基金
7+阅读 · 2015年12月31日
国家自然科学基金
0+阅读 · 2015年12月31日
国家自然科学基金
0+阅读 · 2015年12月31日
国家自然科学基金
12+阅读 · 2015年12月31日
Top
微信扫码咨询专知VIP会员