paperbot · PL 论文追踪

全部论文 待读 收藏

P2 Learning to Spot and Refactor Inconsistent Method Names

学习发现并重构不一致的方法名
ICSE 2019 IEEE/ACM 41st International Conference on Software Engineering (ICSE)2019匹配度 2/10 · 论文属于机器学习与程序语言交叉,但主题是方法名一致性检测与重命名,未涉及静态分析在机器学习系统或 Agentic 程序中的应用,也未利用 LLM/Agent 改进静态分析/形式化验证,且与浮点程序分析、贝叶斯程序分析无关。引用 126 inbox
Kui Liu, Dongsun Kim, Tegawende F. Bissyande, Taeyoung Kim, Kisub Kim, Anil Koyuncu, Suntae Kim, Yves Le Traon
crossref: 2026-09-12dblp: 2026-09-12

AI 速览

一句话:提出基于方法名与代码一致性的深度特征方法,自动检测不一致方法名并建议重命名,显著优于现有方法。

方法名必须与实现保持一致,才能保证代码可读性与可维护性。现有方法名调试技术主要分析大规模数据中名称的共现模式,而未分析方法实现代码本身来评估一致性。本文提出一种自动化方法名调试方法,针对方法名和方法代码各自的特点,采用深度特征表示技术,分析名称与代码之间的一致性。在超过210万个Java方法上的实验表明,该方法在识别不一致方法名上达到67.9%的F1值,比当前最优方法提升最多15个百分点;在建议完整方法名方面准确率最高达25%,而当前最优方法仅为1.1%。最后,在真实项目开展的实地研究中,该方法成功修复了66个不一致方法名。

问题
现有方法名一致性检测方法未分析方法实现代码本身,难以准确判断方法名与实现是否一致,也难以为不一致名称推荐合适的新名称。
方法
提出基于深度特征表示的方法名与代码一致性分析方法,分别适配方法名和代码片段的特性,自动检测不一致方法名并建议更合适的完整名称。
评估
在超过210万个Java方法上评估,检测不一致方法名的F1达67.9%,较最优方法提升最多15个百分点;建议完整名称准确率达25%;并在真实项目实地研究中成功修复66个不一致方法名。
原文摘要(Abstract)

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.

链接与引用

DOI 原文 · PDF(开放获取) · DBLP

BibTeX
@inproceedings{Liu0BKKKKT19,
  title = {Learning to Spot and Refactor Inconsistent Method Names},
  author = {Kui Liu and Dongsun Kim and Tegawende F. Bissyande and Taeyoung Kim and Kisub Kim and Anil Koyuncu and Suntae Kim and Yves Le Traon},
  booktitle = {ICSE},
  year = {2019},
  doi = {10.1109/icse.2019.00019}
}