The traditional similar code detection approaches are limited in detecting semantically similar codes, impeding their applications in practice. In this paper, we have improved the traditional metrics-based approach as...The traditional similar code detection approaches are limited in detecting semantically similar codes, impeding their applications in practice. In this paper, we have improved the traditional metrics-based approach as well as the graph- based approach and presented a metrics-based and graph- based combined approach. First, source codes are represented as augmented system dependence graphs. Then, metrics- based candidate similar code extraction is performed to filter out most of the dissimilar code pairs so as to lower the computational complexity. After that, code normalization is performed on the candidate similar codes to remove code variations so as to detect similar code at the semantic level. Finally, program matching is performed on the normalized control dependence trees to output semantically similar codes. Experiment results show that our approach can detect similar codes with code variations, and it can be applied to large software.展开更多
Aiming at the problem of reverse-design of mechanism, a method based on the matching of trajectory code-chains is presented. The motion trajectory of mechanism is described with code-chain, which is normalized to simp...Aiming at the problem of reverse-design of mechanism, a method based on the matching of trajectory code-chains is presented. The motion trajectory of mechanism is described with code-chain, which is normalized to simplify the operation of geometric transformation. The geometric transforma-tion formulas of scale, mirror and rotation for trajectory code-chain are defined, and the reverse de-sign for mechanism trajectory is realized through the analysis and solution of similarity matching between the desired trajectory and the predefined trajectory. The algorithm program and prototype system of reverse design for mechanism trajectory are developed. Application samples show that the method can break the restriction of trajectory patterns in matching, meet the demand of partial match-ing, and overcome the influence of geometric transformation of trajectory on the reverse design for mechanism.展开更多
基金Acknowledgements This work was supported by the National Natural Science Foundation of China (Grant Nos. 61202092 and 61173021), the Research Fund for the Doctoral Program of Higher Education of China (20112302120052), Research Fund for the Innovative Scholars of Harbin (RC2013QN010001), and Young Colleger Academic Backbone Project of Heilongjiang.
文摘The traditional similar code detection approaches are limited in detecting semantically similar codes, impeding their applications in practice. In this paper, we have improved the traditional metrics-based approach as well as the graph- based approach and presented a metrics-based and graph- based combined approach. First, source codes are represented as augmented system dependence graphs. Then, metrics- based candidate similar code extraction is performed to filter out most of the dissimilar code pairs so as to lower the computational complexity. After that, code normalization is performed on the candidate similar codes to remove code variations so as to detect similar code at the semantic level. Finally, program matching is performed on the normalized control dependence trees to output semantically similar codes. Experiment results show that our approach can detect similar codes with code variations, and it can be applied to large software.
基金This project is supported by National Hi-tech Research and Development Program of China (863 Program, No. 2006AA04Z114)Research Fund for the Doctoral Program of Higher Education, China (No. 20040335060)Provincial Scientific Personnel Educational Foundation of Zhejiang, China (No. R603240).
文摘Aiming at the problem of reverse-design of mechanism, a method based on the matching of trajectory code-chains is presented. The motion trajectory of mechanism is described with code-chain, which is normalized to simplify the operation of geometric transformation. The geometric transforma-tion formulas of scale, mirror and rotation for trajectory code-chain are defined, and the reverse de-sign for mechanism trajectory is realized through the analysis and solution of similarity matching between the desired trajectory and the predefined trajectory. The algorithm program and prototype system of reverse design for mechanism trajectory are developed. Application samples show that the method can break the restriction of trajectory patterns in matching, meet the demand of partial match-ing, and overcome the influence of geometric transformation of trajectory on the reverse design for mechanism.