大型软件系统中的代码复制和修改现象可能导致程序缺陷的扩大以及无用代码的存在,克隆代码检测分析则有助于抽取可复用的软件组件和模式,在软件重构和软件演化中起重要的作用。在给出了一种基于子图同构进行克隆代码检测的方法基础上,加入依赖边类型约束求近似解的算法,以改善算法的时间复杂性。
A code duplication in a large software system resulted in error extending and some dead codes. The analysis of clone code was helpful to extract reused software components and patterns. So it played an important role in software restructuring and evolving. An algorithm for the clone code detection was pres- ented based on the subgraph isomorphism. Constraints of dependent edge types were used in the approxi- mate solution method to improve the time complexity of the algorithm.