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)

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)

Division/Institute:

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

Subjects:

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

ISBN:

978-1-4503-4524-8

Publisher:

ACM

Language:

English

Submitter:

Oscar Nierstrasz

Date Deposited:

08 May 2017 14:41

Last Modified:

02 Mar 2023 23:29

Publisher DOI:

10.1145/2991041.2991047

Uncontrolled Keywords:

scg-sub snf-asa2 scg16 jb16 Milojkovic

BORIS DOI:

10.7892/boris.96862

URI:

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

Actions (login required)

Edit item Edit item
Provide Feedback