Title :
Identifying Renaming Opportunities by Expanding Conducted Rename Refactorings
Author :
Liu, Hui ; Liu, Qiurong ; Liu, Yang ; Wang, Zhouding
Author_Institution :
School of Computer Science and Technology, Beijing Institute of Technology, Beijing, China
Abstract :
To facilitate software refactoring, a number of approaches and tools have been proposed to suggest where refactorings should be conducted. However, identification of such refactoring opportunities is usually difficult because it often involves difficult semantic analysis and it is often influenced by many factors besides source code. For example, whether a software entity should be renamed depends on the meaning of its original name (natural language understanding), the semantics of the entity (source code semantics), experience and preference of developers, and culture of companies. As a result, it is difficult to identify renaming opportunities. To this end, in this paper we propose an approach to identify renaming opportunities by expanding conducted renamings. Once a rename refactoring is conducted manually or with tool support, the proposed approach recommends to rename closely related software entities whose names are similar to that of the renamed entity. The rationale is that if an engineer makes a mistake in naming a software entity it is likely for her to make the same mistake in naming similar and closely related software entities. The main advantage of the proposed approach is that it does not involve difficult semantic analysis of source code or complex natural language understanding. Another advantage of this approach is that it is less influenced by subjective factors, e.g., experience and preference of software engineers. The proposed approach has been evaluated on four open-source applications. Our evaluation results show that the proposed approach is accurate in recommending entities to be renamed (average precision 82 percent) and in recommending new names for such entities (average precision 93 percent). Evaluation results also suggest that a substantial percentage (varying from 20 to 23 percent) of rename refactorings are expansible.
Keywords :
Context; Engines; IEEE Potentials; Natural languages; Open source software; Semantics; Code Smells; Identification; Refactoring Opportunity; Rename; Software Refactoring; Software refactoring; code smells; identification; refactoring opportunity; rename;
Journal_Title :
Software Engineering, IEEE Transactions on
DOI :
10.1109/TSE.2015.2427831