approximate code cloning detection method adopting GPU acceleration
A code and detection efficiency technology, applied in the field of approximate code clone detection, can solve problems such as taking 4.5 days, maintaining a high level, detection accuracy and performance difficulties
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Publication Date
- 2019-05-31
Smart Images

Figure 1 
Figure 2
Abstract
Description
technical field
[0001] The invention belongs to the technical field of software code analysis, and in particular relates to an approximate code clone detection method accelerated by GPU. Background technique
[0002] Code clone detection is a technique to find duplicate identical or similar code fragments from software source code. As early as the 1990s, researchers noticed the repetitive nature of software code. Code duplication or code cloning generally falls into four types. Type I (Type-1) clone refers to the exact same code fragment. Type II (Type-2) clones are parameterized similar codes that are identical except for identifiers, constants, and types. Type III (Type-3) clones refer to similar codes that have additions, deletions, or other modifications beyond Type II clones. Type IV (Type-4) cloning refers to codes with similar semantics, that is, the grammatical structure may be completely different, but the codes have similar semantics. Among the code clone dete...
Examples
Embodiment Construction
[0030] Through the following description of the embodiments of the present invention combined with the accompanying drawings, the purpose, specific operation methods and advantages of the present invention can be further understood.
[0031] figure 2 An example of the procedure for detecting type III close clones in the three methods m1, m2, m3. The present invention labels all the source codes (including methods m1, m2, m3) to form a label string ① established in order by all the labels in the code, wherein the methods m1, m2, m3 are represented as three strips. Subsequently, the present invention constructs the label string into a suffix array ② by adopting GPU parallel acceleration according to character strings. Wherein, each element n represents a suffix string, and the suffix string starts from the nth tag of the tag string to the end of the tag string of the entire code. If the suffix strings represented by two adjacent elements have the same prefix (that is, several...