Context-Aware Name Recommendation for Field Renaming

Chunhao Dong*, Yanjie Jiang*, Nan Niu, Yuxia Zhang, Hui Liu*

*此作品的通讯作者

科研成果: 书/报告/会议事项章节会议稿件同行评审

摘要

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.

源语言英语
主期刊名Proceedings - 2024 ACM/IEEE 44th International Conference on Software Engineering, ICSE 2024
出版商IEEE Computer Society
2905-2917
页数13
ISBN(电子版)9798400702174
DOI
出版状态已出版 - 2024
活动44th ACM/IEEE International Conference on Software Engineering, ICSE 2024 - Lisbon, 葡萄牙
期限: 14 4月 202420 4月 2024

出版系列

姓名Proceedings - International Conference on Software Engineering
ISSN(印刷版)0270-5257

会议

会议44th ACM/IEEE International Conference on Software Engineering, ICSE 2024
国家/地区葡萄牙
Lisbon
时期14/04/2420/04/24

指纹

探究 'Context-Aware Name Recommendation for Field Renaming' 的科研主题。它们共同构成独一无二的指纹。

引用此