Exploiting Type Hints in Method Argument Names to Improve Lightweight Type Inference - Inria - Institut national de recherche en sciences et technologies du numérique Accéder directement au contenu
Communication Dans Un Congrès Année : 2017

Exploiting Type Hints in Method Argument Names to Improve Lightweight Type Inference

Résumé

The lack of static type information is one of the main obstacles to program comprehension in dynamically-typed languages. While static type inference algorithms try to remedy this problem, they usually suffer from the problem of false positives or false negatives. In order to partially compensate for the lack of static type information, a common practice in dynamically-typed languages is to name or annotate method arguments in such a way that they reveal their expected type, e.g., aString, anInt, or string: String. Recent studies confirmed that these type annotations are indeed frequently used by developers in dynamically-typed languages. We propose a lightweight heuristic that uses these hints from method argument names to augment the performance of a static type inference algorithm. The evaluation through a proof-of-concept prototype implemented in Pharo Smalltalk shows that the augmented algorithm outperforms the basic algorithm, and correctly infers types for 81% more method arguments.
Fichier principal
Vignette du fichier
CPA-preprint.pdf (281.4 Ko) Télécharger le fichier
Origine : Fichiers produits par l'(les) auteur(s)
Loading...

Dates et versions

hal-01519632 , version 1 (08-05-2017)

Identifiants

  • HAL Id : hal-01519632 , version 1

Citer

Nevena Milojković, Mohammad Ghafari, Oscar Nierstrasz. Exploiting Type Hints in Method Argument Names to Improve Lightweight Type Inference. International Conference on Program Comprehension, May 2017, Buenos Aires, Argentina. ⟨hal-01519632⟩

Collections

PHARO
143 Consultations
495 Téléchargements

Partager

Gmail Facebook X LinkedIn More