An Investigation of Compound Variable Names Toward Automated Detection of Confusing Variable Pairs

Hirohisa Aman, S. Amasaki, Tomoyuki Yokogawa, Minoru Kawahara
{"title":"An Investigation of Compound Variable Names Toward Automated Detection of Confusing Variable Pairs","authors":"Hirohisa Aman, S. Amasaki, Tomoyuki Yokogawa, Minoru Kawahara","doi":"10.1109/ASEW52652.2021.00036","DOIUrl":null,"url":null,"abstract":"A successful naming of variables is key to making the source code readable. Programmers may use a compound variable name by concatenating two or more words to make it easier to understand and more informative. While each compound variable name itself may be easy-to-understand, a collection of such variables sometimes makes a “confusing” variable pair if their names are highly similar, e.g., “shippingHeight,” vs. “shippingWeight.” A confusing variable pair would adversely affect the code readability because it may cause a misreading or a mix-up of variables. Toward automated support for enhancing the code readability, this paper conducts a large-scale investigation of compound variable names in Java programs to find quantitative criteria of the confusing variable pairs. The investigation collects 31,806,749 pairs of compound-named variables from 684 open-source Java projects and analyzes them from two different perspectives of name similarity: the string similarity and the semantic similarity.","PeriodicalId":349977,"journal":{"name":"2021 36th IEEE/ACM International Conference on Automated Software Engineering Workshops (ASEW)","volume":"24 1","pages":"0"},"PeriodicalIF":0.0000,"publicationDate":"2021-11-01","publicationTypes":"Journal Article","fieldsOfStudy":null,"isOpenAccess":false,"openAccessPdf":"","citationCount":"3","resultStr":null,"platform":"Semanticscholar","paperid":null,"PeriodicalName":"2021 36th IEEE/ACM International Conference on Automated Software Engineering Workshops (ASEW)","FirstCategoryId":"1085","ListUrlMain":"https://doi.org/10.1109/ASEW52652.2021.00036","RegionNum":0,"RegionCategory":null,"ArticlePicture":[],"TitleCN":null,"AbstractTextCN":null,"PMCID":null,"EPubDate":"","PubModel":"","JCR":"","JCRName":"","Score":null,"Total":0}
引用次数: 3

Abstract

A successful naming of variables is key to making the source code readable. Programmers may use a compound variable name by concatenating two or more words to make it easier to understand and more informative. While each compound variable name itself may be easy-to-understand, a collection of such variables sometimes makes a “confusing” variable pair if their names are highly similar, e.g., “shippingHeight,” vs. “shippingWeight.” A confusing variable pair would adversely affect the code readability because it may cause a misreading or a mix-up of variables. Toward automated support for enhancing the code readability, this paper conducts a large-scale investigation of compound variable names in Java programs to find quantitative criteria of the confusing variable pairs. The investigation collects 31,806,749 pairs of compound-named variables from 684 open-source Java projects and analyzes them from two different perspectives of name similarity: the string similarity and the semantic similarity.
面向混淆变量对自动检测的复合变量名研究
成功地命名变量是使源代码具有可读性的关键。程序员可以通过连接两个或多个单词来使用复合变量名,以使其更容易理解并提供更多信息。虽然每个复合变量名称本身可能很容易理解,但如果这些变量的名称非常相似,例如“shippingHeight”和“shippingWeight”,则这些变量的集合有时会形成“令人困惑的”变量对。令人困惑的变量对会对代码的可读性产生不利影响,因为它可能导致误读或混淆变量。为了提高代码可读性的自动化支持,本文对Java程序中的复合变量名进行了大规模的调查,以找到混淆变量对的定量标准。该调查从684个开源Java项目中收集了31,806,749对复合命名变量,并从名称相似度的两个不同角度进行了分析:字符串相似度和语义相似度。
本文章由计算机程序翻译,如有差异,请以英文原文为准。
求助全文
约1分钟内获得全文 求助全文
来源期刊
自引率
0.00%
发文量
0
×
引用
GB/T 7714-2015
复制
MLA
复制
APA
复制
导出至
BibTeX EndNote RefMan NoteFirst NoteExpress
×
提示
您的信息不完整,为了账户安全,请先补充。
现在去补充
×
提示
您因"违规操作"
具体请查看互助需知
我知道了
×
提示
确定
请完成安全验证×
copy
已复制链接
快去分享给好友吧!
我知道了
右上角分享
点击右上角分享
0
联系我们:info@booksci.cn Book学术提供免费学术资源搜索服务,方便国内外学者检索中英文文献。致力于提供最便捷和优质的服务体验。 Copyright © 2023 布克学术 All rights reserved.
京ICP备2023020795号-1
ghs 京公网安备 11010802042870号
Book学术文献互助
Book学术文献互助群
群 号:604180095
Book学术官方微信