Code relatives: detecting similarly behaving software

Code relatives: detecting similarly behaving software
复制标题

DOI:
10.1145/2950290.2950321
复制
发表时间:
2016-11
期刊:
Proceedings of the 2016 24th ACM SIGSOFT International Symposium on Foundations of Software Engineering
影响因子:
--
通讯作者:
Fang-Hsiang Su;Jonathan Bell;Kenneth Harvey;S. Sethumadhavan;G. Kaiser;Tony Jebara
Fang-Hsiang Su;Jonathan Bell;Kenneth Harvey;S. Sethumadhavan;G. Kaiser;Tony Jebara
中科院分区:
其他
文献类型:
--
作者:
Fang-Hsiang Su;Jonathan Bell;Kenneth Harvey;S. Sethumadhavan;G. Kaiser;Tony Jebara

文献摘要

被引文献

相似文献

检测“相似代码”对于许多软件工程任务都很有用。当前的工具可以帮助检测具有静态相似语法和/或语义特征(代码克隆)和动态相似功能输入/输出(simions)的代码。不幸的是,一些在执行跟踪的更细粒度上表现类似的代码片段可能会被忽略。在本文中,我们提出了“代码相关”这个术语来指代具有相似执行行为的代码。我们定义代码相关性,然后提出Dyplink K,我们的方法来检测代码相关性内和跨代码库。Dyplink K记录示例执行的执行级跟踪,将跟踪组织成执行级动态依赖图,并采用我们专门的子图匹配算法来有效地比较候选代码相关的执行。在我们的实验中,Dyplink仅在43分钟内就分析了4.22亿多个前瞻性子图匹配。我们比较了Dyspool K与社区中的一个静态代码克隆检测器以及我们实现的动态simion检测器。结果表明,Dyspoken K可以在合理的分析时间内有效地检测代码相关项。
Detecting “similar code” is useful for many software engineering tasks. Current tools can help detect code with statically similar syntactic and–or semantic features (code clones) and with dynamically similar functional input/output (simions). Unfortunately, some code fragments that behave similarly at the finer granularity of their execution traces may be ignored. In this paper, we propose the term “code relatives” to refer to code with similar execution behavior. We define code relatives and then present DyCLINK, our approach to detecting code relatives within and across codebases. DyCLINK records instruction-level traces from sample executions, organizes the traces into instruction-level dynamic dependence graphs, and employs our specialized subgraph matching algorithm to efficiently compare the executions of candidate code relatives. In our experiments, DyCLINK analyzed 422+ million prospective subgraph matches in only 43 minutes. We compared DyCLINK to one static code clone detector from the community and to our implementation of a dynamic simion detector. The results show that DyCLINK effectively detects code relatives with a reasonable analysis time.