Disclosure of Invention
Embodiments of the present invention provide a method, a system, an electronic device, and a storage medium for positioning a bug based on machine learning, which overcome or at least partially solve the above problems.
According to a first aspect of the embodiments of the present invention, there is provided a bug positioning method based on machine learning, including:
inputting a bug to be positioned into the trained machine learning model, and outputting a code block corresponding to the bug to be positioned;
the machine learning model is trained according to a training set including bugs and code blocks corresponding to each bug.
On the basis of the above technical solutions, the embodiments of the present invention may be further improved as follows.
Further, the method also comprises the following steps:
collecting each bug, functionally classifying each bug, and establishing detailed description information and a solution for each bug, wherein the relevant code blocks can be associated through the detailed description information and the solution of each bug;
collecting each code block, and performing functional classification on each code block;
establishing an incidence relation between each bug and the code block, and taking each bug and the corresponding code block as a training set;
and training the machine learning model by adopting a training set.
Further, each collected bug comprises bugs with different products, different modules, different severity degrees and different priorities, and each collected code block comprises code blocks with different products, different modules and different versions.
Further, the method also comprises the following steps:
marking each bug and each code block in the training set with the function attribute;
correspondingly, the code block corresponding to the bug to be positioned and output by the machine learning model is marked with functional attributes.
Further, the code block corresponding to each bug is a function or a function module or an API interface, and the training set includes each bug and its corresponding function or its corresponding function module or its corresponding API interface;
correspondingly, the bug to be positioned is input into the trained machine learning model, and a code block corresponding to the bug to be positioned is output; the method comprises the following steps:
and inputting the bug to be positioned into the trained machine learning model, and outputting a function or functional module or API (application programming interface) corresponding to the bug to be positioned.
According to a second aspect of the embodiments of the present invention, there is provided a bug positioning system based on machine learning, including:
the training module is used for training the machine learning model according to a training set comprising the bugs and the code blocks corresponding to the bugs;
and the input module is used for inputting the bug to be positioned into the trained machine learning model and outputting the code block corresponding to the bug to be positioned.
Further, the code block corresponding to each bug is a function or a function module or an API interface, and the training set includes each bug and its corresponding function or its corresponding function module or its corresponding API interface;
correspondingly, the input module is configured to input the bug to be positioned into the trained machine learning model, and outputting the code block corresponding to the bug to be positioned includes:
and inputting the bug to be positioned into the trained machine learning model, and outputting a function or functional module or API (application programming interface) corresponding to the bug to be positioned.
According to a third aspect of the embodiments of the present invention, there is provided an electronic device, including a memory, and a processor, where the processor is configured to implement the steps of the bug positioning method based on machine learning when executing a computer management class program stored in the memory.
According to a fourth aspect of the embodiments of the present invention, there is provided a computer-readable storage medium, on which a computer management class program is stored, which, when executed by a processor, implements the steps of the machine learning-based bug positioning method.
The embodiment of the invention provides a bug positioning method, a bug positioning system, electronic equipment and a storage medium based on machine learning, wherein a bug to be positioned is input into a trained machine learning model, and a code block corresponding to the bug to be positioned is output; the machine learning model is trained according to a training set including bugs and code blocks corresponding to each bug. According to the embodiment of the invention, the code block generating the bug is positioned by training the machine learning model, so that the time for positioning the bug is shortened, and the iteration efficiency of the product quality is improved.
Detailed Description
The following detailed description of embodiments of the present invention is provided in connection with the accompanying drawings and examples. The following examples are intended to illustrate the invention but are not intended to limit the scope of the invention.
Fig. 1 is a flowchart of a bug positioning method based on machine learning according to an embodiment of the present invention, and as shown in fig. 1, the method includes: 101. training the machine learning model according to a training set comprising the bugs and the code blocks corresponding to the bugs; 102. and inputting the bug to be positioned into the trained machine learning model, and outputting the code block corresponding to the bug to be positioned.
It can be understood that, based on the problem that in the prior art, the efficiency is low when a code block generating a bug is manually positioned, the embodiment of the invention provides a method and a device for automatically positioning a code block generating a bug. Based on supervised learning, training a machine learning model through various collected bugs and a code block for generating the bugs, inputting the bugs to be positioned into the trained machine learning model, and outputting the code block for generating the bugs.
The code blocks for generating the bug can be automatically positioned by training the machine learning model, so that the bug positioning time is shortened, and the iteration efficiency of the product quality is improved.
In a possible implementation manner, the method further includes: collecting each bug, functionally classifying each bug, and establishing detailed description information and a solution for each bug, wherein the relevant code blocks can be associated through the detailed description information and the solution of each bug; collecting each code block, and performing functional classification on each code block; establishing an incidence relation between each bug and the code block, and taking each bug and the corresponding code block as a training set; and training the machine learning model by adopting a training set.
It can be understood that, when the training set is collected, various bugs are collected, each bug is functionally classified, and detailed description information and a solution are established for each bug, wherein the detailed description information and the solution of each bug can be used as a basis for association of the code block. The collected code blocks are also functionally classified. After the bugs and the code blocks are collected, each bug and each code block are corresponding to each other to serve as a training set, a machine learning model is trained through the training set, and the trained machine learning model is used for positioning the code blocks of the bug to be positioned.
In a possible embodiment mode, each collected bug comprises bugs with different products, different modules, different degrees of severity and different priorities, and each collected code block comprises code blocks with different products, different modules and different versions.
It can be understood that, in order to increase the application range of the machine learning model, when various bugs are collected, bugs of different products, different modules, different severity degrees and different priorities are collected; likewise, when collecting code blocks, different products, different modules, and different versions of code blocks are collected. The machine learning model is trained through a large area, various bugs and different code blocks, and the trained machine learning model can be suitable for more scenes.
In a possible implementation manner, the method further includes: marking each bug and each code block in the training set with the function attribute; correspondingly, the code block corresponding to the bug to be positioned and output by the machine learning model is marked with functional attributes.
It is understood that, by introducing the foregoing, the bugs and the code blocks in the training set are functionally classified, and each bug and the corresponding code block in the training set may be labeled with a functional attribute.
When the machine learning model is trained, the bug marked with the functional attribute and the code block marked with the functional attribute are used for training, and after the machine learning model is trained, when the bug to be positioned is input into the trained machine learning model, the output code block is also marked with the functional attribute.
In a possible embodiment, the code block corresponding to each bug is a function or a function module or an API interface, and the training set includes each bug and its corresponding function or its corresponding function module or its corresponding API interface. Correspondingly, inputting the bug to be positioned into the trained machine learning model, and outputting the code block corresponding to the bug to be positioned comprises: and inputting the bug to be positioned into the trained machine learning model, and outputting a function or functional module or API (application programming interface) corresponding to the bug to be positioned.
It should be understood that the code block in the embodiment of the present invention is located to a certain function or a certain functional module or an API (Application Programming Interface), and correspondingly, the training set includes each bug and the corresponding function or functional module or API Interface. When training the machine learning model, the bug and the function or function module or API interface generating the bug are used for training.
Similarly, the bug with the location is input into the trained machine learning model, and the output is the function or functional module or API interface for generating the bug to be located.
Referring to fig. 2, a description is given of a bug positioning method based on machine learning according to an embodiment of the present invention, first, various bugs and various code blocks are collected, each bug and a corresponding code block are associated to form a training set, and a machine learning model is trained by using the training set. And finally, accurately positioning the code block corresponding to the bug to be positioned by using the trained machine learning model.
According to the embodiment of the invention, the code block generating the bug is positioned by training the machine learning model, so that the time for positioning the bug is shortened, and the iteration efficiency of the product quality is improved.
Referring to fig. 3, there is provided a bug positioning system based on machine learning, comprising a training module 301 and an input module 302, wherein:
the training module 301 is configured to train a machine learning model according to a training set including the bugs and the code blocks corresponding to the bugs;
the input module 302 is configured to input the bug to be positioned into the trained machine learning model, and output the code block corresponding to the bug to be positioned.
The code block corresponding to each bug is a function or a function module or an API interface, and the training set comprises each bug and the function or the function module or the API interface corresponding to the bug. Correspondingly, the bug to be positioned is input into the trained machine learning model, and a function or functional module or API interface corresponding to the bug to be positioned is output.
The bug positioning system based on machine learning provided by the embodiment of the present invention corresponds to the bug positioning method based on machine learning provided by the foregoing embodiments, and the relevant technical features of the bug positioning system based on machine learning may refer to the relevant technical features of the bug positioning method based on machine learning, and will not be described again here.
Referring to fig. 4, fig. 4 is a schematic view of an embodiment of an electronic device according to an embodiment of the present disclosure. As shown in fig. 4, an electronic device according to an embodiment of the present application includes amemory 410, aprocessor 420, and acomputer program 411 stored in thememory 420 and executable on theprocessor 420, where theprocessor 420 executes thecomputer program 411 to implement the following steps: inputting a bug to be positioned into the trained machine learning model, and outputting a code block corresponding to the bug to be positioned; the machine learning model is trained according to a training set including bugs and code blocks corresponding to each bug.
Referring to fig. 5, fig. 5 is a schematic diagram illustrating an embodiment of a computer-readable storage medium according to the present application. As shown in fig. 5, the present embodiment provides a computer-readable storage medium 500 having acomputer program 511 stored thereon, thecomputer program 511 implementing the following steps when executed by a processor: inputting a bug to be positioned into the trained machine learning model, and outputting a code block corresponding to the bug to be positioned; the machine learning model is trained according to a training set including bugs and code blocks corresponding to each bug.
It should be noted that, in the foregoing embodiments, the descriptions of the respective embodiments have respective emphasis, and reference may be made to relevant descriptions of other embodiments for parts that are not described in detail in a certain embodiment.
As will be appreciated by one skilled in the art, embodiments of the present application may be provided as a method, system, or computer program product. Accordingly, the present application may take the form of an entirely hardware embodiment, an entirely software embodiment or an embodiment combining software and hardware aspects. Furthermore, the present application may take the form of a computer program product embodied on one or more computer-usable storage media (including, but not limited to, disk storage, CD-ROM, optical storage, and the like) having computer-usable program code embodied therein.
The present application is described with reference to flowchart illustrations and/or block diagrams of methods, apparatus (systems), and computer program products according to embodiments of the application. It will be understood that each flow and/or block of the flow diagrams and/or block diagrams, and combinations of flows and/or blocks in the flow diagrams and/or block diagrams, can be implemented by computer program instructions. These computer program instructions may be provided to a processor of a general purpose computer, special purpose computer, embedded computer, or other programmable data processing apparatus to produce a machine, such that the instructions, which execute via the processor of the computer or other programmable data processing apparatus, create means for implementing the functions specified in the flowchart flow or flows and/or block diagram block or blocks.
These computer program instructions may also be stored in a computer-readable memory that can direct a computer or other programmable data processing apparatus to function in a particular manner, such that the instructions stored in the computer-readable memory produce an article of manufacture including instruction means which implement the function specified in the flowchart flow or flows and/or block diagram block or blocks.
These computer program instructions may also be loaded onto a computer or other programmable data processing apparatus to cause a series of operational steps to be performed on the computer or other programmable apparatus to produce a computer implemented process such that the instructions which execute on the computer or other programmable apparatus provide steps for implementing the functions specified in the flowchart flow or flows and/or block diagram block or blocks.
While the preferred embodiments of the present application have been described, additional variations and modifications in those embodiments may occur to those skilled in the art once they learn of the basic inventive concepts. Therefore, it is intended that the appended claims be interpreted as including preferred embodiments and all alterations and modifications as fall within the scope of the application.
It will be apparent to those skilled in the art that various changes and modifications may be made in the present application without departing from the spirit and scope of the application. Thus, if such modifications and variations of the present application fall within the scope of the claims of the present application and their equivalents, the present application is also intended to include such modifications and variations.