遇见数据集

Casting about in the Dark - Artifact Evaluation

收藏
Zenodo2020-07-29 更新2026-05-25 收录
数据链接:
官方服务:

资源简介:

Companion dataset artifact used in the paper "Casting about in the Dark". This version incorporates some additional minor changes to the artifact, related to the additionally sampled cast instances. This version is the one used in the final version of the paper. --- Abstract: The main goal of a static type system is to prevent certain kinds of errors from happening at run time. A type system is formulated as a set of constraints that gives any expression or term in a program a well-defined type. Yet mainstream programming languages are endowed with type systems that provide the means to circumvent their constraints through <em>casting</em>. We want to understand how and when developers escape the static type system to use dynamic typing. We empirically study how casting is used by developers in more than seven thousand Java projects. We find that casts are widely used (8.7% of methods contain at least one cast) and that 50% of casts we inspected are not guarded locally to ensure against potential run-time errors. To help us better categorize use cases and thus understand how casts are used in practice, we identify 25 cast-usage patterns, recurrent programming idioms using casts to solve a specific issue. This knowledge can be: (a) a recommendation for current and future language designers to make informed decisions (b) a reference for tool builders, <em>e.g.</em>,<br> by providing more precise or new refactoring analyses, (c) a guide for researchers to test new language features, or to carry out controlled programming experiments, and (d) a guide for developers for better practices.

本数据集为论文"Casting about in the Dark"中使用的配套数据集制品。此版本对该制品进行了若干小幅调整,相关调整与额外采样的强制类型转换实例有关,且为本论文最终版所采用的版本。--- 摘要:静态类型系统(static type system)的核心目标是在运行时(run time)避免特定类型的错误发生。类型系统被定义为一组约束规则,可为程序中的任意表达式或语法项赋予明确的类型。然而主流编程语言所配备的类型系统,却提供了通过强制类型转换(casting)绕过其约束的途径。我们旨在探究开发者如何、何时会绕过静态类型系统以使用动态类型风格的编程。我们针对七千余个Java项目中的开发者使用强制类型转换的情况开展了实证研究。研究发现,强制类型转换的使用十分普遍——8.7%的方法中至少包含一处强制类型转换,且我们所检视的强制类型转换中有50%未在本地设置防护,以避免潜在的运行时错误。为更好地对使用场景进行分类,进而明晰强制类型转换在实际中的使用方式,我们归纳出25种强制类型转换使用模式,即用于解决特定问题的重复性编程惯用法。本研究成果可用于:(a) 为当前及未来的编程语言设计者提供决策参考,助力其做出审慎抉择;(b) 为工具开发者提供参照,例如通过提供更精准的或全新的重构分析能力;(c) 为研究者提供指导,以助力其测试新型语言特性或开展受控编程实验;(d) 为开发者提供实践指南,以优化其编程实践。

提供机构:
Zenodo
创建时间:
2019-08-15
二维码
社区交流群
二维码
科研交流群
商业服务