Recommending rename refactorings

  • Authors:
  • Andreas Thies;Christian Roth

  • Affiliations:
  • FernUniversität in Hagen, Hagen;Bayer Technology Services GmbH, Leverkusen

  • Venue:
  • Proceedings of the 2nd International Workshop on Recommendation Systems for Software Engineering
  • Year:
  • 2010

Quantified Score

Hi-index 0.00

Visualization

Abstract

Variable names play a major role in program comprehension. However, their choice is often subject to the intuition (or intention) of individual programmers: although code conventions and style guides may constrain identifier usage, programmers are individuals naming program concepts individually. Especially if different parts of a program are written by different programmers, inconsistent naming of program entities may follow. This is unfortunate, since consistent naming would aid program comprehension, in particular if references pointing to same objects used in similar ways are named equally. As a first approach, we focus on assignments to discover possible inconsistency of naming, exploiting that a variable assigned to another likely points to same objects and, if declared with the same type, is likely used for the same purpose. To explore the feasibility of our approach, we implemented a tool recommending rename refactorings to harmonize variable names based on an analysis of assignments and static type information. Evaluated on some open source projects the results seem promising enough to aim for some extensions, such as application to method names, inferred type information, and weakly type-checked languages.