Looking for breakthrough ideas for innovation challenges? Try Patsnap Eureka!

Code clone detection method

A detection method and code technology, applied in the direction of program control devices, etc., can solve the problems of incomplete detection of clone types, low accuracy, and high cost, and achieve the effect of improving anti-obfuscation.

Active Publication Date: 2015-03-11
BEIJING UNIV OF POSTS & TELECOMM
View PDF2 Cites 17 Cited by
  • Summary
  • Abstract
  • Description
  • Claims
  • Application Information

AI Technical Summary

Problems solved by technology

However, the cost of establishing PDG and finding isomorphic subgraphs is also very high, and it is difficult to apply to large-scale software
[0013] It can be seen that the existing code clone detection methods have problems such as incomplete detection of clone types, low accuracy, high complexity and difficult implementation.

Method used

the structure of the environmentally friendly knitted fabric provided by the present invention; figure 2 Flow chart of the yarn wrapping machine for environmentally friendly knitted fabrics and storage devices; image 3 Is the parameter map of the yarn covering machine
View more

Image

Smart Image Click on the blue labels to locate them in the text.
Viewing Examples
Smart Image
  • Code clone detection method
  • Code clone detection method
  • Code clone detection method

Examples

Experimental program
Comparison scheme
Effect test

Embodiment Construction

[0025] In order to make the purpose, technical solution and advantages of the present invention clearer, the present invention will be further described in detail below in conjunction with the accompanying drawings and specific embodiments.

[0026] The core idea of ​​the present invention is: considering that for application programs to realize basic functions, the lowest-level API for most developers will not change. If the API frequency used by the two applications is basically the same, no matter how the plagiarist confuses the control flow and data flow of the code, the most basic API call will not change greatly. This invention will use the API call frequency to clone the code The judgment of relationship can improve the anti-obfuscation and accuracy of code clone detection, and the extraction of API is easy to implement and does not need to depend on source code, so it can also effectively reduce the difficulty of code clone detection and improve application compatibilit...

the structure of the environmentally friendly knitted fabric provided by the present invention; figure 2 Flow chart of the yarn wrapping machine for environmentally friendly knitted fabrics and storage devices; image 3 Is the parameter map of the yarn covering machine
Login to View More

PUM

No PUM Login to View More

Abstract

The invention discloses a code clone detection method. The code clone detection method comprises respectively extracting respective invoking API (Application Programming Interface) sets of two groups of to-be-detected program codes; determining an invoking frequency of every API in every group of API set of the program codes; for every group of program codes k, generating a n-dimensional marking vector of the group of program codes according to the invoking frequency of the corresponding API, wherein the dimension values vk and i of the n-dimension marking vector is corresponding to the APIs one to one, a set N is a union set of the API sets of the two groups of program codes, the vk and i are obtained according to the invoking frequency pk and i of the APIi which is corresponding to the k group of program code; calculating the similarity of the two groups of program codes according to the n-dimension marking vector of every group of program codes; determining whether two groups of program codes have a clone relationship or not according to the similarity and the preset similar threshold value. The code clone detection method can improve the detection mix resistance and is high in accuracy and easy to achieve.

Description

technical field [0001] The invention relates to computer application technology, in particular to a code clone detection method. Background technique [0002] Code clone (Code Clone) refers to the repeated occurrence of the same or similar code fragments in the software source code. These code fragments may be identical, or may have undergone some editorial (such as modifying variable names) or logical modifications (such as modifying to similar but not identical functions). Code fragments considered to be clones of each other often have similar logical operations and achieve similar functions. Code cloning is generally caused by copy-and-paste code reuse, or it may be caused by patterned thinking to solve similar problems. Code cloning is abundant in large software systems as well as in several similar software systems. Cloning code is closely related to many issues in software engineering, such as software quality, complexity, architecture, evolution, patents, and plagi...

Claims

the structure of the environmentally friendly knitted fabric provided by the present invention; figure 2 Flow chart of the yarn wrapping machine for environmentally friendly knitted fabrics and storage devices; image 3 Is the parameter map of the yarn covering machine
Login to View More

Application Information

Patent Timeline
no application Login to View More
Patent Type & Authority Applications(China)
IPC IPC(8): G06F9/44
Inventor 张程鹏李祺李承泽董枫杨昕雨
Owner BEIJING UNIV OF POSTS & TELECOMM
Who we serve
  • R&D Engineer
  • R&D Manager
  • IP Professional
Why Patsnap Eureka
  • Industry Leading Data Capabilities
  • Powerful AI technology
  • Patent DNA Extraction
Social media
Patsnap Eureka Blog
Learn More
PatSnap group products