Litcius/Paper detail

Learning to Predict User-Defined Types

Kevin Jesse, Prémkumar Dévanbu, Anand Ashok Sawant

2022IEEE Transactions on Software Engineering10 citationsDOI

Abstract

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 <monospace xmlns:mml="http://www.w3.org/1998/Math/MathML" xmlns:xlink="http://www.w3.org/1999/xlink">boolean</monospace> , <monospace xmlns:mml="http://www.w3.org/1998/Math/MathML" xmlns:xlink="http://www.w3.org/1999/xlink">number</monospace> , and <monospace xmlns:mml="http://www.w3.org/1998/Math/MathML" xmlns:xlink="http://www.w3.org/1999/xlink">string</monospace> . TypeScript permits a wide range of types including developer defined class names and type interfaces. These developer defined types, termed <italic xmlns:mml="http://www.w3.org/1998/Math/MathML" xmlns:xlink="http://www.w3.org/1999/xlink">user-defined types</i> , 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 <sc xmlns:mml="http://www.w3.org/1998/Math/MathML" xmlns:xlink="http://www.w3.org/1999/xlink">DiverseTyper</small> , 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. <sc xmlns:mml="http://www.w3.org/1998/Math/MathML" xmlns:xlink="http://www.w3.org/1999/xlink">DiverseTyper</small> surpasses all existing works including those that model user-defined types.

Topics & Concepts

TypeScriptComputer scienceSet (abstract data type)Artificial intelligenceInferenceUser interfaceType (biology)Task (project management)Programming languageInformation retrievalNatural language processingEconomicsBiologyManagementEcologySoftware Engineering ResearchNatural Language Processing TechniquesTopic Modeling
Learning to Predict User-Defined Types | Litcius