Code bad smell detection method and device

A detection method and code technology, applied in the field of software engineering, can solve problems such as difficulty in application, detection method precision and recall are not ideal, and cannot fully reflect code quality.

Pending Publication Date: 2021-05-07
INDUSTRIAL AND COMMERCIAL BANK OF CHINA
View PDF0 Cites 2 Cited by
  • Summary
  • Abstract
  • Description
  • Claims
  • Application Information

AI Technical Summary

Problems solved by technology

Since code metrics cannot fully reflect the quality of code, simple heuristic rules are not enough to accurately describe the complex mapping relationship between code metrics and code smell inspection results; and the selection of code metrics is highly subjective, and the selected Code metrics may not be the best choice
Therefore, the precision and recall of these detection methods are not ideal enough, and it is difficult to be widely used in the industry at present.

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 and device
  • Code bad smell detection method and device
  • Code bad smell detection method and device

Examples

Experimental program
Comparison scheme
Effect test

Embodiment Construction

[0045]In order to enable those skilled in the art to better understand the solution of the present application, the technical solution in the embodiment of the application will be clearly and completely described below in conjunction with the accompanying drawings in the embodiment of the application. Obviously, the described embodiment is only It is an embodiment of a part of the application, but not all of the embodiments. Based on the embodiments in this application, all other embodiments obtained by persons of ordinary skill in the art without creative efforts shall fall within the scope of protection of this application.

[0046] Those skilled in the art should understand that the embodiments of the present invention may be provided as methods, systems, or computer program products. Accordingly, the present invention can take the form of an entirely hardware embodiment, an entirely software embodiment, or an embodiment combining software and hardware aspects. Furthermore...

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 provides a code bad smell detection method and device which can be used in the financial field or other fields, and the method comprises the steps: carrying out the feature extraction of an obtained to-be-detected code class, and obtaining the text features and structural features of the to-be-detected code class; and taking the text feature and the structural feature as prediction samples, inputting the prediction samples into a pre-trained code bad taste detection model, and taking the output of the code bad taste detection model as a bad taste detection result of the to-be-detected code class. On the basis of considering the structural features of the codes, the semantic features of the codes are further considered, and the precision ratio and recall ratio of code bad taste detection can be increased.

Description

technical field [0001] The invention relates to the technical field of software engineering, in particular to a code smell detection method and device. Background technique [0002] With the growing scale of software development in the Internet industry, the requirements for software quality and management are getting higher and higher. Developers need to expand and maintain increasingly large and complex program frameworks, and spend time on sorting out and improving code structures. more and more time. Therefore, it is urgent to take some optimization measures to improve the reusability, comprehensibility and maintainability of the code, and software refactoring came into being. [0003] One of the key steps in software refactoring is to identify the code fragments that need to be refactored. In order to help developers determine where to perform refactoring operations in the program, Fowler et al. proposed the concept of bad code smell, which means that these are introd...

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): G06F8/41G06N3/04G06N3/08
CPCG06F8/436G06N3/049G06N3/08
Inventor 王妍金冶李伟高卓
Owner INDUSTRIAL AND COMMERCIAL BANK OF CHINA
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