Inferring Types by Mining Class Usage Frequency from Inline Caches

Milojkovic, Nevena; Béra, Clément; Ghafari, Mohammad; Nierstrasz, Oscar Marius (2016). Inferring Types by Mining Class Usage Frequency from Inline Caches. In: International Workshop on Smalltalk Technologies (IWST 2016) (pp. 1-11). ACM 10.1145/2991041.2991047

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

Download (280kB) | Request a copy

Dynamically typed languages allow developers to write more expressive source code, but their lack of static information about types of variables is one of the main obstacles during program comprehension and maintenance. Static type information reduces the complexity of a program. Most of the type inference algorithms suffer from the problem of false positives or negatives. Complex approaches are required to avoid this problem. We propose a simple heuristic that uses easily accessible run-time information about the usage of each class as a receiver type for a message send. This frequency serves as a proxy for the likelihood that a variable belongs to that class at run time and is used to promote the correct type towards the top of the list of possible types for a variable. Our evaluation of a proof-of-concept prototype implemented in Pharo Smalltalk shows that our heuristic is reason- ably precise to detect both library and project-related types on average in 65.92 to 82.83 of cases.

Item Type:

Conference or Workshop Item (Paper)


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

UniBE Contributor:

Lazarevic, Nevena, Ghafari, Mohammad, Nierstrasz, Oscar


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








Oscar Nierstrasz

Date Deposited:

08 May 2017 14:41

Last Modified:

02 Mar 2023 23:29

Publisher DOI:


Uncontrolled Keywords:

scg-sub snf-asa2 scg16 jb16 Milojkovic




Actions (login required)

Edit item Edit item
Provide Feedback