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

Software reusing method based on code clone automatic detection and timely prompting

A software reuse and automatic detection technology, applied in the direction of program control devices, etc., can solve problems such as difficulty in supporting automatic real-time detection, memory and time consumption, and great effort, etc., to achieve large-scale real-time detection and simple data structure implementation , the effect of optimal space-time complexity

Inactive Publication Date: 2014-10-01
SOUTHEAST UNIV
View PDF2 Cites 27 Cited by
  • Summary
  • Abstract
  • Description
  • Claims
  • Application Information

AI Technical Summary

Problems solved by technology

However, these methods and technologies have the following problems: for small and medium-scale software, the current popular detection tools can well meet the requirements of clone detection, but they consume a lot of memory and time when detecting large-scale software, which is difficult to do. The real-time performance of large-scale detection; secondly, the current detection tools are separated from the integrated development environment, and most of them need to be called manually, which makes it difficult to support automatic real-time detection, resulting in failure to receive timely attention from users after the cloned code is generated
Again, the current detection methods always try to search the entire code base, and then present all clone pairs or clone groups to developers in a visual way, causing developers to spend a lot of energy to locate the clones they are really interested in. Increases the burden on users to reuse code or refactor

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
  • Software reusing method based on code clone automatic detection and timely prompting
  • Software reusing method based on code clone automatic detection and timely prompting
  • Software reusing method based on code clone automatic detection and timely prompting

Examples

Experimental program
Comparison scheme
Effect test

Embodiment

[0067] 1. The following will illustrate the entire operation process through specific codes.

[0068]

[0069] Step 1), utilize the generation tool of lexical analyzer to generate the Java lexical analysis program based on token; The lexical analyzer generation tool that the present invention adopts is Jflex;

[0070] Step 2), standardize the source code: input the code that has been developed in the project and the code segment of the current editing area into the Java lexical analysis program generated in the step 1) respectively, generate the token value corresponding to each source file, in During the generation process, irrelevant information such as packages, comments, and spaces in the code are filtered. Among them, cn.seu.cloneTest in the first line of code is the package name. The intermediate code after standardizing the source code is as follows:

[0071] classN {

[0072] TN(){

[0073] TN[]=newT[]{};

[0074] TN = newT(0);

[0075] TN=0; ...

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 software reusing method based on code clone automatic detection and timely prompting. The method includes the steps that firstly, a Java lexical analyzer is generated through a lexical generator; secondly, if a background monitor monitors that a code in the current editing area is modified, the code in the current editing area and a developed code are input into the Java lexical generator, token values corresponding to source code files are generated according to a conversion rule, tokens are connected to form a Token sequence, and the Token sequence is stored in a one-dimensional array; thirdly, according to the multiplication algorithm or a DC3 algorithm, a suffix array and a rank array are constructed, and the longest public prefix array is generated; fourthly, meaningless code fragments are filtered out from the longest public prefix array, and if code clones still exist, a user is prompted to reuse or reconstruct the code clones. By means of the method, the user can conduct development while the background monitor detects the source code.

Description

technical field [0001] The invention belongs to the field of software maintenance and software reengineering, and relates to a software reuse method for automatic detection and timely reminder. Background technique [0002] The detection of software clone codes in software systems is one of the research hotspots in software engineering, and it has a wide range of applications in the fields of software maintenance, architecture, evolution, patents and plagiarism. In order to improve development efficiency, developers often copy-paste-modify the source code of the software system. This reuse mechanism usually results in many identical or similar code segments appearing in the source code library. This type of code segment is called Clone the code. In addition, the solidification of similar function implementation methods in the minds of developers also makes them often write similar code segments in different places. In addition, programmers use specific design pattern frame...

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): G06F9/44
Inventor 李必信刘辉辉荣学益
Owner SOUTHEAST 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