Check patentability & draft patents in minutes with Patsnap Eureka AI!

Incremental code defect detection method and system based on graph network model

A network model and code defect technology, applied in the incremental code defect detection method and system field based on the graph network model, can solve problems such as low timeliness and insufficient representation of defect codes

Active Publication Date: 2021-07-16
NORTHWEST UNIV(CN)
View PDF5 Cites 0 Cited by
  • Summary
  • Abstract
  • Description
  • Claims
  • Application Information

AI Technical Summary

Problems solved by technology

[0007] This invention aims at the problems of low timeliness and insufficient representation of defective codes brought about by the full defect code detection in the process of version change, and proposes an augmentation method based on graph network model A quantitative code defect detection method and system, the method can calculate the incremental code after the version change through associated code analysis after the software project is changed, and on this basis, the version change information of the project and the feature information of the code are fused It is expressed in the format of a graph, and finally learns the characteristics of the code with the help of the network model, and realizes the rapid detection function of the defective code after the version change. The number of detected codes improves the timeliness of defective code detection to help developers quickly locate defective codes in the software development process

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
  • Incremental code defect detection method and system based on graph network model
  • Incremental code defect detection method and system based on graph network model
  • Incremental code defect detection method and system based on graph network model

Examples

Experimental program
Comparison scheme
Effect test

Embodiment

[0102] combine figure 1 , this implementation presents an incremental code defect detection method based on graph network model, which specifically includes model training phase S1 and testing phase S2.

[0103] The model training phase S1 includes the following specific steps:

[0104] S1.1 Data processing: Collect Commit information in the software development process, obtain the corresponding Java source code in the Commit information, and mark the Java source code to obtain a data set;

[0105] S1.2 Code composition: In units of functions, the Java source code in the data set obtained in S1.1 is parsed into AST, and the AST composition is performed to obtain a training set in graph data format;

[0106] S1.3 Construct a graph convolutional neural network model: use the training set to train the GCN network;

[0107] Model testing phase S2 includes the following steps:

[0108] S2.1 Incremental code generation: using the function as a unit, using the method of graph simi...

example 1

[0126] Following the above scheme, in the incremental code defect detection experiment, a total of 20 versions of historical data of 6 projects were selected. The description of each project and the specific version number used are shown in Table 1. We select the historical version data and divide them into training set and test set according to 8:2, and then use the current version data as the test data to obtain the results in Table 2, where acc represents the accuracy of the model, and f1 is the harmony of accuracy and recall The average value is a comprehensive evaluation index, and recall is the recall rate. From the table below, it can be found that the defect detection accuracy of the GNN model in these 6 items can reach 52.1% at the lowest and 77.2% at the highest. Both machine learning models use manually extracted features, and we control the test data of GCN, LR, and TNB by using VPT-based correlation code analysis. Finally, it is found that GCN is better than tradi...

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 an incremental code defect detection method and system based on a graph network model, and the method comprises a training stage and a testing stage, and the training stage comprises the steps: data processing, code composition, and construction of a graph convolutional neural network model; the test stage comprises incremental code generation, incremental code composition and defect code detection; on the basis of existing defect code detection work, correlation code analysis and defect code detection work are combined, the incremental code detection method based on the graph network model is provided, after the version of a software project is changed, incremental codes after version change can be calculated through correlation code analysis, and on the basis, the version change information of the project and the feature information of the code are fused and expressed into a graph format, and finally, the feature of the code is learned by means of a network model, so that the function of quickly detecting the defect code after version change is realized.

Description

technical field [0001] The invention belongs to the field of source code auditing, in particular to an incremental code defect detection method and system based on a graph network model. Background technique [0002] Software defect, also known as Bug or Defect, refers to some kind of problem or error in software or program that destroys the normal operation ability, and its existence will cause the software product to be unable to meet the needs of users to some extent. Software defect detection (SDP) testing runs through the entire life cycle of software development and is an indispensable link in the software development process. [0003] At present, there are many methods on the market that use machine learning for defect detection. Using machine learning for defect detection, the core technology lies in the representation of code and the selection of models. In the representation of code, the more common method is to extract some static data of the code. Statistical fe...

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): G06F11/36G06N3/04G06N3/08
CPCG06F11/368G06F11/3628G06N3/08G06N3/045
Inventor 龚晓庆李朋徐榕泽赵佳琪叶贵鑫汤战勇房鼎益
Owner NORTHWEST UNIV(CN)
Features
  • R&D
  • Intellectual Property
  • Life Sciences
  • Materials
  • Tech Scout
Why Patsnap Eureka
  • Unparalleled Data Quality
  • Higher Quality Content
  • 60% Fewer Hallucinations
Social media
Patsnap Eureka Blog
Learn More