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 条
  • [1] Deep learning based identification of inconsistent method names: How far are we?
    Wang, Taiming
    Zhang, Yuxia
    Jiang, Lin
    Tang, Yi
    Li, Guangjie
    Liu, Hui
    EMPIRICAL SOFTWARE ENGINEERING, 2025, 30 (01)
  • [2] Deep learning based identification of inconsistent method names: how Far are we? ( vol 30 , 31 , 2024)
    Wang, Taiming
    Zhang, Yuxia
    Jiang, Lin
    Tang, Yi
    Li, Guangjie
    Liu, Hui
    EMPIRICAL SOFTWARE ENGINEERING, 2025, 30 (03)
  • [3] A Learning Method based on Bisimulation in Inconsistent Knowledge Systems
    Thi Hong Khanh Nguyen
    Quang-Thuy Ha
    Trong Hieu Tran
    2018 15TH INTERNATIONAL CONFERENCE ON CONTROL, AUTOMATION, ROBOTICS AND VISION (ICARCV), 2018, : 430 - 435
  • [4] Learning to Recommend Method Names with Global Context
    MoE , Key Lab of High Confidence Software Technology, Beijing, China
    不详
    Proc Int Conf Software Eng, 1600, (1294-1306):
  • [5] Learning to Recommend Method Names with Global Context
    Liu, Fang
    Li, Ge
    Fu, Zhiyi
    Lu, Shuai
    Hao, Yiyang
    Jin, Zhi
    2022 ACM/IEEE 44TH INTERNATIONAL CONFERENCE ON SOFTWARE ENGINEERING (ICSE 2022), 2022, : 1294 - 1306
  • [6] Learning to Recommend Method Names with Global Context
    Liu, Fang
    Li, Ge
    Fu, Zhiyi
    Lu, Shuai
    Hao, Yiyang
    Jin, Zhi
    arXiv, 2022,
  • [7] Detecting Inconsistent Names of Source Code Using NLP
    Lee, Sungnam
    Kim, Suntae
    Kim, JeongAh
    Park, Sooyoung
    COMPUTER APPLICATIONS FOR DATABASE, EDUCATION, AND UBIQUITOUS COMPUTING, 2012, 352 : 111 - +
  • [8] LEARNING NAMES FOR PLANTS AND PLANTS FOR NAMES
    DOUGHERTY, JWD
    ANTHROPOLOGICAL LINGUISTICS, 1979, 21 (06) : 298 - 315
  • [9] A hybrid code representation learning approach for predicting method names
    Zhang, Fengyi
    Chen, Bihuan
    Li, Rongfan
    Peng, Xin
    JOURNAL OF SYSTEMS AND SOFTWARE, 2021, 180
  • [10] Inconsistent Use of Resistance Exercise Names in Research Articles: A Brief Note
    Nuzzo, James L.
    JOURNAL OF STRENGTH AND CONDITIONING RESEARCH, 2021, 35 (12) : 3518 - 3520