[go: up one dir, main page]
More Web Proxy on the site http://driver.im/ skip to main content
10.1145/3661167.3661228acmotherconferencesArticle/Chapter ViewAbstractPublication PageseaseConference Proceedingsconference-collections
research-article

A Quantitative Investigation of Trends in Confusing Variable Pairs Through Commits: Do Confusing Variable Pairs Survive?

Published: 18 June 2024 Publication History

Abstract

Programmers can make the variables easy to understand by choosing meaningful names. However, even though individual names are meaningful, a collection of them might adversely affect the code readability when their names are highly similar, such as “bottomRight” vs. “bottomHeight,” and they may cause mixing up or misreading of variables. Such a pair is referred to as a “confusing variable pair.” This paper conducts a large-scale investigation to examine the change trends of confusing variable pairs over commits, and it reports the following findings. (1) The average number of confusing variable pairs appearing in a source file is 1.4 in Java and 1.3 in Python. (2) About 67–75% of confusing variable pairs survive through commits. (3) Confusing variable pairs tend to appear in a subset of source files within a project (the median rates in Java and Python projects: 26% and 13%) and disappear from fewer files (the median rates in Java and Python projects: 6% and 2%). (4) Although the change trends do not vary among projects, some outlier projects have significantly more confusing variable pairs.

References

[1]
Hirohisa Aman, Sousuke Amasaki, Takashi Sasaki, and Minoru Kawahara. 2015. Empirical Analysis of Change-Proneness in Methods Having Local Variables with Long Names and Comments. In Proc. 9th Int. Symp. Empir. Softw. Eng. & Measurement. 50–53. https://doi.org/10.1109/ESEM.2015.7321197
[2]
Hirohisa Aman, Sousuke Amasaki, Tomoyuki Yokogawa, and Minoru Kawahara. 2019. Empirical Study of Fault Introduction Focusing on the Similarity among Local Variable Names. In Proc. 7th Int. Workshop Quantitative Approaches to Softw. Quality. 3–11. https://ceur-ws.org/Vol-2511/QuASoQ-01.pdf
[3]
Hirohisa Aman, Sousuke Amasaki, Tomoyuki Yokogawa, and Minoru Kawahara. 2021. A Large-Scale Investigation of Local Variable Names in Java Programs: Is Longer Name Better for Broader Scope Variable?. In Quality of Inf. & Comm. Tech., Ana C. R. Paiva, Ana Rosa Cavalli, Paula Ventura Martins, and Ricardo Pérez-Castillo (Eds.). Springer International Publishing, Cham, 489–500. https://doi.org/10.1007/978-3-030-85347-1_35
[4]
Hirohisa Aman, Sousuke Amasaki, Tomoyuki Yokogawa, and Minoru Kawahara. 2023. An automated detection of confusing variable pairs with highly similar compound names in Java and Python programs. Empir. Softw. Eng. 28, 108 (Aug. 2023), 1–32. https://doi.org/10.1007/s10664-023-10339-2
[5]
Venera Arnaoudova, Massimiliano Di Penta, and Giuliano Antoniol. 2016. Linguistic antipatterns: what they are and how developers perceive them. Empr. Softw. Eng. 21, 1 (Feb. 2016), 104–158. https://doi.org/10.1007/s10664-014-9350-8
[6]
Dave Binkley, Dawn Lawrie, Steve Maex, and Christopher Morrell. 2009. Identifier length and limited programmer memory. Sc. Comp. Prog. 74, 7 (May 2009), 430–445. https://doi.org/10.1016/j.scico.2009.02.006
[7]
Dustin Boswell and Trevor Foucher. 2011. The Art of Readable Code: Simple and Practical Techniques for Writing Better Code. Oreilly & Associates, Sebastopol, CA.
[8]
Florian Deissenboeck and Markus Pizka. 2006. Concise and consistent naming. Softw. Quality J. 14, 3 (Sept. 2006), 261–282. https://doi.org/10.1007/s11219-006-9219-1
[9]
Dror G. Feitelson. 2023. Reanalysis of Empirical Data on Java Local Variables with Narrow and Broad Scope. In Proc. 31st Int. Conf. Program Comprehension. 227–236. https://doi.org/10.1109/ICPC58990.2023.00037
[10]
Martin Fowler. 2018. Refactoring: Improving the Design of Existing Code (2nd ed.). Addison-Wesley Professional, Hoboken, NJ.
[11]
Dan Gusfield. 1997. Algorithms on Strings, Trees, and Sequences: Computer Science and Computational Biology. Cambridge University Press, Cambridge.
[12]
Ahmed E. Hassan. 2009. Predicting faults using the complexity of code changes. In Proc. 31st Int. Conf. Softw. Eng.78–88. https://doi.org/10.1109/ICSE.2009.5070510
[13]
Michael Hucka. 2018. Spiral: splitters for identifiers in source code files. J. Open Source Softw. 3, 24 (April 2018), 653:1–653:3. https://doi.org/10.21105/joss.00653
[14]
Dawn Lawrie, Christopher Morrell, Henry Feild, and David Binkley. 2007. Effective identifier names for comprehension and memory. Innov. Systems & Softw. Eng. 3, 4 (01 Dec. 2007), 303–318. https://doi.org/10.1007/s11334-007-0031-2
[15]
Quoc Le and Tomas Mikolov. 2014. Distributed Representations of Sentences and Documents. In Proc. 31st Int. Conf. Machine Learning, Vol. 32. 1188–1196. https://proceedings.mlr.press/v32/le14.html
[16]
Robert C. Martin. 2009. Clean Code: A Handbook of Agile Software Craftsmanship. Prentice Hall, Upper Saddle River, NJ.
[17]
Christian D. Newman, Reem S. AlSuhaibani, Michael J. Decker, Anthony Peruma, Dishant Kaushik, Mohamed Wiem Mkaouer, and Emily Hill. 2020. On the generation, structure, and semantics of grammar patterns in source code identifiers. J. Systems & Softw. 170 (Dec. 2020), 110740. https://doi.org/10.1016/j.jss.2020.110740
[18]
Jevgenija Pantiuchina, Fiorella Zampetti, Simone Scalabrino, Valentina Piantadosi, Rocco Oliveto, Gabriele Bavota, and Massimiliano Di Penta. 2020. Why Developers Refactor Source Code: A Mining-based Study. ACM Trans. Softw. Eng. Methodol. 29, 4 (Sept. 2020), 29:1–29:30. https://doi.org/10.1145/3408302
[19]
Anthony Peruma, Mohamed Wiem Mkaouer, Michael J. Decker, and Christian D. Newman. 2020. Contextualizing rename decisions using refactorings, commit messages, and data types. J. Systems & Softw. 169 (Nov. 2020), 110704. https://doi.org/10.1016/j.jss.2020.110704
[20]
Daryl Posnett, Raissa D’Souza, Premkumar Devanbu, and Vladimir Filkov. 2013. Dual ecological measures of focus in software development. In Proc. 35th Int. Conf. Softw. Eng.452–461. https://doi.org/10.1109/ICSE.2013.6606591
[21]
Simone Scalabrino, Gabriele Bavota, Christopher Vendome, Mario Linares-Vásquez, Denys Poshyvanyk, and Rocco Oliveto. 2021. Automatically Assessing Code Understandability. IEEE Trans. Softw. Eng. 47, 3 (March 2021), 595–613. https://doi.org/10.1109/TSE.2019.2901468
[22]
Giuseppe Scanniello, Michele Risi, Porfirio Tramontana, and Simone Romano. 2017. Fixing Faults in C and Java Source Code: Abbreviated vs. Full-Word Identifier Names. ACM Trans. Softw. Eng. Methodol. 26, 2, Article 6 (July 2017), 43 pages. https://doi.org/10.1145/3104029
[23]
Andrea Schankin, Annika Berger, Daniel V. Holt, Johannes C. Hofmeister, Till Riedel, and Michael Beigl. 2018. Descriptive Compound Identifier Names Improve Source Code Comprehension. In Proc. 26th Int. Conf. Program Comprehension. 31–40. https://doi.org/10.1145/3196321.3196332
[24]
Keiichiro Tashima, Hirohisa Aman, Sousuke Amasaki, Tomoyuki Yokogawa, and Minoru Kawahara. 2018. Fault-Prone Java Method Analysis Focusing on Pair of Local Variables with Confusing Names. In Proc. 44th Euromicro Conf. Softw. Eng. & Advanced App.154–158. https://doi.org/10.1109/SEAA.2018.00033
[25]
Jingxuan Zhang, Junpeng Luo, Jiahui Liang, Lina Gong, and Zhiqiu Huang. 2023. An Accurate Identifier Renaming Prediction and Suggestion Approach. ACM Trans. Softw. Eng. Methodol. 32, 6, Article 148 (Sept. 2023), 51 pages. https://doi.org/10.1145/3603109

