TypeScript applications often use untyped JavaScript libraries. To support static type checking of such applications, the typed APIs of the libraries are expressed as separate declaration files. This raises the challenge of checking that the declaration files are correct with respect to the library implementations. Previous work has shown that mismatches are frequent and cause TypeScript's type checker to misguide the programmers by rejecting correct applications and accepting incorrect ones.
This paper shows how feedback-directed random testing, which is an automated testing technique that has mostly been used for testing Java libraries, can be adapted to effectively detect such type mismatches. Given a JavaScript library with a TypeScript declaration file, our tool TSTEST generates a "type test script", which is an application that interacts with the library and tests that it behaves according to the type declarations.
Compared to alternative solutions that involve static analysis, this approach finds significantly more mismatches in a large collection of real-world JavaScript libraries with TypeScript declaration files, and with fewer false positives. It also has the advantage that reported mismatches are easily reproducible with concrete executions, which aids diagnosis and debugging.
Thu 26 OctDisplayed time zone: Tijuana, Baja California change
15:30 - 17:22 | |||
15:30 22mTalk | A Solver-Aided Language for Test Input Generation OOPSLA Talia Ringer University of Washington, Dan Grossman University of Washington, Daniel Schwartz-Narbonne Amazon, n.n., Serdar Tasiran Amazon, n.n. DOI | ||
15:52 22mTalk | Automated Testing of Graphics Shader Compilers OOPSLA Alastair F. Donaldson Imperial College London, Hugues Evrard Imperial College London, UK, Andrei Lascu Imperial College London, Paul Thomson Imperial College London DOI | ||
16:14 22mTalk | Bounded Exhaustive Test-Input Generation on GPUs OOPSLA Ahmet Celik University of Texas at Austin, USA, Sreepathi Pai University of Rochester, Sarfraz Khurshid University of Texas at Austin, Milos Gligoric University of Texas at Austin DOI | ||
16:37 22mTalk | Transforming Programs and Tests in Tandem for Fault Localization OOPSLA DOI | ||
16:59 22mTalk | Type Test Scripts for TypeScript Testing OOPSLA DOI |