kirancodes.me
To Proof Maintenance & Beyond!

FlexType: A Plug-and-Play Framework for Type Inference Models

Sivani Voruganti, Kevin Jesse, Premkumar T. Devanbu

Abstract

Types in TypeScript play an important role in the correct usage of variables and APIs. Type errors such as variable or function misuse can be avoided with explicit type annotations. In this work, we introduce FlexType, an IDE extension that can be used on both JavaScript and TypeScript to infer types in an interactive or automatic fashion. We perform experiments with FlexType in JavaScript to determine how many types FlexType could resolve if it were to be used to migrate top JavaScript projects to TypeScript. FlexType is able to annotate 56.69% of all types with high precision and confidence including native and imported types from modules. In addition to the automatic inference, we believe the interactive Visual Studio Code extension is inherently useful in both TypeScript and JavaScript especially when resolving types is taxing for the developer.

BibTeX
@inproceedings{Voruganti-al:ASE22,
  author    = {Sivani Voruganti and
               Kevin Jesse and
               Premkumar T. Devanbu},
  title     = {{FlexType:} A {Plug-and-Play} Framework for Type Inference Models},
  booktitle = {ASE},
  pages     = {159:1--159:5},
  publisher = {{ACM}},
  year      = {2022},
}

Related papers