Index Terms

  1. A Quantitative Investigation of Trends in Confusing Variable Pairs Through Commits: Do Confusing Variable Pairs Survive?

      Recommendations

      Comments

      Please enable JavaScript to view thecomments powered by Disqus.

      Information & Contributors

      Information

      Published In

      cover image ACM Other conferences
      EASE '24: Proceedings of the 28th International Conference on Evaluation and Assessment in Software Engineering
      June 2024
      728 pages
      ISBN:9798400717017
      DOI:10.1145/3661167
      Permission to make digital or hard copies of all or part of this work for personal or classroom use is granted without fee provided that copies are not made or distributed for profit or commercial advantage and that copies bear this notice and the full citation on the first page. Copyrights for components of this work owned by others than the author(s) must be honored. Abstracting with credit is permitted. To copy otherwise, or republish, to post on servers or to redistribute to lists, requires prior specific permission and/or a fee. Request permissions from [email protected].

      Publisher

      Association for Computing Machinery

      New York, NY, United States

      Publication History

      Published: 18 June 2024

      Permissions

      Request permissions for this article.

      Check for updates

      Author Tags

      1. code readability
      2. confusing variable pair
      3. mining software repositories
      4. variable name

      Qualifiers

      • Research-article
      • Research
      • Refereed limited

      Conference

      EASE 2024

      Acceptance Rates

      Overall Acceptance Rate 71 of 232 submissions, 31%

      Contributors

      Other Metrics

      Bibliometrics & Citations

      Bibliometrics

      Article Metrics

      • 0
        Total Citations
      • 38
        Total Downloads
      • Downloads (Last 12 months)38
      • Downloads (Last 6 weeks)8
      Reflects downloads up to 12 Dec 2024

      Other Metrics

      Citations

      View Options

      Login options

      View options

      PDF

      View or Download as a PDF file.

      PDF

      eReader

      View online with eReader.

      eReader

      HTML Format

      View this article in HTML Format.

      HTML Format

      Media

      Figures

      Other

      Tables

      Share

      Share

      Share this Publication link

      Share on social media