arXivDaily arXiv每日学术速递 周一至周五更新
感恩节,周五至周末无更新,大家顺遂。周一再来吧
arXiv 2112.01581cs.SE
收藏

关于重构类型的文档

On the Documentation of Refactoring Types

Eman Abdullah AlOmar, Jiaqian Liu, Kenneth Addo, Mohamed Wiem Mkaouer, Christian Newman, Ali Ouni, Zhe Yu

摘要:

提交消息是软件文档的原子级。它们提供代码更改及其目的的自然语言描述。消息对于软件维护和程序理解是至关重要的。与记录功能更新和错误修复不同,开发人员如何记录他们的重构活动知之甚少。开发人员可以出于各种原因执行多个重构操作,包括移动方法、提取类。然而,没有系统的研究,分析在何种程度上重构的文档准确地描述了重构操作在源代码级别执行。因此,本文挑战重构文档的能力,充分预测重构类型,在提交级别执行。我们的分析依赖于提交消息的文本挖掘来提取更好地代表每个类的相应特征。提取特定于每个重构的文本模式允许设计一个模型,该模型验证这些模式与其相应重构的一致性。这样的验证过程可以通过自动预测所应用的重构的方法级别类型来实现,即提取方法、内联方法、移动方法、上拉方法、下推方法和嵌入方法。我们使用5,004个提交的数据集,比较了各种分类器和基于关键字的基线方法的预测性能。我们的主要发现表明,重构类型预测的复杂性因类型而异。研究发现,重构方法和提取方法是记录最好的重构活动,而上拉方法和下推方法是最难通过文本描述来识别的。这些发现使开发人员注意到更加关注这些类型的文档的必要性。

英文摘要:

Commit messages are the atomic level of software documentation. They provide a natural language description of the code change and its purpose. Messages are critical for software maintenance and program comprehension. Unlike documenting feature updates and bug fixes, little is known about how developers document their refactoring activities. Developers can perform multiple refactoring operations, including moving methods, extracting classes, for various reasons. Yet, there is no systematic study that analyzes the extent to which the documentation of refactoring accurately describes the refactoring operations performed at the source code level. Therefore, this paper challenges the ability of refactoring documentation to adequately predict the refactoring types, performed at the commit level. Our analysis relies on the text mining of commit messages to extract the corresponding features that better represent each class. The extraction of text patterns, specific to each refactoring allows the design of a model that verifies the consistency of these patterns with their corresponding refactoring. Such verification process can be achieved via automatically predicting the method-level type of refactoring being applied, namely Extract Method, Inline Method, Move Method, Pull-up Method, Push-down Method, and Rename Method. We compared various classifiers, and a baseline keyword-based approach, in terms of their prediction performance, using a dataset of 5,004 commits. Our main findings show that the complexity of refactoring type prediction varies from one type to another. Rename method and Extract method were found to be the best documented refactoring activities, while Pull-up Method and Push-down Method were the hardest to be identified via textual descriptions. Such findings bring the attention of developers to the necessity of paying more attention to the documentation of these types.

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

↑