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

Java statement block cloning detection method based on bytecode sequence matching

A technology of sequence matching and detection methods, which is applied in the fields of electronic digital data processing, other database retrieval, instruments, etc., and can solve problems such as granularity limitation and method level

Active Publication Date: 2019-07-05
HANGZHOU DIANZI UNIV
View PDF7 Cites 5 Cited by
  • Summary
  • Abstract
  • Description
  • Claims
  • Application Information

AI Technical Summary

Problems solved by technology

However, most of the existing code clone detection methods identify clone code from the source code of the software system, such as text-based, token-based, abstract syntax tree-based, metric-based, and program dependency graph-based, etc., and the granularity of detection is generally limited. at the class and method level

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
  • Java statement block cloning detection method based on bytecode sequence matching
  • Java statement block cloning detection method based on bytecode sequence matching
  • Java statement block cloning detection method based on bytecode sequence matching

Examples

Experimental program
Comparison scheme
Effect test

Embodiment Construction

[0021] The specific implementation of the code clone detection method of Java sentence blocks based on bytecode sequence matching provided by the present invention is mainly divided into 3 steps (such as figure 1 , 3 Shown):

[0022] (1) According to the two input Java files, using Oracle JDK and batch compiler, the source code is compiled into bytecode files and further converted into text form files, and from the bytecode files according to the execution of instructions and In the case of jump, extract the code fragment at the statement block level; (2) Extract the instruction sequence required by this method from the bytecode code fragment at the statement block level, and use a unique character for each instruction according to the realized function Representation, thereby forming a single-character instruction sequence; (3) In the code cloning detection stage, the single-character instruction sequence is used to calculate the similarity between sequence matching and bytecode...

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 Java statement block cloning detection method based on bytecode sequence matching. The method provided by the invention comprises the following steps of: extracting a bytecode segment of a statement block level through execution of an instruction and analysis of skip, then extracting the instruction from the bytecode segment, and representing the instruction by adopting aunique character according to different functions realized by the instruction; and finally similar code segments are obtained by adopting a sequence matching and similarity calculation mode. According to the method, byte code fragments of a statement block level are accurately extracted through execution of an instruction and analysis of skip, the byte code fragments are expressed through uniquecharacters according to the function achieved by the instruction, and therefore the code cloning detection efficiency is improved. In the specific cloning code detection process, the sequence matchingmethod is applied to a single character instruction sequence, and compared with other traditional methods, the method has a better detection and recognition effect.

Description

Technical field [0001] The invention belongs to the field of software engineering, and specifically relates to a Java sentence block code cloning detection technology based on bytecode sequence matching. Background technique [0002] In the software development process, developers often reuse code by copy-paste or add a small amount of modification, and this form of code reuse is code cloning. Research shows that the proportion of these cloned codes in the software is about 7% to 23%. Code cloning on the one hand helps to reduce the cost of development, but on the other hand, code cloning will also bring many harms. For example, code cloning will introduce bugs in the original code segment into the system and will make the understanding and maintenance of the software become difficult. Therefore, code clone detection can better help people find cloned code from software systems, thereby providing a basis for software maintenance and code management. [0003] Code clone detection...

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
IPC IPC(8): G06F8/75G06F16/903
CPCG06F8/751
Inventor 俞东进杨加柞孙笑笑陈信王琳
Owner HANGZHOU DIANZI UNIV
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