Code function taste detection method based on deep semantics

A code and function technology, applied in the field of automated software refactoring, can solve problems such as the inability to automatically extract code-related features

Active Publication Date: 2019-11-05
BEIJING INSTITUTE OF TECHNOLOGYGY
View PDF5 Cites 9 Cited by
  • Summary
  • Abstract
  • Description
  • Claims
  • Application Information

AI Technical Summary

Problems solved by technology

[0006] The purpose of the present invention is to propose a code function smell detection based on deep semantics for the existing code smell detection methods in th

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
  • Code function taste detection method based on deep semantics
  • Code function taste detection method based on deep semantics
  • Code function taste detection method based on deep semantics

Examples

Experimental program
Comparison scheme
Effect test

Embodiment 1

[0109] This example uses the method proposed by the present invention to establish a code function smell detection system based on deep semantics. The detection system uses a Python development platform and a Tensorflow resource library. The source code provided by the Junit project, a software testing tool on github, is used. The address of the Junit open source project is https: / / github.com / junit-team / junit4.

[0110] Use the code reconstruction tool PMD to extract the relevant information of all functions in the source code of the Junit project, and divide it into a training set and a test set. The specific steps of model training and model testing are as follows:

[0111] Among them, model training includes code function representation A, structured feature extraction A and code smell classification A; model testing includes code function representation B, structured feature extraction B and code smell classification B;

[0112] Code Function Representation A and Code Fun...

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 relates to a code function taste detection method based on deep semantics, and belongs to the technical field of automatic software reconstruction. The method comprises the following steps: extracting semantic features and digital features in text information and structured information, including model training and model testing. The model training comprises code function representation A, structured feature extraction A and code taste classification A, wherein code function representation B, structured feature extraction B and code taste classification B are included. The code function representation A and the code function representation B are code function representations based on an attention mechanism and an LSTM neural network, wherein the structured feature extractionA and the structured feature extraction B are structured feature extraction based on a convolutional neural network. The code taste classification A and the code taste classification B are function-level code taste detection methods based on deep learning provided by code taste classification of a multi-layer perceptron. Under the condition of short detection time, it can be guaranteed that the detection result has high recall rate and accuracy.

Description

technical field [0001] The invention relates to a code function smell detection method based on deep semantics, and belongs to the technical field of automatic software reconstruction. Background technique [0002] The quality of the source code of a software project has always been a key quality issue in the field of modern software engineering. Among the many quality problems, the most serious is the code smell problem. In the process of software development, the existence of code smell often leads to serious software quality problems and software maintenance problems. The concept of code smell was proposed by Fowler, who introduced 22 types of code smell, including the famous feature envy and long method. [0003] Code smell detection has become an important method to find problems in source code (or design) that need to be corrected by software refactoring, with the purpose of improving the quality of software. However, most software projects have a large amount of so...

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/77G06F16/35G06K9/62
CPCG06F8/77G06F16/35G06F18/241
Inventor 施重阳郭学良江贺
Owner BEIJING INSTITUTE OF TECHNOLOGYGY
Who we serve
  • R&D Engineer
  • R&D Manager
  • IP Professional
Why Eureka
  • Industry Leading Data Capabilities
  • Powerful AI technology
  • Patent DNA Extraction
Social media
Try Eureka
PatSnap group products