paperbot · PL 论文追踪

全部论文 待读 收藏

P2 Context-Aware Name Recommendation for Field Renaming

面向字段重命名的上下文感知名称推荐
ICSE Proceedings of the IEEE/ACM 46th International Conference on Software Engineering2024匹配度 2/10 · 该论文研究Java字段重命名的名称推荐,利用动静态上下文提升IDE推荐精度,属于软件工程/重构方向。虽然涉及静态分析,但未触及用户核心关注的LLM/Agent与程序分析交叉、浮点程序分析或贝叶斯程序分析,匹配度低。引用 5 inbox
Chunhao Dong, Yanjie Jiang, Nan Niu, Yuxia Zhang, Hui Liu
crossref: 2026-09-12

AI 速览

一句话:提出 CARER,利用动静态上下文与命名惯例为 Java 字段重命名推荐新名称,大幅提升 IDE 推荐准确率。

重命名是常见软件重构,但主流 IDE 自动推荐的新名称常不正确:例如 IntelliJ IDEA 对字段重命名的推荐精确率低至 6.3%。为此,本文提出轻量级上下文感知方法 CARER,用于 Java 字段重命名的名称推荐。不同于依赖初始化器和数据类型的 IDE,CARER 同时利用重命名处的动态与静态上下文以及命名惯例。作者在开源应用中收集的 1.1K 个真实字段重命名上进行评估,结果显示精确率从 6.30% 提升至 61.15%,召回率从 6.30% 提升至 41.50%,且效率与 IntelliJ IDEA 相当,适合集成进 IDE。

问题
主流 IDE 自动推荐字段重命名新名称时准确率低,例如 IntelliJ IDEA 的推荐精确率仅 6.3%,开发者难以直接采纳。
方法
提出轻量级上下文感知方法 CARER,结合待重命名字段的动态上下文、静态上下文以及命名惯例,为 Java 字段重命名推荐新名称。
评估
在从开源应用中发现并收集的 1.1K 个真实字段重命名上进行评估,精确率由 6.30% 提升至 61.15%,召回率由 6.30% 提升至 41.50%,且效率与 IntelliJ IDEA 相当。
原文摘要(Abstract)

Renaming is one of the most popular software refactorings. Although developers may know what the new name should be when they conduct a renaming, it remains valuable for refactoring tools to recommend new names automatically so that developers can simply hit Enter and efficiently accept the recommendation to accomplish the refactoring. Consequently, most IDEs automatically recommend new names for renaming refactorings by default. However, the recommendation made by mainstream IDEs is often incorrect. For example, the precision of IntelliJ IDEA in recommending names for field renamings is as low as 6.3%. To improve the accuracy, in this paper, we propose a context-aware lightweight approach (called CARER) to recommend new names for Java field renamings. Different from mainstream IDEs that rely heavily on initializers and data types of the to-be-renamed fields, CARER exploits both dynamic and static contexts of the renamings as well as naming conventions. We evaluate CARER on 1.1K real-world field renamings discovered from open-source applications. Our evaluation results suggest that CARER can significantly improve the state of the practice in recommending new names for field renamings, improving the precision from 6.30% to 61.15%, and recall from 6.30% to 41.50%. Our evaluation results also suggest that CARER is as efficient as IntelliJ IDEA is, making it suitable to be integrated into IDEs.

链接与引用

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

BibTeX
@inproceedings{paperbot11433,
  title = {Context-Aware Name Recommendation for Field Renaming},
  author = {Chunhao Dong and Yanjie Jiang and Nan Niu and Yuxia Zhang and Hui Liu},
  booktitle = {ICSE},
  year = {2024},
  doi = {10.1145/3597503.3639195}
}