Unlock instant, AI-driven research and patent intelligence for your innovation.

Code bad smell detection method based on BP neural network

A BP neural network and detection method technology, applied in the field of computer software, can solve the problem of not conforming to the distribution of bad smells in the code, and achieve the effect of improving the F1 value and improving the accuracy.

Active Publication Date: 2019-11-26
XIAN UNIV OF POSTS & TELECOMM
View PDF9 Cites 7 Cited by
  • Summary
  • Abstract
  • Description
  • Claims
  • Application Information

AI Technical Summary

Problems solved by technology

The present invention aims at the single-type problem in the data set of code bad smell detection, which does not conform to the distribution of bad code smell in the data set in the actual software development process, and proposes two codes based on BP neural network for long method and feature attachment Dataset detection method after bad smell types are merged

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 bad smell detection method based on BP neural network
  • Code bad smell detection method based on BP neural network
  • Code bad smell detection method based on BP neural network

Examples

Experimental program
Comparison scheme
Effect test

Embodiment Construction

[0022] specific implementation plan

[0023] For the source code of a certain software project, the current mainstream is to use code smell automatic detection tools to detect bad smell entities in the program. Each tool detects different types of code smell, which lacks objectivity. The present invention detects 15 Java open source projects through the code bad smell detection tool to obtain code bad smell examples, and merges the two sample sets of feature attachment and long method, so that the code bad smell data set contains different bad smells Type and measure characteristic value. By extracting the software measurement features that meet the preset input from the data set, as the input of the BP neural network, the expected output of the network is the label of the sample. After multiple iterations of training, the final trained neural network model can be obtained, and used The public code bad smell dataset proposed by Fontana et al. is used as a test set to test the...

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 bad smell detection method based on a BP neural network, and belongs to the technical field of computer software. The method comprises: firstly, extracting a code bad smell instance and label information; then, calculating whether a code bad taste measurement characteristic exists or not; combining the measurement characteristics with the extracted label information; constructing a training set in this way, the method comprises the following steps: establishing a neural network by adopting Keras, taking a training set as input of a neural network model to finishcode bad smell prediction output training, and finally taking a code bad smell instance obtained from a tested program as a code bad smell test set to be input into the trained neural network model,so that the model output code bad smell belongs to a certain type. According to the method, a code bad smell detection technology based on metric characteristics and a neural network algorithm are combined to detect different types of code bad smells in the data set, so that the detection accuracy and the F1 value are improved.

Description

technical field [0001] The invention belongs to the technical field of computer software, especially in the technical field of bad smell detection of codes. Neural Networks for Code Smell Detection. Background technique [0002] Good software design quality can make maintenance and reuse easier and more convenient, and if there are various bad smells in the code, it will inevitably lead to a decline in the overall design quality of the software. Code bad smell detection has always been a field of software engineering. One of the research hotspots, in which researchers have proposed some code smell detection methods based on various machine learning algorithms. Kreimer proposed an adaptive detection method, combined with the decision tree algorithm to detect two bad code smells of overly large classes and overly long methods. Khomh et al. build Bayesian belief networks from the definition of antipatterns based on a target problem metric and verify the God class in two open ...

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/77G06K9/62G06N3/04G06N3/08
CPCG06F8/77G06N3/084G06N3/047G06N3/045G06F18/24147G06F18/241
Inventor 王曙燕张一权孙家泽
Owner XIAN UNIV OF POSTS & TELECOMM