RefBERT: A Two-Stage Pre-trained Framework for Automatic Rename Refactoring
Hao Liu, Yanlin Wang, Zhao Wei, Yong Xu, Juhong Wang, Hui Li, Rongrong Ji
摘要
Refactoring is an indispensable practice of improving the quality and maintainability of source code in software evolution. Rename refactoring is the most frequently performed refactoring that suggests a new name for an identifier to enhance readability when the identifier is poorly named. However, most existing works only identify renaming activities between two versions of source code, while few works express concern about how to suggest a new name. In this paper, we study automatic rename refactoring on variable names, which is considered more challenging than other rename refactoring activities. We first point out the connections between rename refactoring and various prevalent learning paradigms and the difference between rename refactoring and general text generation in natural language processing. Based on our observations, we propose RefBERT, a two-stage pre-trained framework for rename refactoring on variable names. RefBERT first predicts the number of sub-tokens in the new name and then generates sub-tokens accordingly. Several techniques, including constrained masked language modeling, contrastive learning, and the bag-of-tokens loss, are incorporated into RefBERT to tailor it for automatic rename refactoring on variable names. Through extensive experiments on our constructed refactoring datasets, we show that the generated variable names of RefBERT are more accurate and meaningful than those produced by the existing method. Our implementation and data are available at https://github.com/KDEGroup/RefBERT .
问 Lune
几分钟读透这篇 Paper,不用再花一下午。
Lune 能读完全文,也能读引用它的顶会 Paper,讲清它的结论、证据和局限,每一点都注明出自哪篇 Paper。不用硬啃,也不靠猜。
已有 1 篇顶会 Paper 引用了它。别等审稿人问起,先弄清它们发现了什么。
脉络
- EALink: An Efficient and Accurate Pre-Trained Framework for Issue-Commit Link Recovery 引用了 CodeBERT: A Pre-Trained Model for Programming and Natural Languages
- EALink: An Efficient and Accurate Pre-Trained Framework for Issue-Commit Link Recovery 引用了 GraphCodeBERT: Pre-training Code Representations with Data Flow
- EALink: An Efficient and Accurate Pre-Trained Framework for Issue-Commit Link Recovery 引用了 SPT-Code: Sequence-to-Sequence Pre-Training for Learning Source Code Representations
- EALink: An Efficient and Accurate Pre-Trained Framework for Issue-Commit Link Recovery 引用了 UniXcoder: Unified Cross-Modal Pre-training for Code Representation
- EALink: An Efficient and Accurate Pre-Trained Framework for Issue-Commit Link Recovery 引用了 Studying the Usage of Text-To-Text Transfer Transformer to Support Code-Related Tasks
- SPT-Code: Sequence-to-Sequence Pre-Training for Learning Source Code Representations 引用了 CodeBERT: A Pre-Trained Model for Programming and Natural Languages
- SPT-Code: Sequence-to-Sequence Pre-Training for Learning Source Code Representations 引用了 GraphCodeBERT: Pre-training Code Representations with Data Flow
- SPT-Code: Sequence-to-Sequence Pre-Training for Learning Source Code Representations 引用了 Studying the Usage of Text-To-Text Transfer Transformer to Support Code-Related Tasks
- UniXcoder: Unified Cross-Modal Pre-training for Code Representation 引用了 CodeBERT: A Pre-Trained Model for Programming and Natural Languages
- UniXcoder: Unified Cross-Modal Pre-training for Code Representation 引用了 GraphCodeBERT: Pre-training Code Representations with Data Flow
引用它的顶会 Paper1
它引用的 Paper5
- CodeBERT: A Pre-Trained Model for Programming and Natural LanguagesZhangyin Feng, Daya Guo, Duyu Tang, Nan Duan 等EMNLP Findings 2020 · 2,828 次引用
- GraphCodeBERT: Pre-training Code Representations with Data FlowDaya Guo, Shuo Ren, Shuai Lu, Zhangyin Feng 等ICLR 2021 · 1,644 次引用
- SPT-Code: Sequence-to-Sequence Pre-Training for Learning Source Code RepresentationsChangan Niu, Chuanyi Li, Vincent Ng, Jidong Ge 等ICSE 2022 · 99 次引用
- Studying the Usage of Text-To-Text Transfer Transformer to Support Code-Related TasksAntonio Mastropaolo, Simone Scalabrino, Nathan Cooper, David Nader-Palacio 等ICSE 2021 · 9 次引用
- UniXcoder: Unified Cross-Modal Pre-training for Code RepresentationDaya Guo, Shuai Lu, Nan Duan, Yanlin Wang 等ACL 2022
相关 Paper
- ContraBERT: Enhancing Code Pre-trained Models via Contrastive LearningShangqing Liu, Bozhi Wu, Xiaofei Xie, Guozhu Meng 等ICSE 2023 · 56 次引用
- "Len or index or count, anything but v1": Predicting Variable Names in Decompilation Output with Transfer LearningKuntal Kumar Pal, Ati Priya Bajaj, Pratyay Banerjee, Audrey Dutcher 等S&P 2024 · 30 次引用
- Program merge conflict resolution via neural transformersAlexey Svyatkovskiy, Sarah Fakhoury, Negar Ghorbani, Todd Mytkowicz 等FSE 2022 · 33 次引用
- VarCLR: Variable Semantic Representation Pre-training via Contrastive LearningQibin Chen, Jeremy Lacomis, Edward J. Schwartz, Graham Neubig 等ICSE 2022 · 23 次引用
- Context-Aware Name Recommendation for Field RenamingChunhao Dong, Yanjie Jiang, Nan Niu, Yuxia Zhang 等ICSE 2024 · 4 次引用
