Reanalysis of Empirical Data on Java Local Variables with Narrow and Broad Scope

Dror G. Feitelson*

*Corresponding author for this work

Research output: Chapter in Book/Report/Conference proceedingConference contributionpeer-review

2 Scopus citations

Abstract

It is generally accepted that variables with a narrow syntactic scope can have short names, whereas variables with a broad scope require more informative longer names. We study how names are given in practice, using a dataset of nearly 640 thousand variable names from Java methods, recently introduced by Aman et al. We extend their original analysis by using a finer division of scopes into ranges. We find that indeed variables with broader scope tend to be slightly longer and to include more words. There is also a progression of changes in name structures, with fewer single-letter names and more compound names as the scope increases. But the biggest differences occur at the low-scope end, not the high-scope end. In addition, we present more evidence that words of 6 letters or more are often abbreviated, but this is not affected by scope. Finally, we also analyze the distribution of popularity of names and of words in names, and show that single letter names are much more varied and common than usually thought, even when the variables have a broad scope.

Original languageEnglish
Title of host publicationProceedings - 2023 IEEE/ACM 31st International Conference on Program Comprehension, ICPC 2023
PublisherIEEE Computer Society
Pages227-236
Number of pages10
ISBN (Electronic)9798350337501
DOIs
StatePublished - 2023
Event31st IEEE/ACM International Conference on Program Comprehension, ICPC 2023 - Melbourne, Australia
Duration: 15 May 202316 May 2023

Publication series

NameIEEE International Conference on Program Comprehension
Volume2023-May

Conference

Conference31st IEEE/ACM International Conference on Program Comprehension, ICPC 2023
Country/TerritoryAustralia
CityMelbourne
Period15/05/2316/05/23

Bibliographical note

Publisher Copyright:
© 2023 IEEE.

Keywords

  • name length
  • variable name
  • variable scope

Fingerprint

Dive into the research topics of 'Reanalysis of Empirical Data on Java Local Variables with Narrow and Broad Scope'. Together they form a unique fingerprint.

Cite this