Semantic clone detection is the process of finding program elements with similar or equal runtime behavior. For example, detecting the semantic equality between the recursive and iterative implementation of the factorial computation. Semantic clone detection is the de facto technical boundary of clone detectors. In recent years, this boundary has been tested using interesting new approaches. This article contributes a semantic clone detection approach that detects clones that have 0% syntactic similarity. We present Semantic Clone Detection via Probabilistic Software Modeling (SCD-PSM) as a stable and precise solution to semantic clone detection. PSM builds a probabilistic model of a program that is capable of evaluating and generating runtime data. SCD-PSM leverages this model and its model elements for finding behaviorally equal model elements. This behavioral equality is then generalized to semantic equality of the original program elements. It uses the likelihood between model elements as a distance metric. Then, it employs the likelihood ratio significance test to decide whether this distance is significant, given a pre-specified and controllable false-positive rate. The output of SCD-PSM are pairs of program elements (i.e., methods), their distance, and a decision on whether they are clones or not. SCD-PSM yields excellent results with a Matthews Correlation Coefficient greater than 0.9. These results are obtained on classical semantic clone detection problems such as detecting recursive and iterative versions of an algorithm, but also on complex problems used in coding competitions.
翻译:语义克隆检测是找到具有类似或相同运行时间行为的程序元素的过程。 例如, 检测递归和迭代执行元素计算之间的语义平等。 语义克隆检测是克隆探测器的实际技术界限。 近几年来, 此边界是使用有趣的新方法测试的。 此条提供了一种语义克隆检测方法, 检测具有0%同步性相似性的克隆克隆人。 我们通过概率软件建模( SCD- PSM) 发现语义克隆检测, 作为一种稳定而精确的语义克隆检测方法。 PSM 构建了一个能够评估和生成运行时间数据的程序的概率模型。 SCD- PSM 利用了这个模型及其模型元素的模型元素来寻找行为上等同的模式元素。 这样的行为平等就被概括到原始程序元素的语义平等性。 我们用模型元素之间的可能性作为远程测量。 然后, 我们用概率比比值测试来决定这种距离是否重要, 以预指定和可控的语义克隆探测率率率计算率率率计算。 SCD- PSM 的输出是SLio- rodeal rodeal roal rouption roup, 的结果是比 。 。 Speal 。 Special 。 Special 。 Speal 。 Speal 。 Special 。 Special 和 的 。 Speal 的结果是, 。