Software code line-level defect detection method based on deep learning

A software code and defect detection technology, applied in software testing/debugging, error detection/correction, instruments, etc., to solve problems such as inability to detect code fragment defects, inability to effectively utilize code information from other code warehouses, and inability to effectively capture token associations.

Active Publication Date: 2020-02-21
ZHEJIANG UNIV
View PDF8 Cites 3 Cited by
  • Summary
  • Abstract
  • Description
  • Claims
  • Application Information

AI Technical Summary

Problems solved by technology

[0003] 1. It is difficult for the rules to cover all defect situations;
[0004] 2. The granularity of code processing is too large to perform defect detection on code fragments;
[0005] 3. Unable to effectively capture the Token association in the code;
[0006] 4. The code information of other code warehouses cannot be effectively used;

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 code line-level defect detection method based on deep learning
  • Software code line-level defect detection method based on deep learning
  • Software code line-level defect detection method based on deep learning

Examples

Experimental program
Comparison scheme
Effect test

Embodiment

[0059] Using the method of this paper and the Bugram tool (Bug detection with Ngram language models) to conduct a comparative experiment on 8 Java classes, because the code segments in the java file do not have label information, the indicators for evaluating tool performance are recommendation accuracy and MRR (Measurement Result Recording), the first 20 code segments with potential defects are given through the manual review model, the number of code segments that are actually defective among the 20 code segments is judged, and the ranking position of the first real defect in the candidate results . The detailed results are shown in Table 1. As shown in Table 1, the method in this paper is superior to the Bugram method in terms of defect recommendation accuracy and MRR in the test results of 8 Java classes. The method in this paper and the Bugram tool are both unsupervised methods, but the method in this paper uses the master branch code as the training set for training, 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 software code line-level defect detection method based on deep learning, and belongs to the field of software code defect detection. The method specifically comprises the steps: (1) class-based ATS extraction in a master branch, (2) ATS set preprocessing, (3) LSTM model training, (4) development branch ATS set extraction and detection, and (5) ATS abnormal probability sorting. According to the method, the model code processing granularity can reach the code line level, defect detection can be conducted on code fragments, front-back correlation of related Token in codes can be effectively captured, and related code information in other existing code warehouses can be utilized.

Description

technical field [0001] The invention belongs to the field of software code defect detection, and in particular relates to a deep learning-based software code line-level defect detection method. Background technique [0002] Code defect detection has always been a research hotspot in the field of software engineering. FindBugs is a defect detection tool based on rule matching, which compares bytecode with a set of defect patterns to find possible problems by inspecting class or jar files. Commit Guru is a feature-based change-level defect detection tool, which manually defines features and models through machine learning to judge the possibility of newly submitted code change defects. Bugram is a code line-level defect detection tool based on code statistics. It calculates the abnormal probability of Token in the source code through the N-gram algorithm to detect code defects. But these methods have their own disadvantages [0003] 1. It is difficult for the rules to cover...

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 & AuthorityApplications(China)
IPC IPC(8): G06F11/36
CPCG06F11/3688
Inventor杨小虎曹靖刘力华张昕东鄢萌夏鑫
OwnerZHEJIANG UNIV