Software defect automatic detection and positioning method based on deep learning
By introducing hardware performance detection and data segmentation modules into the software defect detection system, and using the hardware performance margin for software code detection, the problem of hardware performance not being effectively utilized in the prior art is solved, the detection efficiency is improved and hardware waste is reduced.
Patent Information
- Application Number
- CN202510171505.2
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-02-17
- Publication Date
- 2025-06-06
AI Technical Summary
The existing software defect detection system based on deep learning has not been effectively utilized, resulting in hardware waste and low detection efficiency.
By introducing hardware performance detection module and data segmentation module, hardware performance is monitored in real time and the data to be detected reasonably are divided, and software code detection is used to use the hardware margin performance to improve detection efficiency.
Effectively utilize hardware performance margins, reduce hardware waste, and improve the efficiency of software defect detection and positioning.
Smart Images

Figure CN120104484A_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the technical field of software defect detection, and in particular to a method for automatic detection and positioning of software defects based on deep learning. Background Art
[0002] The deep learning-based automatic software defect detection system is an intelligent system that uses deep learning technology to automatically identify and locate potential defects in software. Traditional software defect detection methods often rely on manual experience and rules, which are inefficient and prone to miss some complex defects. With the powerful learning and feature extraction capabilities of the deep learning model, this system can learn defect patterns and features from a large amount of software code data, thereby realizing automatic detection of software code.
[0003] After the software code to be tested is input into the trained deep learning model, the model analyzes the code based on the learned knowledge. In addition to outputting whether there are defects in the code and the possible defect types, it also outputs the location of the defect to achieve the purpose of locating the location of the defect. However, the hardware performance of the equipment used in the current control system is relatively strong. The hardware performance determines the speed of software code analysis. When analyzing the software code, there will be a certain margin in the hardware performance. The extra margin cannot be effectively utilized, resulting in hardware waste and the detection efficiency cannot be improved. Summary of the invention
[0004] In view of the problems existing in the prior art, the purpose of the present invention is to provide a method for automatic detection and location of software defects based on deep learning to solve the background technical problems.
[0005] To achieve the above object, the present invention adopts the following technical solution: A deep learning-based automatic software defect detection system comprises a control system, wherein the control system is bidirectionally connected to a data integration system, a model training system, a defect detection system, a hardware performance detection module, a data segmentation module, a detection submodule and an evaluation module.
[0006] As a further description of the above technical solution: The data integration system includes a data collection module and a data preprocessing module, and both the data collection module and the data preprocessing module are bidirectionally connected to the control system.
[0007] As a further description of the above technical solution: The model training system includes a model selection module and a model training module, and both the model selection module and the model training module are bidirectionally connected to the control system.
[0008] As a further description of the above technical solution: The defect detection system includes a defect detection module and an evaluation module 2, and both the defect detection module and the evaluation module 2 are bidirectionally connected to the control system.
[0009] As a further description of the above technical solution: The control system is bidirectionally connected with an antivirus module and an alarm module.
[0010] As a further description of the above technical solution: The control system is bidirectionally connected with a result merging module and a defect locating module.
[0011] As a further description of the above technical solution: The output end signal of the hardware performance detection module is connected to an abnormal alarm module, and the abnormal alarm module is bidirectionally connected to the control system.
[0012] The present invention also provides: Compared with the prior art, the advantages of the present invention are: a positioning method of a software defect automatic detection system based on deep learning, applicable to the above-mentioned software defect automatic detection system based on deep learning, comprising the following steps: S1. First, the data collection module is responsible for collecting a large amount of software code data, including defective and non-defective samples, and the data sources are diverse; S2. Then the data preprocessing module cleans, annotates and extracts features from the collected code data, converting the code into a form suitable for deep learning model processing; S3, then the model selection module selects a suitable model from common deep learning models (such as CNN, RNN and its variants, LSTM, etc.) according to different code data types and defect detection tasks; S4, then the model training module uses the preprocessed data to train the selected model, so that the model learns the mapping relationship between code features and defects; S5. The defect detection module inputs the software code to be detected into the trained model, performs defect analysis and outputs the detection results. In addition to outputting whether there are defects in the code and the possible defect types, it also outputs the location of the defect to achieve the purpose of defect location; S6, Evaluation Module 2 uses the test data set to evaluate the detection results, uses indicators such as accuracy and recall to evaluate model performance, and provides a basis for model optimization, thereby realizing the detection of software defects; S7. During the detection process, the hardware performance detection module monitors the hardware performance of the control system's own equipment in real time, such as CPU usage, memory usage, GPU performance, etc., so as to obtain real-time status information of the hardware and feed this information back to the data segmentation module; S8, the data segmentation module reasonably segments the data to be tested according to the information provided by the hardware performance detection module. If the hardware has a certain margin of data processing capacity, the module will consider the characteristics of the data (such as data type, data volume, etc.) and the processing capacity of the hardware to ensure that the segmented data can be efficiently processed within the margin of the hardware; S9, the detection submodule is then responsible for performing specific detection operations on the segmented data. The detection submodule can be a detection algorithm based on a deep learning model or an algorithm in the above-mentioned defect detection system. The detection submodule and the defect detection system operate independently and process their respective data parts in parallel, thereby improving detection efficiency. S10, the result merging module integrates and processes the detection results of the two detection submodules and the defect detection system; this module will check the consistency of the results, remove duplicate information, and summarize the results into a complete detection report, including defect detection results and location information. Finally, the merged results are output to the user or subsequent processing flow; S11. The defect location module uses the association information between defects and code locations learned by the model based on the merged detection results to accurately locate the specific location of the defect in the code and feeds back the location results to the developer.
[0013] When detecting software defects, the hardware performance of the control system's own equipment can be monitored in real time, and the unused performance margin of the hardware can be used to detect part of the software code, thereby making efficient use of the hardware, reducing hardware waste, and effectively improving the efficiency of software defect detection and positioning. BRIEF DESCRIPTION OF THE DRAWINGS
[0014] Figure 1 It is a structural schematic diagram of the present invention; Figure 2 This is a schematic diagram of the data integration system in the present invention; Figure 3 This is a schematic diagram of the model training system in the present invention; Figure 4 It is the principle diagram of the defect detection system in the present invention.
[0015] Description of the numbers in the figure: 1. Control system; 2. Data integration system; 201. Data collection module; 202. Data preprocessing module; 3. Model training system; 301. Model selection module; 302. Model training module; 4. Defect detection system; 401. Defect detection module; 402. Evaluation module two; 5. Hardware performance detection module; 6. Data segmentation module; 7. Detection submodule; 8. Evaluation module one; 9. Antivirus module; 10. Alarm module; 11. Result merging module; 12. Defect location module; 13. Abnormal alarm module. DETAILED DESCRIPTION
[0016] The technical solutions in the embodiments of the present invention will be described clearly and completely below in conjunction with the accompanying drawings in the embodiments of the present invention; See also Figures 1 to 4 In the present invention: a software defect automatic detection system based on deep learning includes a control system 1, the control system 1 is bidirectionally connected with a data integration system 2, a model training system 3, a defect detection system 4, a hardware performance detection module 5, a data segmentation module 6, a detection submodule 7 and an evaluation module 8; the data integration system 2 includes a data collection module 201 and a data preprocessing module 202, and the data collection module 201 and the data preprocessing module 202 are both bidirectionally connected with the control system 1; the model training system 3 includes a model selection module 301 and a model training module 302, and the model selection module 301 and the model training module 302 are both bidirectionally connected with the control system 1; the defect detection system 4 includes a defect detection module 401 and an evaluation module 402, and the defect detection module 401 and the evaluation module 402 are both bidirectionally connected with the control system 1; the control system 1 is bidirectionally connected with a result merging module 11 and a defect location module 12.
[0017] In the present invention, first, the data collection module 201 is responsible for collecting a large amount of software code data, including defective and non-defective samples, and the data sources are diverse. Then, the data preprocessing module 202 cleans, annotates and extracts features for the collected code data, and converts the code into a form suitable for deep learning model processing. Then, the model selection module 301 selects a suitable model from common deep learning models such as CNN, RNN and its variants, LSTM, etc. according to different code data types and defect detection tasks. Then, the model training module 302 uses the preprocessed data to train the selected model so that the model learns the mapping relationship between code features and defects. The defect detection module 401 inputs the software code to be detected into the trained model, performs defect analysis and outputs the detection results. In addition to outputting whether the code has defects and possible defect types, it also outputs the location of the defect to achieve the purpose of defect locating. The evaluation module 2 402 uses the test data set to evaluate the detection results, uses indicators such as accuracy and recall rate to evaluate the model performance, and provides a basis for model optimization, thereby realizing the detection of software defects.
[0018] During the detection process, the hardware performance detection module 5 monitors the hardware performance of the control system 1's own equipment in real time, such as CPU usage, memory occupancy, GPU performance, etc., so as to obtain real-time status information of the hardware, and feeds this information back to the data segmentation module 6. The data segmentation module 6 reasonably segments the detection data according to the information provided by the hardware performance detection module 5. If the hardware has a certain margin of data processing capacity, the module will consider the characteristics of the data such as data type, data volume, etc. and the processing capacity of the hardware to ensure that the segmented data can be efficiently processed within the hardware margin. The detection submodule 7 is then responsible for performing specific detection operations on the segmented data. The detection submodule 7 can be a detection algorithm based on a deep learning model, or it can be an algorithm in the above-mentioned defect detection system 4. The detection submodule 7 and the defect detection system 4 run independently and process their respective data parts in parallel, thereby improving the detection efficiency. The result merging module 11 integrates and processes the detection results of the two detection submodules 7 and the defect detection system 4. The module will check the consistency of the results, remove duplicate information, and summarize the results into a complete detection report, including defect detection results and positioning information. Finally, the merged result is output to the user or the subsequent processing flow. The defect location module 12 accurately locates the specific location of the defect in the code based on the merged detection results and the association information between the defect and the code location learned by the model, and feeds back the location result to the developer.
[0019] See also Figure 1 , wherein: the control system 1 is bidirectionally connected with an antivirus module 9 and an alarm module 10 .
[0020] In the present invention, the antivirus module 9 can eliminate viruses in the software code, thereby avoiding the occurrence of viruses in the control system 1 and improving the practicality of the device. In addition, when encountering a virus, the alarm module 10 will promptly alarm.
[0021] See also Figure 1 , wherein: the output end signal of the hardware performance detection module 5 is connected to the abnormal alarm module 13, and the abnormal alarm module 13 is bidirectionally connected to the control system 1.
[0022] In the present invention, if the abnormal alarm module 13 detects a problem with the hardware, it will provide feedback to the control system 1, so that the staff can maintain the hardware as soon as possible, reducing the impact of the hardware on the test detection.
[0023] The present invention also provides: a positioning method of a software defect automatic detection system based on deep learning, comprising the following steps: S1. First, the data collection module 201 is responsible for collecting a large amount of software code data, including defective and non-defective samples, and the data sources are diverse; S2, then the data preprocessing module 202 cleans, annotates and extracts features from the collected code data, and converts the code into a form suitable for deep learning model processing; S3, then the model selection module 301 selects a suitable model from common deep learning models such as CNN, RNN and its variants, LSTM, etc. according to different code data types and defect detection tasks; S4, the model training module 302 then uses the preprocessed data to train the selected model, so that the model learns the mapping relationship between code features and defects; S5, the defect detection module 401 inputs the software code to be detected into the trained model, performs defect analysis and outputs the detection results. In addition to outputting whether there is a defect in the code and the possible defect type, it also outputs the location of the defect to achieve the purpose of defect location; S6, the evaluation module 2 402 uses the test data set to evaluate the detection results, uses indicators such as accuracy and recall rate to evaluate model performance, and provides a basis for model optimization, thereby realizing the detection of software defects; S7. During the detection process, the hardware performance detection module 5 monitors the hardware performance of the control system 1 itself in real time, such as CPU usage, memory usage, GPU performance, etc., so as to obtain real-time status information of the hardware, and feeds this information back to the data segmentation module 6; S8, the data segmentation module 6 reasonably segments the data to be tested according to the information provided by the hardware performance detection module 5. If the hardware has a certain margin of data processing capacity, the module will consider the characteristics of the data such as data type, data volume, etc. and the processing capacity of the hardware to ensure that the segmented data can be efficiently processed within the margin of the hardware; S9, the detection submodule 7 is then responsible for performing specific detection operations on the segmented data. The detection submodule 7 can be a detection algorithm based on a deep learning model, or it can be an algorithm in the above-mentioned defect detection system 4, and the detection submodule 7 and the defect detection system 4 operate independently and process their respective data parts in parallel; S10, the result merging module 11 integrates and processes the detection results of the two detection submodules 7 and the defect detection system 4; S11, the defect location module 12 accurately locates the specific location of the defect in the code based on the merged detection results and the association information between the defect and the code location learned by the model, and feeds back the location result to the developer.
[0024] The above are only preferred specific implementations of the present invention; however, the protection scope of the present invention is not limited thereto. Any technician familiar with the technical field can make equivalent replacements or changes according to the technical solutions and improved concepts of the present invention within the technical scope disclosed by the present invention, which should be covered by the protection scope of the present invention.
Claims
1. A software defect automatic detection system based on deep learning, comprising a control system (1), characterized in that: The control system (1) is bidirectionally connected to a data integration system (2), a model training system (3), a defect detection system (4), a hardware performance detection module (5), a data segmentation module (6), a detection submodule (7) and an evaluation module 1 (8).
2. The deep learning-based automatic software defect detection system according to claim 1, characterized in that: The data integration system (2) comprises a data collection module (201) and a data preprocessing module (202), and both the data collection module (201) and the data preprocessing module (202) are bidirectionally connected to the control system (1).
3. The deep learning-based automatic software defect detection system according to claim 1, characterized in that: The model training system (3) comprises a model selection module (301) and a model training module (302), and both the model selection module (301) and the model training module (302) are bidirectionally connected to the control system (1).
4. The deep learning-based automatic software defect detection system according to claim 1, characterized in that: The defect detection system (4) comprises a defect detection module (401) and an evaluation module 2 (402), and both the defect detection module (401) and the evaluation module 2 (402) are bidirectionally connected to the control system (1).
5. The deep learning-based automatic software defect detection system according to claim 1, characterized in that: The control system (1) is bidirectionally connected to a virus-killing module (9) and an alarm module (10).
6. The deep learning-based automatic software defect detection system according to claim 1, characterized in that: The control system (1) is bidirectionally connected to a result merging module (11) and a defect locating module (12).
7. The deep learning-based automatic software defect detection system according to claim 1, characterized in that: The output end signal of the hardware performance detection module (5) is connected to an abnormality alarm module (13), and the abnormality alarm module (13) is bidirectionally connected to the control system (1).
8. A positioning method for a software defect automatic detection system based on deep learning, applicable to a software defect automatic detection system based on deep learning as described in any one of claims 1 to 7, comprising the following steps: S1. First, the data collection module (201) is responsible for collecting a large amount of software code data, including defective and non-defective samples, and the data sources are diverse; S2, then the data preprocessing module (202) cleans, annotates and extracts features from the collected code data, and converts the code into a form suitable for deep learning model processing; S3, then the model selection module (301) selects a suitable model from common deep learning models (such as CNN, RNN and its variants, LSTM, etc.) according to different code data types and defect detection tasks; S4, the model training module (302) then uses the preprocessed data to train the selected model, so that the model learns the mapping relationship between code features and defects; S5, the defect detection module (401) inputs the software code to be detected into the trained model, performs defect analysis and outputs the detection results. In addition to outputting whether there is a defect in the code and the possible defect type, it also outputs the location of the defect to achieve the purpose of defect location; S6. Evaluation module 2 (402) uses the test data set to evaluate the detection results, uses indicators such as accuracy and recall rate to evaluate model performance, and provides a basis for model optimization, thereby realizing the detection of software defects; S7. During the detection process, the hardware performance detection module (5) monitors the hardware performance of the control system (1) itself in real time, such as CPU usage, memory usage, GPU performance, etc., so as to obtain real-time status information of the hardware, and feeds this information back to the data segmentation module (6); S8, the data segmentation module (6) reasonably segments the data to be tested according to the information provided by the hardware performance detection module (5); S9, the detection submodule (7) is then responsible for performing specific detection operations on the segmented data. The detection submodule (7) may be a detection algorithm based on a deep learning model, or may be an algorithm in the above-mentioned defect detection system (4). The detection submodule (7) and the defect detection system (4) operate independently and process their respective data parts in parallel. S10, a result merging module (11) integrates and processes the detection results of the two detection submodules (7) and the defect detection system (4); the module checks the consistency of the results, removes duplicate information, and summarizes the results into a complete detection report, including defect detection results and location information, and finally outputs the merged results to the user or the subsequent processing flow; S11, the defect location module (12) accurately locates the specific location of the defect in the code based on the merged detection results and the correlation information between the defect and the code location learned by the model, and feeds back the location result to the developer.