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.
翻译:当程序员检索编码方法并想要再使用它时,他们需要了解检索方法的使用模式,然而,很难获得检索方法的使用情况信息,因为这种方法可能只有简短的评论和很少可用的使用实例。在本文中,我们建议采用一种称为LUPIN(基于cLone的用户使用模式mIniNg)的方法,来埋设这些方法的使用模式,这些模式没有广泛出现在代码储存库中。 LUPIN的关键想法是目标方法的克隆代码可能有类似的使用模式,我们可以从克隆代码使用实例中收集更多目标方法的使用信息。从扩大使用的例子中,我们通过在程序使用许可和代码正常化后经常的子序列采矿来清除目标方法的使用模式。我们的评估表明,LUPIN可以平均精确度为0.65,对四种类型的使用模式进行采矿。