arXivDaily arXiv每日学术速递 周一至周五更新
arXiv周末暂无论文更新,休息一下吧,周末愉快~~
arXiv 2009.09279cs.SEcs.LG
收藏

自确认重构的自动分类

Toward the Automatic Classification of Self-Affirmed Refactoring

Rochester Institute of Technology(罗切斯特理工学院);ETS Montreal, University of Quebec(魁北克大学蒙特利尔工程技术学院)

Eman Abdullah AlOmar, Mohamed Wiem Mkaouer, Ali Ouni

摘要:

自我确认重构(SAR)的概念被引入来探索开发人员如何在提交消息中记录他们的重构活动,即,开发人员在代码更改期间有意引入的重构操作的显式文档。在我们之前的研究中,我们已经手动识别了重构模式,并定义了三个主要的常见质量改进类别,包括内部质量属性,外部质量属性和代码气味,只考虑重构相关的提交。然而,这种方法严重依赖于提交消息的手动检查。在本文中,我们提出了一个两步的方法,首先确定一个提交是否描述了开发人员相关的重构事件,然后根据重构常见的质量改进类别进行分类。具体来说,我们结合了N-Gram TF-IDF特征选择与二进制和多类分类器,建立一个新的模型来自动分类的重构的基础上,他们的质量改进类别。我们使用从精心设计的开源Java项目中提取的总共2,867条提交消息来挑战我们的模型。我们的研究结果表明,(1)我们的模型能够准确地分类SAR提交,优于基于模式和随机分类器的方法,并允许发现40个更相关的SAR模式,(2)即使使用相对较小的训练数据集,我们的模型也达到了高达90%的F-测量。

英文摘要:

The concept of Self-Affirmed Refactoring (SAR) was introduced to explore how developers document their refactoring activities in commit messages, i.e., developers' explicit documentation of refactoring operations intentionally introduced during a code change. In our previous study, we have manually identified refactoring patterns and defined three main common quality improvement categories, including internal quality attributes, external quality attributes, and code smells, by only considering refactoring-related commits. However, this approach heavily depends on the manual inspection of commit messages. In this paper, we propose a two-step approach to first identify whether a commit describes developer-related refactoring events, then to classify it according to the refactoring common quality improvement categories. Specifically, we combine the N-Gram TF-IDF feature selection with binary and multiclass classifiers to build a new model to automate the classification of refactorings based on their quality improvement categories. We challenge our model using a total of 2,867 commit messages extracted from well-engineered open-source Java projects. Our findings show that (1) our model is able to accurately classify SAR commits, outperforming the pattern-based and random classifier approaches, and allowing the discovery of 40 more relevant SAR patterns, and (2) our model reaches an F-measure of up to 90% even with a relatively small training dataset.

机构、总结、中文摘要均由AI分析而来,可能存在错误,请以论文正文为准。

↑