自动化变量重命名:我们到了吗?
Automated Variable Renaming: Are We There Yet?
摘要:
标识符,如方法名和变量名,构成了源代码的很大一部分。因此,低质量的标识符会严重阻碍代码的理解。为了支持开发人员使用有意义的标识符,已经提出了几种(半)自动技术,大多数是数据驱动的(例如,统计语言模型、深度学习模型)或依赖于静态代码分析。尽管如此,有限的经验调查已经执行的有效性,这些技术推荐开发人员有意义的标识符,可能导致重命名重构操作。我们提出了一个大规模的研究调查数据驱动的方法来支持自动变量重命名的潜力。我们实验了三种最先进的技术:统计语言模型和两个基于DL的模型。这三种方法已经在我们构建的三个数据集上进行了训练和测试,目的是评估它们推荐有意义的变量标识符的能力。我们的定量和定性分析表明,这种技术的潜力,在特定条件下,可以提供有价值的建议,并准备在重命名重构工具集成。尽管如此,我们的研究结果也突出了实验方法的局限性,需要在这一领域进行进一步的研究。
英文摘要:
Identifiers, such as method and variable names, form a large portion of source code. Therefore, low-quality identifiers can substantially hinder code comprehension. To support developers in using meaningful identifiers, several (semi-)automatic techniques have been proposed, mostly being data-driven (e.g. statistical language models, deep learning models) or relying on static code analysis. Still, limited empirical investigations have been performed on the effectiveness of such techniques for recommending developers with meaningful identifiers, possibly resulting in rename refactoring operations. We present a large-scale study investigating the potential of data-driven approaches to support automated variable renaming. We experiment with three state-of-the-art techniques: a statistical language model and two DL-based models. The three approaches have been trained and tested on three datasets we built with the goal of evaluating their ability to recommend meaningful variable identifiers. Our quantitative and qualitative analyses show the potential of such techniques that, under specific conditions, can provide valuable recommendations and are ready to be integrated in rename refactoring tools. Nonetheless, our results also highlight limitations of the experimented approaches that call for further research in this field.
机构、总结、中文摘要均由AI分析而来,可能存在错误,请以论文正文为准。