Exploring Type Inference Techniques of Dynamically Typed Languages
Autor: | C M Khaled Saifullah, Chanchal K. Roy, Muhammad Asaduzzaman |
---|---|
Rok vydání: | 2020 |
Předmět: |
Word embedding
Programming language Computer science business.industry Deep learning Type inference 020207 software engineering Type system Context (language use) 02 engineering and technology computer.software_genre JavaScript 020204 information systems 0202 electrical engineering electronic engineering information engineering Feature (machine learning) Code (cryptography) Artificial intelligence business computer computer.programming_language |
Zdroj: | SANER |
DOI: | 10.1109/saner48275.2020.9054814 |
Popis: | Developers often prefer dynamically typed programming languages, such as JavaScript, because such languages do not require explicit type declarations. However, such a feature hinders software engineering tasks, such as code completion, type related bug fixes and so on. Deep learning-based techniques are proposed in the literature to infer the types of code elements in JavaScript snippets. These techniques are computationally expensive. While several type inference techniques have been developed to detect types in code snippets written in statically typed languages, it is not clear how effective those techniques are for inferring types in dynamically typed languages, such as JavaScript. In this paper, we investigate the type inference techniques of JavaScript to understand the above two issues further. While doing that we propose a new technique that considers the locally specific code tokens as the context to infer the types of code elements. The evaluation result shows that the proposed technique is 20-47% more accurate than the statically typed language-based techniques and 5–14 times faster than the deep learning techniques without sacrificing accuracy. Our analysis of sensitivity, overlapping of predicted types and the number of training examples justify the importance of our technique. |
Databáze: | OpenAIRE |
Externí odkaz: |