Learning to Spot and Refactor Inconsistent Method Names

被引:55
|
作者
Liu, Kui [1 ]
Kim, Dongsun [1 ]
Bissyande, Tegawende F. [1 ]
Kim, Taeyoung [2 ]
Kim, Kisub [1 ]
Koyuncu, Anil [1 ]
Kim, Suntae [2 ]
Le Traon, Yves [1 ]
机构
[1] Univ Luxembourg, Interdisciplinary Ctr Secur Reliabil & Trust SnT, Esch Sur Alzette, Luxembourg
[2] Chonbuk Natl Univ, Dept Software Engn, Jeonju, South Korea
关键词
SOURCE CODE;
D O I
10.1109/ICSE.2019.00019
中图分类号
TP18 [人工智能理论];
学科分类号
081104 ; 0812 ; 0835 ; 1405 ;
摘要
To ensure code readability and facilitate software maintenance, program methods must be named properly. In particular, method names must be consistent with the corresponding method implementations. Debugging method names remains an important topic in the literature, where various approaches analyze commonalities among method names in a large dataset to detect inconsistent method names and suggest better ones. We note that the state-of-the-art does not analyze the implemented code itself to assess consistency. We thus propose a novel automated approach to debugging method names based on the analysis of consistency between method names and method code. The approach leverages deep feature representation techniques adapted to the nature of each artifact. Experimental results on over 2.1 million Java methods show that we can achieve up to 15 percentage points improvement over the state-of-the-art, establishing a record performance of 67.9% F1-measure in identifying inconsistent method names. We further demonstrate that our approach yields up to 25% accuracy in suggesting full names, while the state-of-the-art lags far behind at 1.1% accuracy. Finally, we report on our success in fixing 66 inconsistent method names in a live study on projects in the wild.
引用
收藏
页码:1 / 12
页数:12
相关论文
共 50 条
  • [21] METHOD OF MAKING AN INCONSISTENT MATRIX CONSISTENT
    SHAYCOFT, MF
    AMERICAN PSYCHOLOGIST, 1967, 22 (07) : 535 - &
  • [22] Debugging Method Names
    Host, Einar W.
    Ostvold, Bjarte M.
    ECOOP 2009 - OBJECT-ORIENTED PROGRAMMING, 2009, 5653 : 294 - 317
  • [23] A New Method for Inconsistent Multicriteria Classification
    Deng, Weibin
    Wang, Guoyin
    Yang, Shuangxia
    Hu, Feng
    ROUGH SETS AND KNOWLEDGE TECHNOLOGY, 2011, 6954 : 600 - +
  • [24] The DOP estimation method is biased and inconsistent
    Johnson, M
    COMPUTATIONAL LINGUISTICS, 2002, 28 (01) : 71 - 76
  • [25] Unsupervised learning is crucial to learning the names of objects
    Timothy P Lillicrap
    Blake A Richards
    Stephen H Scott
    BMC Neuroscience, 8 (Suppl 2)
  • [26] ON THE LEARNING AND FORGETTING OF PROPER NAMES
    KOSS, G
    LILI-ZEITSCHRIFT FUR LITERATURWISSENSCHAFT UND LINGUISTIK, 1987, 17 (67): : 24 - 37
  • [27] A PROCEDURE FOR LEARNING STUDENTS NAMES
    MEEHAN, AM
    TEACHING OF PSYCHOLOGY, 1990, 17 (02) : 125 - 126
  • [28] LEARNING ASSOCIATIONS CONSISTENT AND INCONSISTENT WITH REPRESENTATIVENESS HEURISTIC
    DIAMOND, SR
    CAFFERTY, TP
    PSYCHOLOGICAL REPORTS, 1976, 39 (03) : 1323 - 1326
  • [29] CALCULATION OF LEARNING-CURVES FOR INCONSISTENT ALGORITHMS
    MEIR, R
    FONTANARI, JF
    PHYSICAL REVIEW A, 1992, 45 (12): : 8874 - 8884
  • [30] LEARNING YOUR STUDENTS NAMES
    REIS, R
    EDUCATION, 1972, 93 (01): : 45 - 46