Learning to Predict User-Defined Types

Learning to Predict User-Defined Types
复制标题

DOI:
10.1109/tse.2022.3178945
复制
发表时间:
2023-04
影响因子:
7.4
通讯作者:
Kevin Jesse;Prem Devanbu;A. Sawant
Kevin Jesse;Prem Devanbu;A. Sawant
中科院分区:
计算机科学1区
文献类型:
--
作者:
Kevin Jesse;Prem Devanbu;A. Sawant

文献摘要

相似文献

TypeScrip是一种被广泛采用的渐进式类型化语言,开发人员可以在其中选择键入变量、函数、参数等。使用ML(机器学习)的概率类型推断方法工作得很好,特别是对于布尔、数字和字符串等常见类型。TypeScrip允许多种类型,包括开发人员定义的类名和类型接口。这些开发人员定义的类型称为用户定义类型,可以在语言命名约定的范围内编写。用户定义的类型集是无限的,现有的有界类型猜测方法是不完美的解决方案。现有的工作要么在“在用户定义类型中执行”下进行,要么完全忽略用户定义类型。这项工作利用具有多任务学习目标的BERT风格的预训练模型来学习如何键入用户定义的类和接口。因此,我们提出了DiverseTyper,这是一个解决方案,它通过将类和接口声明与使用它们的位置唯一地对齐来探索不同的用户定义类型集。DiverseTyper超过了所有现有的作品,包括那些为用户定义的类型建模的作品。
TypeScript is a widely adopted gradual typed language where developers can optionally type variables, functions, parameters and more. Probabilistic type inference approaches with ML (machine learning) work well especially for commonly occurring types such as boolean, number, and string. TypeScript permits a wide range of types including developer defined class names and type interfaces. These developer defined types, termed user-defined types, can be written within the realm of language naming conventions. The set of user-defined types is boundless and existing bounded type guessing approaches are an imperfect solution. Existing works either under perform in user-defined types or ignore user-defined types altogether. This work leverages a BERT-style pre-trained model, with multi-task learning objectives, to learn how to type user-defined classes and interfaces. Thus we present DiverseTyper, a solution that explores the diverse set of user-defined types by uniquely aligning classes and interfaces declarations to the places in which they are used. DiverseTyper surpasses all existing works including those that model user-defined types.