RefiNym: using names to refine types

RefiNym: using names to refine types
复制标题

DOI:
10.1145/3236024.3236042
复制
发表时间:
2018-10
期刊:
Proceedings of the 2018 26th ACM Joint Meeting on European Software Engineering Conference and Symposium on the Foundations of Software Engineering
影响因子:
--
通讯作者:
Santanu Kumar Dash;Miltiadis Allamanis;Earl T. Barr
Santanu Kumar Dash;Miltiadis Allamanis;Earl T. Barr
中科院分区:
其他
文献类型:
--
作者:
Santanu Kumar Dash;Miltiadis Allamanis;Earl T. Barr

文献摘要

相似文献

源代码是双峰:它结合了一个正式的算法渠道和标识符和评论的自然语言渠道。在这项工作中,我们将代码的双峰性与名称流进行建模,该命名流量图扩大了为跟踪标识符名称。概念类型在逻辑上不同,并不总是与程序类型一致。密码和URL是可以共享程序类型字符串的示例概念类型。我们的工具Refinym是一种无监督的方法,它将概念类型的晶格从名称流中挖出,并将其列为不同的名义类型。对于字符串,重粉调查和拆分最初合并为单一类型的概念类型,将每个范围的相同类型变量的数量从8.7减少到2.2,而消除了在范围内具有相同类型变量的21.9%的范围。这使代码更加自我文献记录,并释放类型系统,以防止开发人员无意间分配概念类型的数据。
Source code is bimodal: it combines a formal, algorithmic channel and a natural language channel of identifiers and comments. In this work, we model the bimodality of code with name flows, an assignment flow graph augmented to track identifier names. Conceptual types are logically distinct types that do not always coincide with program types. Passwords and URLs are example conceptual types that can share the program type string. Our tool, RefiNym, is an unsupervised method that mines a lattice of conceptual types from name flows and reifies them into distinct nominal types. For string, RefiNym finds and splits conceptual types originally merged into a single type, reducing the number of same-type variables per scope from 8.7 to 2.2 while eliminating 21.9% of scopes that have more than one same-type variable in scope. This makes the code more self-documenting and frees the type system to prevent a developer from inadvertently assigning data across conceptual types.