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

Milojković, Nevena; Ghafari, Mohammad; Nierstrasz, Oscar Marius (2017). Exploiting Type Hints in Method Argument Names to Improve Lightweight Type Inference. In: 25th International Conference on Program Comprehension (pp. 77-87). IEEE 10.1109/ICPC.2017.33

[img] Text
07961506.pdf - Published Version
Restricted to registered users only
Available under License Publisher holds Copyright.

Download (337kB) | Request a copy

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.

Item Type:

Conference or Workshop Item (Paper)

Division/Institute:

08 Faculty of Science > Institute of Computer Science (INF)
08 Faculty of Science > Institute of Computer Science (INF) > Software Composition Group (SCG)

UniBE Contributor:

Ghafari, Mohammad and Nierstrasz, Oscar Marius

Subjects:

000 Computer science, knowledge & systems
500 Science > 510 Mathematics

ISBN:

978-1-5386-0535-6

Publisher:

IEEE

Language:

English

Submitter:

Oscar Marius Nierstrasz-Margiotta

Date Deposited:

11 Apr 2018 13:48

Last Modified:

11 Apr 2018 13:58

Publisher DOI:

10.1109/ICPC.2017.33

BORIS DOI:

10.7892/boris.113135

URI:

https://boris.unibe.ch/id/eprint/113135

Actions (login required)

Edit item Edit item
Provide Feedback