Lune

ICSE2022顶会

Learning to Recommend Method Names with Global Context

Fang Liu, Ge Li, Zhiyi Fu, Shuai Lu, Yiyang Hao, Zhi Jin

摘要

In programming, the names for the program entities, especially for the methods, are the intuitive characteristic for understanding the functionality of the code. To ensure the readability and maintainability of the programs, method names should be named properly. Specifically, the names should be meaningful and consistent with other names used in related contexts in their codebase. In recent years, many automated approaches are proposed to suggest consistent names for methods, among which neural machine translation (NMT) based models are widely used and have achieved state-of-the-art results. However, these NMT-based models mainly focus on extracting the code-specific features from the method body or the surrounding methods, the project-specific context and documentation of the target method are ignored. We conduct a statistical analysis to explore the relationship between the method names and their contexts. Based on the statistical results, we propose GTNM, a Global Transformer-based Neural Model for method name suggestion, which considers the local context, the project-specific context, and the documentation of the method simultaneously. Experimental results on java methods show that our model can outperform the state-of-the-art results by a large margin on method name suggestion, demonstrating the effectiveness of our proposed model.

问 Lune

几分钟读透这篇 Paper,不用再花一下午。

Lune 能读完全文,也能读引用它的顶会 Paper,讲清它的结论、证据和局限,每一点都注明出自哪篇 Paper。不用硬啃,也不靠猜。

已有 4 篇顶会 Paper 引用了它。别等审稿人问起,先弄清它们发现了什么。

可以从这些问题问起

Lune 可以查阅

全文 · 引用它的顶会 Paper · 相关的 Paper

获取答案

免费开始,无需绑卡

脉络

  • Two Sides of the Same Coin: Exploiting the Impact of Identifiers in Neural Code Comprehension 引用了 Suggesting natural method names to check name consistencies
  • Two Sides of the Same Coin: Exploiting the Impact of Identifiers in Neural Code Comprehension 引用了 Integrating Tree Path in Transformer for Code Representation
  • Two Sides of the Same Coin: Exploiting the Impact of Identifiers in Neural Code Comprehension 引用了 Multi-task Learning based Pre-trained Language Model for Code Completion
  • Context-Aware Name Recommendation for Field Renaming 引用了 Multi-task Learning based Pre-trained Language Model for Code Completion
它引用的引用它的从左到右按年份排列,引用越多,位置越高。

引用它的顶会 Paper4

  1. RepoCoder: Repository-Level Code Completion Through Iterative Retrieval and GenerationFengji Zhang, Bei Chen, Yue Zhang, Jacky Keung 等EMNLP 2023 · 110 次引用
  2. Two Sides of the Same Coin: Exploiting the Impact of Identifiers in Neural Code ComprehensionShuzheng Gao, Cuiyun Gao, Chaozheng Wang, Jun Sun 等ICSE 2023 · 17 次引用
  3. Context-Aware Name Recommendation for Field RenamingChunhao Dong, Yanjie Jiang, Nan Niu, Yuxia Zhang 等ICSE 2024 · 4 次引用
  4. Coverage-Based Harmfulness Testing for LLM Code TransformationHonghao Tan, Haibo Wang, Diany Pressato, Yisen Xu 等ASE 2025 · 2 次引用

它引用的 Paper7

  1. Multi-task Learning based Pre-trained Language Model for Code CompletionFang Liu, Ge Li, Yunfei Zhao, Zhi JinASE 2020 · 162 次引用
  2. Big code != big vocabulary: open-vocabulary models for source codeRafael-Michael Karampatsis, Hlib Babii, Romain Robbes, Charles Sutton 等ICSE 2020 · 140 次引用
  3. Towards characterizing adversarial defects of deep learning software from the lens of uncertaintyXiyue Zhang, Xiaofei Xie, Lei Ma, Xiaoning Du 等ICSE 2020 · 69 次引用
  4. Suggesting natural method names to check name consistenciesSon Nguyen, Hung Phan, Trinh Le, Tien N. NguyenICSE 2020 · 64 次引用
  5. Integrating Tree Path in Transformer for Code RepresentationHan Peng, Ge Li, Wenhan Wang, Yunfei Zhao 等NeurIPS 2021 · 56 次引用

相关 Paper

  1. LLM-Based Method Name Suggestion with Automatically Generated Context-Rich PromptsWaseem Akram, Yanjie Jiang, Yuxia Zhang, Haris Ali Khan 等FSE 2025 · 1 次引用
  2. A Context-based Automated Approach for Method Name Consistency Checking and SuggestionYi Li, Shaohua Wang, Tien N. NguyenICSE 2021 · 36 次引用
  3. Lightweight global and local contexts guided method name recommendation with prior knowledgeShangwen Wang, Ming Wen, Bo Lin, Xiaoguang MaoFSE 2021 · 38 次引用
  4. AutoTransform: Automated Code Transformation to Support Modern Code Review ProcessPatanamon Thongtanunam, Chanathip Pornprasit, Chakkrit TantithamthavornICSE 2022 · 57 次引用
  5. Learning to find naming issues with big code and small supervisionJingxuan He, Cheng-Chun Lee, Veselin Raychev, Martin T. VechevPLDI 2021 · 9 次引用
黄昏的海面,两侧是细线勾勒的悬崖