Deep learning based identification of inconsistent method names: How far are we?

被引:1
|
作者
Wang, Taiming [1 ]
Zhang, Yuxia [1 ]
Jiang, Lin [2 ]
Tang, Yi [3 ]
Li, Guangjie [3 ]
Liu, Hui [1 ]
机构
[1] Beijing Inst Technol, Sch Comp Sci & Technol, Beijing, Peoples R China
[2] China Telecom Corp Ltd Beijing Res Inst, Beijing, Peoples R China
[3] Acad Mil Sci Peoples Liberat Army, Natl Innovat Inst Def Technol, Beijing, Peoples R China
基金
中国国家自然科学基金;
关键词
Method names; Neural networks; Inconsistency checking; Empirical study; LINGUISTIC ANTIPATTERNS; CONCISE;
D O I
10.1007/s10664-024-10592-z
中图分类号
TP31 [计算机软件];
学科分类号
081202 ; 0835 ;
摘要
For any software system, concise and meaningful method names are critical for program comprehension and maintenance. However, for various reasons, the method names might be inconsistent with their corresponding implementations. Such inconsistent method names are confusing and misleading, often resulting in incorrect method invocations. To this end, a few intelligent deep learning-based approaches based on neural networks have been proposed to identify such inconsistent method names in the industry. Existing evaluations suggest that the performance of such DL-based approaches is promising. However, the evaluations are conducted with a perfectly balanced dataset where the number of inconsistent method names is exactly equivalent to that of consistent ones. In addition, the construction method of this balanced dataset is flawed, leading to false positives in this dataset. Consequently, the reported performance may not represent their efficiency in the field where most method names are consistent with their corresponding method bodies and only a small part of method names are inconsistent with corresponding method bodies. To this end, in this paper, we conduct an empirical study to assess the state-of-the-art DL-based approaches in the automated identification of inconsistent method names. We first build a new benchmark (dataset) by using both automatic identification from commit history and manual inspection by developers, aiming to reduce the number of false positives. Based on the benchmark, we evaluate five representative DL-based approaches to identifying inconsistent method names (one is retrieval-based and two are generation-based). Our evaluation results suggest that the performance of the evaluated approaches is substantially reduced when we switch from the existing balanced dataset to our new benchmark. Furthermore, to reveal where and why the evaluated approaches work/fail, we conduct quantitative and qualitative analyses of the evaluation results. Our analysis results suggest that the evaluated approaches work well on methods with simple bodies and short names, and retrieval-based approaches are especially good at methods whose names start with popular first sub-tokens. Retrieval-based approaches fail frequently because the adopted method representation technique is not efficient enough. Another possible reason for the failures is their unverified rationale, i.e., two methods with similar bodies should have similar names. Generation-based approaches frequently fail because of inaccurate similarity calculation formulas and immature method name generation techniques. Through the data analysis, we also propose two possible ways for better identifying inconsistent method names by leveraging contrastive learning and LLMs. Overall, our empirical study suggests that the state-of-the-art DL-based approaches in inconsistent method name identification deserve significant improvement before applying them to practical software systems.
引用
收藏
页数:44
相关论文
共 50 条
  • [1] 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)
  • [2] Machine Learning Based Recommendation of Method Names: How Far Are We
    Jiang, Lin
    Liu, Hui
    Jiang, He
    34TH IEEE/ACM INTERNATIONAL CONFERENCE ON AUTOMATED SOFTWARE ENGINEERING (ASE 2019), 2019, : 614 - 626
  • [3] Log-based Anomaly Detection with Deep Learning: How Far Are We?
    Le, Van-Hoang
    Zhang, Hongyu
    2022 ACM/IEEE 44TH INTERNATIONAL CONFERENCE ON SOFTWARE ENGINEERING (ICSE 2022), 2022, : 1356 - 1367
  • [4] Learning to Spot and Refactor Inconsistent Method Names
    Liu, Kui
    Kim, Dongsun
    Bissyande, Tegawende F.
    Kim, Taeyoung
    Kim, Kisub
    Koyuncu, Anil
    Kim, Suntae
    Le Traon, Yves
    2019 IEEE/ACM 41ST INTERNATIONAL CONFERENCE ON SOFTWARE ENGINEERING (ICSE 2019), 2019, : 1 - 12
  • [5] Moving deep learning into web browser: How far can we go?
    Key Lab of High-Confidence Software Technology, MoE , Beijing, China
    不详
    arXiv, 1600,
  • [6] Moving Deep Learning into Web Browser: How Far Can We Go?
    Ma, Yun
    Xiang, Dongwei
    Zheng, Shuyu
    Tian, Deyu
    Liu, Xuanzhe
    WEB CONFERENCE 2019: PROCEEDINGS OF THE WORLD WIDE WEB CONFERENCE (WWW 2019), 2019, : 1234 - 1244
  • [7] Biologically plausible deep learning - But how far can we go with shallow networks?
    Illing, Bernd
    Gerstner, Wulfram
    Brea, Johanni
    NEURAL NETWORKS, 2019, 118 : 90 - 101
  • [8] Lightning Identification Method Based on Deep Learning
    Qian, Zheng
    Wang, Dongdong
    Shi, Xiangbo
    Yao, Jinliang
    Hu, Lijun
    Yang, Hao
    Ni, Yongsen
    ATMOSPHERE, 2022, 13 (12)
  • [9] Fingerprint identification: how far have we come?
    Lennard, Chris
    AUSTRALIAN JOURNAL OF FORENSIC SCIENCES, 2013, 45 (04) : 356 - 367
  • [10] Conversational recommendation based on end-to-end learning: How far are we?
    Manzoor, Ahtsham
    Jannach, Dietmar
    COMPUTERS IN HUMAN BEHAVIOR REPORTS, 2021, 4