Nothing Special   »   [go: up one dir, main page]

skip to main content
10.1145/3524610.3527780acmconferencesArticle/Chapter ViewAbstractPublication PagesicseConference Proceedingsconference-collections
research-article

An approach to automatically assess method names

Published: 20 October 2022 Publication History

Abstract

An approach is presented to automatically assess the quality of method names by providing a score and feedback. The approach implements ten method naming standards to evaluate the names. The naming standards are taken from work that validated the standards via a large survey of software professionals. Natural language processing techniques such as part-of-speech tagging, identifier splitting, and dictionary lookup are required to implement the standards. The approach is evaluated by first manually constructing a large golden set of method names. Each method name is rated by several developers and labeled as conforming to each standard or not. These ratings allow for comparing the results of the approach against expert assessment. Additionally, the approach is applied to several systems and the results are manually inspected for accuracy.

References

[1]
F. Deisenbock and M. Pizka, "Concise and Consistent Naming," in 13th International Workshop on Program Comprehension (IWPC'05), St. Louis, MO, USA, 2005, pp. 97--106.
[2]
T. M. Pigoski, Practical software maintenance: best practices for managing your software investment. New York: Wiley Computer Pub, 1997.
[3]
S. Butler, M. Wermelinger, Y. Yu, and H. Sharp, "Relating Identifier Naming Flaws and Code Quality: An Empirical Study," in 2009 16th Working Conference on Reverse Engineering, Lille, France, 2009, pp. 31--35.
[4]
S. Butler, M. Wermelinger, Yijun Yu, and H. Sharp, "Exploring the Influence of Identifier Names on Code Quality: An Empirical Study," in 2010 14th European Conference on Software Maintenance and Reengineering, Madrid, 2010, pp. 156--165.
[5]
L. Pollock, K. Vijay-Shanker, E. Hill, G. Sridhara, and D. Shepherd, "Natural Language-Based Software Analyses and Tools for Software Maintenance," in Software Engineering, vol. 7171, A. De Lucia and F. Ferrucci, Eds. Berlin, Heidelberg: Springer Berlin Heidelberg, 2013, pp. 94--125.
[6]
E. W. Høst and B. M. Østvold, "Debugging Method Names," in 23rd European Conference on ECOOP 2009 --- Object-Oriented Programming, Genoa, Italy, 2009, pp. 294--317.
[7]
P. A. Relf, "Tool assisted identifier naming for improved software readability: an empirical study," in 2005 International Symposium on Empirical Software Engineering, 2005., Queensland, Australia, 2005, pp. 52--61.
[8]
B. Boehm and V. R. Basili, "Software Defect Reduction Top 10 List," Computer, vol. 34, no. 1, pp. 135--137, Jan. 2001.
[9]
J. C. Hofmeister, J. Siegmund, and D. V. Holt, "Shorter identifier names take longer to comprehend," Empirical Software Engineering, vol. 24, no. 1, pp. 417--443, Feb. 2019.
[10]
D. Lawrie, C. Morrell, H. Feild, and D. Binkley, "What's in a Name? A Study of Identifiers," in 14th IEEE International Conference on Program Comprehension (ICPC'06), 2006, pp. 3--12.
[11]
A. A. Takang, P. A. Grubb, and R. D. Macredie, "The effects of comments and identifier names on program comprehensibility: an experimental investigation," J. Prog. Lang., vol. 4, no. 3, pp. 143--167, 1996.
[12]
B. Liblit, A. Begel, and E. Sweetser, "Cognitive Perspectives on the Role of Naming in Computer Programs," in Proceedings of the 18th Annual Workshop of the Psychology of Programming Interest Group, PPIG 2006, Brighton, UK, September 7--8, 2006, 2006, p. 11.
[13]
V. Arnaoudova, M. Di Penta, and G. Antoniol, "Linguistic antipatterns: what they are and how developers perceive them," Empir Software Eng, vol. 21, no. 1, pp. 104--158, Feb. 2016.
[14]
R. S. Alsuhaibani, C. D. Newman, M. J. Decker, M. L. Collard, and J. I. Maletic, "On the Naming of Methods: A Survey of Professional Developers," in 2021 IEEE/ACM 43rd International Conference on Software Engineering (ICSE), Madrid, Spain, 2021, pp. 587--599.
[15]
S. Butler, M. Wermelinger, and Y. Yu, "Investigating naming convention adherence in Java references," in 2015 IEEE International Conference on Software Maintenance and Evolution (ICSME), Bremen, Germany, 2015, pp. 41--50.
[16]
"Checkstyle." [Online]. Available: https://checkstyle.sourceforge.io.
[17]
"Java Coding Standard Checker (JCSC)." [Online]. Available: https://sourceforge.net/projects/jcsc/.
[18]
A. Peruma, E. Hu, J. Chen, E. A. AlOmar, M. W. Mkaouer, and C. D. Newman, "Using Grammar Patterns to Interpret Test Method Name Evolution," in 2021 IEEE/ACM 29th International Conference on Program Comprehension (ICPC), Madrid, Spain, 2021, pp. 335--346.
[19]
J. Wu and J. Clause, "A pattern-based approach to detect and improve non-descriptive test names," Journal of Systems and Software, vol. 168, p. 110639, Oct. 2020.
[20]
B. Zhang, E. Hill, and J. Clause, "Automatically Generating Test Templates from Test Names (N)," in 2015 30th IEEE/ACM International Conference on Automated Software Engineering (ASE), Lincoln, NE, USA, 2015, pp. 506--511.
[21]
B. Zhang, E. Hill, and J. Clause, "Towards automatically generating descriptive names for unit tests," in Proceedings of the 31st IEEE/ACM International Conference on Automated Software Engineering, Singapore Singapore, 2016, pp. 625--636.
[22]
J. Koenemann and S. P. Robertson, "Expert problem solving strategies for program comprehension," in Proceedings of the SIGCHI conference on Human factors in computing systems Reaching through technology - CHI'91, New Orleans, Louisiana, United States, 1991, pp. 125--130.
[23]
T. A. Corbi, "Program understanding: Challenge for the 1990s," IBM Syst. J., vol. 28, no. 2, pp. 294--306, 1989.
[24]
D. Lawrie, C. Morrell, H. Feild, and D. Binkley, "Effective identifier names for comprehension and memory," Innovations in Systems and Software Engineering, vol. 3, no. 4, pp. 303--318, 2007.
[25]
S. Fakhoury, Y. Ma, V. Arnaoudova, and O. Adesope, "The effect of poor source code lexicon and readability on developers' cognitive load," in Proceedings of the 26th Conference on Program Comprehension - ICPC '18, Gothenburg, Sweden, 2018, pp. 286--296.
[26]
W. Maalej, R. Tiarks, T. Roehm, and R. Koschke, "On the Comprehension of Program Comprehension," ACM Trans. Softw. Eng. Methodol., vol. 23, no. 4, pp. 1--37, Sep. 2014.
[27]
D. Feitelson, A. Mizrahi, N. Noy, A. Ben Shabat, O. Eliyahu, and R. Sheffer, "How Developers Choose Names," IIEEE Trans. Software Eng., pp. 1--1, 2020.
[28]
V. Arnaoudova, M. Di Penta, G. Antoniol, and Y.-G. Gueheneuc, "A New Family of Software Anti-patterns: Linguistic Anti-patterns," in 2013 17th European Conference on Software Maintenance and Reengineering, Genova, 2013, pp. 187--196.
[29]
A. Peruma, V. Arnaoudova, and C. Newman, "IDEAL: An Open-Source Identifier Name Appraisal Tool," in 2021 IEEE International Conference on Software Maintenance and Evolution (ICSME), 2021.
[30]
P. Reif, "Achieving Software Quality through Source Code Readability." 01-Jan-2004.
[31]
S. Butler, M. Wermelinger, and Y. Yu, "A Survey of the Forms of Java Reference Names," in 2015 IEEE 23rd International Conference on Program Comprehension, Florence, Italy, 2015, pp. 196--206.
[32]
R. S. Alsuhaibani, C. D. Newman, M. J. Decker, M. L. Collard, and J. I. Maletic, "A Survey on Method Naming Standards: Questions and Responses Artifact," in 2021 IEEE/ACM 43rd International Conference on Software Engineering: Companion Proceedings (ICSE-Companion), Madrid, ES, 2021, pp. 242--243.
[33]
M. L. Collard, M. J. Decker, and J. I. Maletic, "srcml: An infrastructure for the exploration, analysis, and manipulation of source code: A tool demonstration," in Software Maintenance (ICSM), 2013 29th IEEE International Conference on, 2013, pp. 516--519.
[34]
J. I. Maletic and M. L. Collard, "Exploration, Analysis, and Manipulation of Source Code using srcML," presented at the 37th International Conference on Software Engineering - Volume 2, Florence, Italy, 2015.
[35]
Michael L. Collard and Jonathan I. Maletic, "srcML 1.0: Explore, Analyze, and Manipulate Source Code," presented at the 32nd IEEE International Conference on Software Maintenance and Evolution (ICSME), Raleigh, NC, USA, 02-Oct-2016.
[36]
J. Gosling, B. Joy, G. L. Jr. Steele, G. Bracha, A. Buckley, and G. L. S. Jr, The Java Language Specification, Java SE 8 Edition, 1 edition. Addison-Wesley Professional, 2014.
[37]
A. Vermeulen, The Elements of Java- Style, Reprint edition. Cambridge; New York: Cambridge University Press, 2000.
[38]
C. D. Newman et al., "On the generation, structure, and semantics of grammar patterns in source code identifiers," Journal of Systems and Software, vol. 170, p. 110740, Dec. 2020.
[39]
C. D. Newman et al., "An Ensemble Approach for Annotating Source Code Identifiers with Part-of-speech Tags," TSE, vol. Under Review, Jun. 2021.
[40]
S. Gupta, S. Malik, L. Pollock, and K. Vijay-Shanker, "Part-of-speech tagging of program identifiers for improved text-based software engineering tools," in 2013 21st International Conference on Program Comprehension (ICPC), San Francisco, CA, 2013, pp. 3--12.
[41]
E. Hill, "A model of software word usage and its use in searching source code," Ph.D. thesis, University of Delaware, 2010.
[42]
K. Toutanova, D. Klein, C. D. Manning, and Y. Singer, "Feature-rich part-of-speech tagging with a cyclic dependency network," in Proceedings of the 2003 Conference of the North American Chapter of the Association for Computational Linguistics on Human Language Technology-Volume 1, 2003, pp. 173--180.
[43]
G. A. Miller, "WordNet: a lexical database for English," Commun. ACM, vol. 38, no. 11, pp. 39--41, Nov. 1995.
[44]
M. Hucka, "Spiral: splitters for identifiers in source code files," The Journal of Open Source Software, 04-Apr-2018. [Online]. [Accessed: 19-Feb-2019].
[45]
E. Hill, D. Binkley, D. Lawrie, L. Pollock, and K. Vijay-Shanker, "An empirical study of identifier splitting techniques," Empirical Software Engineering, vol. 19, no. 6, pp. 1754--1780, Dec. 2014.
[46]
R. C. Martin, Ed., Clean code: a handbook of agile software craftsmanship. Upper Saddle River, NJ: Prentice Hall, 2009.
[47]
M. Sokolova and G. Lapalme, "A systematic analysis of performance measures for classification tasks," Information Processing & Management, vol. 45, no. 4, pp. 427--437, Jul. 2009.
[48]
D. Binkley, M. Davis, D. Lawrie, and C. Morrell, "To camelcase or under_score," in 2009 IEEE 17th International Conference on Program Comprehension, 2009, pp. 158--167.
[49]
B. Sharif and J. I. Maletic, "An Eye Tracking Study on camelCase and under_score Identifier Styles," in 2010 IEEE 18th International Conference on Program Comprehension, Braga, Portugal, 2010, pp. 196--205.
[50]
Y. Jiang, H. Liu, Y. Zhang, N. Niu, Y. Zhao, and L. Zhang, "Which abbreviations should be expanded?," in Proceedings of the 29th ACM Joint Meeting on European Software Engineering Conference and Symposium on the Foundations of Software Engineering, Athens Greece, 2021, pp. 578--589.
[51]
E. Hill et al., "AMAP: automatically mining abbreviation expansions in programs to enhance software maintenance tools," in Proceedings of the 2008 International Working Conference on Mining Software Repositories, 2008, pp. 79--88.
[52]
C. D. Newman, M. J. Decker, R. S. Alsuhaibani, A. Peruma, D. Kaushik, and E. Hill, "An Empirical Study of Abbreviations and Expansions in Software Artifacts," in 2019 IEEE International Conference on Software Maintenance and Evolution (ICSME), Cleveland, OH, USA, 2019, pp. 269--279.
[53]
N. Dragan, M. L. Collard, and J. I. Maletic, "Reverse Engineering Method Stereotypes," in 22nd IEEE International Conference on Software Maintenance (ICSM'06), 2006, pp. 24--34.

Cited By

View all
  • (2024)Dependency-Aware Method Naming Framework with Generative Adversarial Sampling2024 International Joint Conference on Neural Networks (IJCNN)10.1109/IJCNN60899.2024.10651109(1-8)Online publication date: 30-Jun-2024
  • (2023)Automating Method Naming with Context-Aware Prompt-Tuning2023 IEEE/ACM 31st International Conference on Program Comprehension (ICPC)10.1109/ICPC58990.2023.00035(203-214)Online publication date: May-2023

Index Terms

  1. An approach to automatically assess method names

    Recommendations

    Comments

    Please enable JavaScript to view thecomments powered by Disqus.

    Information & Contributors

    Information

    Published In

    cover image ACM Conferences
    ICPC '22: Proceedings of the 30th IEEE/ACM International Conference on Program Comprehension
    May 2022
    698 pages
    ISBN:9781450392983
    DOI:10.1145/3524610
    • Conference Chairs:
    • Ayushi Rastogi,
    • Rosalia Tufano,
    • General Chair:
    • Gabriele Bavota,
    • Program Chairs:
    • Venera Arnaoudova,
    • Sonia Haiduc
    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 ACM 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]

    Sponsors

    In-Cooperation

    • IEEE CS

    Publisher

    Association for Computing Machinery

    New York, NY, United States

    Publication History

    Published: 20 October 2022

    Permissions

    Request permissions for this article.

    Check for updates

    Author Tags

    1. identifier quality
    2. method names
    3. method naming standards
    4. program comprehension

    Qualifiers

    • Research-article

    Conference

    ICPC '22
    Sponsor:

    Upcoming Conference

    ICSE 2025

    Contributors

    Other Metrics

    Bibliometrics & Citations

    Bibliometrics

    Article Metrics

    • Downloads (Last 12 months)43
    • Downloads (Last 6 weeks)4
    Reflects downloads up to 24 Nov 2024

    Other Metrics

    Citations

    Cited By

    View all
    • (2024)Dependency-Aware Method Naming Framework with Generative Adversarial Sampling2024 International Joint Conference on Neural Networks (IJCNN)10.1109/IJCNN60899.2024.10651109(1-8)Online publication date: 30-Jun-2024
    • (2023)Automating Method Naming with Context-Aware Prompt-Tuning2023 IEEE/ACM 31st International Conference on Program Comprehension (ICPC)10.1109/ICPC58990.2023.00035(203-214)Online publication date: May-2023

    View Options

    Login options

    View options

    PDF

    View or Download as a PDF file.

    PDF

    eReader

    View online with eReader.

    eReader

    Media

    Figures

    Other

    Tables

    Share

    Share

    Share this Publication link

    Share on social media