arXivDaily arXiv每日学术速递 周一至周五更新
arXiv 2108.11011cs.SE
收藏

基于预测方法名可信度的推荐抽取方法重构

Recommending Extract Method Refactoring Based on Confidence of Predicted Method Name

Jinto Yamanaka, Yasuhiro Hayase, Toshiyuki Amagasa

摘要:

重构是软件开发中经常执行的一项重要活动,其中提取方法被认为是最频繁执行的重构之一。用于推荐提取方法重构的现有技术从源方法和要提取的代码片段计算度量,以对推荐候选者进行排序。本文提出了一种新的技术,通过考虑代码片段是否是语义一致的块,可以给出明确的方法名称,除了在以前的研究中使用的指标,准确地推荐提取方法重构。作为语义一致性的标准,所提出的技术采用code2seq输出的代码片段的预测方法名称的概率(即置信度),这是一种最先进的方法名称预测技术。实验结果表明,该方法比现有方法具有更高的推荐正确率。

英文摘要:

Refactoring is an important activity that is frequently performed in software development, and among them, Extract Method is known to be one of the most frequently performed refactorings. The existing techniques for recommending Extract Method refactoring calculate metrics from the source method and the code fragments to be extracted to order the recommendation candidates. This paper proposes a new technique for accurately recommending Extract Method refactoring by considering whether code fragments are semantically coherent chunks that can be given clear method names, in addition to the metrics used in previous studies. As a criterion for the semantic coherency, the proposed technique employs the probability (i.e. confidence) of the predicted method names for the code fragments output by code2seq, which is a state-of-the-art method name prediction technique. The evaluation experiment confirmed that the proposed technique has higher correctness of recommendation than the existing techniques.

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

↑