Recommending Variable Names for Extract Local Variable Refactorings
Taiming Wang, Hui Liu, Yuxia Zhang, Yanjie Jiang

TL;DR
VarNamer is an automated tool that improves variable name recommendations for extract local variable refactorings, significantly outperforming existing IDE suggestions and speeding up the refactoring process.
Contribution
This paper introduces VarNamer, a novel approach combining static analysis and data mining to enhance variable name recommendations, with successful integration into Eclipse and demonstrated effectiveness across languages.
Findings
VarNamer increases exact match rate by 52.6% over Eclipse.
It improves refactoring speed by 27.8%.
It reduces renaming edits by 49.3%.
Abstract
Extract local variable is one of the most popular refactorings, and most IDEs and refactoring tools provide automated support for this refactoring. However, we find approximately 70% of the names recommended by these IDEs are different from what developers manually constructed, adding additional renaming burdens to developers and providing limited assistance. In this paper, we introduce VarNamer, an automated approach designed to recommend variable names for extract local variable refactorings. Through a large-scale empirical study, we identify key contexts that are useful for composing variable names. Leveraging these insights, we developed a set of heuristic rules through program static analysis techniques and employ data mining techniques to recommend variable names effectively. Notably, some of our heuristic rules have been successfully integrated into Eclipse, where they are now…
Peer Reviews
No public reviews on file for this paper yet. If you reviewed it on a platform where reviews are public (OpenReview, ICLR, NeurIPS, ICML), you can paste yours below so the community can read it here.
Videos
No videos yet. Explain this paper in a talk, walkthrough, or lecture? Add one.
