Title
A Case Study on Type Hints in Method Argument Names in Pharo Smalltalk Projects
Abstract
A common practice when writing Smalltalk source code is to name method arguments in a way that hints at their expected type (i.e., aString, anInteger, aDictionary). This practice makes code more readable, but the prevalence of this practice is unknown, thus its reliability is questionable. Tools such as the auto complete feature in the Pharo Smalltalk code editor rely on these hints to improve the developer experience. The default algorithm used in Pharo to extract type information from these hints succeeds in extracting a type in slightly over 36% of method arguments taken from 114 Pharo projects. In this paper we present the results of analyzing the failing method argument names, and provide several simple heuristics that can increase the rate of success to slightly over 50%. We also present a case study on the relation between type hints and run-time types of method arguments that shows that type hints, in a great majority of cases, reflect run-time types.
Year
DOI
Venue
2016
10.1109/SANER.2016.41
2016 IEEE 23rd International Conference on Software Analysis, Evolution, and Reengineering (SANER)
Keywords
Field
DocType
type hints,method argument names,Pharo Smalltalk projects,Smalltalk source code,aString,anInteger,aDictionary,Pharo Smalltalk code editor,run-time type method
Programming language,Software engineering,Source code,Computer science,Pharo,Smalltalk,Heuristics
Conference
Volume
Citations 
PageRank 
1
3
0.38
References 
Authors
15
3
Name
Order
Citations
PageRank
Boris Spasojevic140.75
Mircea Lungu254539.17
Oscar Nierstrasz32404346.86