TSDolly: A program generator for TypeScript

  • Gabriela Araujo Britto UFPE
  • Leopoldo Teixeira UFPE
  • Rohit Gheyi UFCG

Resumo


TypeScript is an increasingly popular open-source language that builds on JavaScript by adding optional static type definitions. Its ecosystem has many tools that require confidence in their correctness when manipulating TypeScript programs. Tool developers commonly use tests for increasing confidence in a tool’s implementation correctness. To test tool implementations, tool developers can manually write TypeScript programs to be used as test inputs, but they can miss problematic programs as there are many language features to consider. In addition, a range of those tools have properties that apply specifically to programs that compile successfully and satisfy complex constraints. We therefore present a program generation technique that allows generating successfully compiling TypeScript programs, that optionally also satisfy tool-specific constraints not captured by syntactic constraints alone. We evaluated our technique by generating programs in the context of five automated TypeScript refactoring implementation, and by running tests with the generated programs as inputs. The majority (97.45%) of the generated programs compiled without errors, and all of the generated programs could be refactored, meaning that they can indeed satisfy tool-specific constraints to be used as test inputs. We tested the refactorings using the generated programs as test inputs and we found and reported a bug in a TypeScript refactoring, where the refactoring introduced a compilation error to programs that previously had no errors.
Publicado
30/09/2021
Como Citar

Selecione um Formato
BRITTO, Gabriela Araujo; TEIXEIRA, Leopoldo; GHEYI, Rohit. TSDolly: A program generator for TypeScript. In: SIMPÓSIO BRASILEIRO DE LINGUAGENS DE PROGRAMAÇÃO (SBLP), 25. , 2021, Joinville. Anais [...]. Porto Alegre: Sociedade Brasileira de Computação, 2021 . p. 66–74.