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

Multi-granularity code clone detection method based on Java byte codes under cloud environment

A detection method and bytecode technology, applied in electrical digital data processing, instruments, program control devices, etc., can solve the problems of high accuracy, difficulty in detecting Type-3 code cloning, and low recall rate, and achieve cloning The effect of accurate detection results

Active Publication Date: 2017-07-04
杭州鹿径科技有限公司
View PDF4 Cites 5 Cited by
  • Summary
  • Abstract
  • Description
  • Claims
  • Application Information

AI Technical Summary

Problems solved by technology

The Text-based method does not need to convert the source code, and its accuracy rate is high but the recall rate is low; the Token-based method has a faster detection speed and does not depend on the development language, but it is difficult to detect Type-3 code clones; AST and PDG-based methods need to convert the source code into AST or PDG and then perform corresponding comparisons. These two methods are relatively expensive; since the metric values ​​corresponding to different code segments may be the same, the metric-based The value method has a high false positive rate

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
  • Multi-granularity code clone detection method based on Java byte codes under cloud environment
  • Multi-granularity code clone detection method based on Java byte codes under cloud environment
  • Multi-granularity code clone detection method based on Java byte codes under cloud environment

Examples

Experimental program
Comparison scheme
Effect test

Embodiment Construction

[0024] The specific implementation of the multi-granularity code clone detection method based on Java bytecode under the cloud environment provided by the present invention is mainly divided into 3 steps (such as figure 1 shown):

[0025] 1) Pretreatment

[0026] The preprocessing stage mainly includes the following two steps:

[0027] (1) Source code compilation

[0028] First, the Java source code distributed in different places in the cloud environment is compiled into a .class file, and the .class file is converted into a Java bytecode file in txt format, which is used as the input for the next clone detection. Each Java bytecode file contains one or more methods, and each method consists of a series of instructions and related method calls. Since Java compiles and automatically processes blank lines and comments, and also removes the impact of variable renaming, there is no need to preprocess blank lines, comments, and variable names.

[0029] (2) Method extraction an...

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 multi-granularity code clone detection method based on Java byte codes under the cloud environment. The method extracts the codes of block granularity through analyzing the Java byte code instructions so as to simultaneously detect the clone of the method granularity and the clone of block granularity. During the calculation of similarity of codes, not only the similarity among instructions are taken into consideration, but also the similarity among method calling is introduced so that semantic clone is better detected. Compared with traditional methods for detecting code clone based on Java byte codes, the method of the invention can simultaneously detects the code clone of method granularity and block granularity; in addition, the similarity comparison of method calling is added so that the clone detection results are more accurate.

Description

technical field [0001] The invention belongs to the technical field of code clone detection in software analysis, and in particular relates to a Java bytecode-based multi-granularity code clone detection method in a cloud environment. Background technique [0002] The emergence of cloud computing provides a new collaborative work model for traditional software development. In this model, different software teams and individuals are located in different places and contribute to the common development of the same software system. The collaborative development model based on the cloud environment brings convenience to software developers, but also brings certain difficulties to software management, especially due to differences in regions and teams, developers need to copy-paste or add a small amount of modification. The behavior of reusing code lacks effective supervision. These repeated codes (or code clones) will seriously affect the maintenance work of the software. By d...

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
CPCG06F8/751
Inventor 俞东进陈耀旺
Owner 杭州鹿径科技有限公司
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