Background: The renaming of program identifiers is the most common refactoring operation. Because some identifiers are related to each other, developers may need to rename related identifiers together. Aims: To understand how developers rename multiple identifiers simultaneously, it is necessary to consider the relationships between identifiers in the program and the brief matching for non-identical but semantically similar identifiers. Method: We investigate the relationships between co-renamed identifiers and identify the types of their relationships that contribute to improving the recommendation using more than 1M of renaming instances collected from the histories of open-source software projects. We also evaluate and compare the impact of co-renaming and the relationships between identifiers when inflections occur in the words in identifiers are taken into account. Results: We revealed several relationships of identifiers that are frequently found in the co-renamed identifiers, such as the identifiers of methods in the same class or an identifier defining a variable and another used for initializing the variable, depending on the type of the renamed identifiers. Additionally, the consideration of inflections did not affect the tendency of the relationships. Conclusion: These results suggest an approach that prioritizes the identifiers to be recommended depending on their types and the type of the renamed identifier.
翻译:程序标识符的重新命名是最常见的重构要素操作。 由于某些标识符彼此相关, 开发者可能需要将相关标识符重新命名。 目标 : 要理解开发者如何同时重新命名多个标识符, 有必要考虑程序中识别符与非同义但语义类似的标识符的简短匹配之间的关系。 方法 : 我们调查共同重命名标识符之间的关系, 并查明其关系类型, 从而帮助改进建议, 使用从开放源软件项目历史中收集的1M以上重命名实例来改进建议。 我们还评估和比较共同重命名的影响, 以及当识别符中的单词出现时识别符之间的关系。 结果: 我们揭示了在共同重命名的标识符中经常发现的若干标识符关系, 如同一类别中的方法识别符或界定变量的标识符, 以及用于初始变量的另一种类型, 取决于重新命名的标识符的类型。 此外, 考虑重命名的识别符并没有影响其排序方法的优先顺序, 。 这些结论: 我们揭示了在共同重命名的标识符类型中经常发现的一些识别符的关系, 如同一类别中的方法标识符或确定变量的变量定义, 。