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

基于克隆的代码方法使用模式挖掘

Clone-based code method usage pattern mining

Zhipeng Xue, Yuanliang Zhang, Rulin Xu

摘要:

当程序员检索代码方法并希望重用它时,他们需要了解检索到的方法的使用模式。然而,很难获得检索到的方法的用法信息,因为该方法可能只有简短的注释和很少的可用用法示例。在本文中,我们提出了一种方法,称为LUPIN(基于克隆的使用模式muscle Ng),挖掘这些方法的使用模式,这并没有广泛出现在代码库。LUPIN的核心思想是,目标方法的克隆代码可能具有相似的使用模式,我们可以从克隆代码的使用示例中收集目标方法的更多使用信息。从放大的使用实例中,通过程序切片和代码规范化后的频繁子序列挖掘,挖掘出目标方法的使用模式。我们的评估表明,LUPIN可以挖掘四类使用模式的平均精度为0.65。

英文摘要:

When programmers retrieve a code method and want to reuse it, they need to understand the usage patterns of the retrieved method. However, it is difficult to obtain usage information of the retrieved method since this method may only have a brief comment and few available usage examples. In this paper, we propose an approach, called LUPIN (cLone-based Usage Pattern mIniNg), to mine the usage patterns of these methods, which do not widely appeared in the code repository. The key idea of LUPIN is that the cloned code of the target method may have a similar usage pattern, and we can collect more usage information of the target method from cloned code usage examples. From the amplified usage examples, we mine the usage pattern of the target method by frequent subsequence mining after program slicing and code normalization. Our evaluation shows that LUPIN can mine four categories of usage patterns with an average precision of 0.65.

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

↑