Method and terminal for automatic repair of program problems

By recording and filtering breakpoint debugging information, the program problem repair process is automatically reproduced, solving the problem of low efficiency for new personnel and achieving fast and accurate program repair.

CN118689683BActive Publication Date: 2025-11-28FUJIAN TIANQUAN EDUCATION TECH LTD
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202410686982.8
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2024-05-30
Publication Date
2025-11-28
Estimated Expiration
2044-05-30

Smart Images

  • Figure CN118689683B_ABST
    Figure CN118689683B_ABST
Patent Text Reader

Abstract

The application discloses an automatic repairing method and terminal for program problems, records breakpoint debugging information in a current debugging round according to a breakpoint debugging instruction, filters an optimal debugging process from all breakpoint debugging information in the current debugging round and configures a label for the optimal debugging process. When a problem label is received, if the label exists in a data source, it indicates that the same program problem has occurred before, the optimal debugging process corresponding to the label can be extracted from the data source, at this time, a new developer can reproduce the debugging steps of the problem locally and knows the real situation of key node data. Through the automatic recording of the problem repairing process data, the problem repairing process can be reproduced automatically again, which can effectively reduce the processing time of new personnel for solving problems and effectively improve the processing efficiency of personnel.
Need to check novelty before this filing date? Find Prior Art

Description

TECHNICAL FIELD

[0001] The present application relates to the technical field of program repair, and particularly relates to an automatic program problem repair method and a terminal. BACKGROUND

[0002] In current Internet systems, various business systems usually exist, and each business system usually has a person in charge who is familiar with the business content of the system. Furthermore, a large system usually has multiple module persons in charge, each of which is only proficient in the own module. When some person in charge is on leave or has temporary business, he / she cannot be responsible for or handle the problem of the own module, and other personnel need to track and handle the problem. At this time, the personnel cannot quickly follow up and solve the problem due to unfamiliarity and lack of relevant knowledge. SUMMARY

[0003] The present application solves the technical problem of providing an automatic program problem repair method and a terminal, which can automatically reproduce the problem repair process and improve the processing efficiency of new personnel in solving program problems.

[0004] To solve the above technical problems, the present application adopts the technical scheme that:

[0005] An automatic program problem repair method comprises the following steps:

[0006] An breakpoint debugging instruction is acquired, and breakpoint debugging information in a current debugging round is recorded according to the breakpoint debugging instruction;

[0007] An optimal debugging process is screened from all breakpoint debugging information in the current debugging round, and a corresponding first problem label is configured for the optimal debugging process. The optimal debugging process and the first problem label are stored in a data source;

[0008] A second problem label is received, and it is judged whether the second problem label exists in the data source. If yes, the corresponding optimal debugging process is called according to the second problem label, and breakpoint filling and debugging repair of a program corresponding to the second problem are automatically performed according to the optimal debugging process.

[0009] To solve the above technical problems, the present application adopts another technical scheme that:

[0010] An automatic program problem repair terminal comprises a memory, a processor and a computer program stored in the memory and capable of running on the processor. The processor implements each step of the above automatic program problem repair method when executing the computer program.

[0011] The present application has the beneficial effect that breakpoint debugging information in the current debugging round is recorded according to breakpoint debugging instructions, and the optimal debugging process is screened from all breakpoint debugging information in the current debugging round and is configured with a label. When a problem label is received, if the label exists in the data source, it indicates that the same program problem has occurred before, and the optimal debugging process corresponding to the label can be extracted from the data source. At this time, the new developer can reproduce the debugging steps of the problem locally and know the true situation of the key node data. By automatically recording the data of the problem repair process, the problem repair process can be automatically reproduced again, which can effectively reduce the processing time of new personnel to solve the problem and effectively improve the personnel processing efficiency. BRIEF DESCRIPTION OF DRAWINGS

[0012] Figure 1 A flowchart of a program problem automatic repair method according to an embodiment of the present application;

[0013] Figure 2 A schematic diagram of a program problem automatic repair terminal according to an embodiment of the present application;

[0014] REFERENCE NUMERALS

[0015] 1. A program problem automatic repair terminal; 2. a memory; 3. a processor. DETAILED DESCRIPTION

[0016] To explain the technical content, the achieved purposes and effects of the present application in detail, the following will be described in combination with the embodiments and the accompanying drawings.

[0017] Please refer to Figure 1 The present application provides a program problem automatic repair method, which comprises the following steps:

[0018] Obtaining breakpoint debugging instructions, and recording breakpoint debugging information in the current debugging round according to the breakpoint debugging instructions;

[0019] Screening the optimal debugging process from all breakpoint debugging information in the current debugging round, and configuring the optimal debugging process with a corresponding first problem label, and storing the optimal debugging process and the first problem label in a data source;

[0020] Receiving a second problem label, and judging whether the second problem label exists in the data source. If yes, the corresponding optimal debugging process is called according to the second problem label, and breakpoint filling and debugging repair of the program corresponding to the second problem are automatically performed according to the optimal debugging process.

[0021] From the above description, the beneficial effects of the present application are that: according to the breakpoint debugging instruction, breakpoint debugging information in the current debugging round is recorded, and the optimal debugging process is screened from all breakpoint debugging information in the current debugging round and is configured with a label. When a problem label is received, if the label exists in the data source, it indicates that the same program problem has occurred before, and the optimal debugging process corresponding to the label can be extracted from the data source. At this time, the new developer can reproduce the debugging steps of the problem and know the true situation of the key node data. By automatically recording the data of the problem repair process, the problem repair process can be automatically reproduced again, which can effectively reduce the processing time of new personnel to solve the problem and effectively improve the personnel processing efficiency.

[0022] Further, according to the breakpoint debugging instruction, breakpoint debugging information in the current debugging round is recorded, and the optimal debugging process is screened from all breakpoint debugging information in the current debugging round and is configured with a label. When a problem label is received, if the label exists in the data source, it indicates that the same program problem has occurred before, and the optimal debugging process corresponding to the label can be extracted from the data source. At this time, the new developer can reproduce the debugging steps of the problem and know the true situation of the key node data. By automatically recording the data of the problem repair process, the problem repair process can be automatically reproduced again, which can effectively reduce the processing time of new personnel to solve the problem and effectively improve the personnel processing efficiency.

[0023] When the breakpoint debugging instruction is obtained, all breakpoint debugging information in the current debugging round is obtained, and the breakpoint debugging information includes the number of breakpoints in a debugging process, the breakpoint position, the file path and the file name corresponding to the breakpoint, and the debugging repair result.

[0024] From the above description, the breakpoint information and the debugging repair result of each debugging process in each debugging are recorded, which facilitates the reproduction of the debugging process based on the recorded content.

[0025] Further, from all breakpoint debugging information in the current debugging round, the optimal debugging process is screened, and the screening includes:

[0026] The scores of all breakpoint debugging information in the current debugging round are calculated.

[0027] If only one breakpoint debugging information has the highest score, the breakpoint debugging information is the optimal debugging process, otherwise, the breakpoint debugging information with the highest score and the closest execution time to the current time is taken as the optimal debugging process.

[0028] Further, the scores of all breakpoint debugging information in the current debugging round are calculated, and the calculation includes:

[0029] If the debugging process corresponding to the breakpoint debugging information is not executed, a first score is returned;

[0030] If the debugging process corresponding to the breakpoint debugging information is executed and the debugging repair result is incorrect, a second score is returned;

[0031] If the debugging process corresponding to the breakpoint debugging information is executed and the debugging repair result is correct, a third score is returned;

[0032] The first score is less than the second score, and the second score is less than the third score.

[0033] From the above description, for each debugging process, the corresponding score is set according to the preset rule, and the breakpoint debugging information of the debugging process with the highest score is selected as the optimal debugging process according to the ranking of the final scores, thereby ensuring the reliability of subsequent debugging reproduction.

[0034] Further, the breakpoint filling and debugging repair of the program corresponding to the second problem are automatically performed according to the optimal debugging process, including:

[0035] The number of breakpoints, the breakpoint position, the file path and the file name corresponding to the breakpoint in the optimal debugging process are obtained and parsed, and the breakpoint position includes the code hash value of the code line where the breakpoint is located.

[0036] According to the breakpoint position of each breakpoint, the breakpoint in the optimal debugging process is added to the corresponding position of the program corresponding to the second problem, and the corresponding file path and file name are configured for the breakpoint:

[0037] According to the breakpoint position of each breakpoint, the code line with the same code hash value in the program corresponding to the second problem is searched, and the breakpoint is added to the corresponding position of the code line in the program corresponding to the second problem;

[0038] The debugger is started to perform debugging repair on the program corresponding to the second problem.

[0039] From the above description, for the same program problem, the optimal debugging process is searched according to the label, and the breakpoint position of the optimal debugging process in the current program can be dynamically determined, thereby improving the filling efficiency of the debugging breakpoint.

[0040] Please refer to Figure 2 Another embodiment of the present application provides an automatic repair terminal for program problems, which comprises a memory, a processor, and a computer program stored in the memory and executable on the processor, and the processor implements each step of the above-mentioned automatic repair method for program problems when executing the computer program.

[0041] The above-mentioned automatic repair method and terminal for program problems are suitable for automatically reproducing the problem repair process, and improve the processing efficiency of new personnel in solving program problems, which will be described below through specific embodiments.

[0042] Embodiment one

[0043] Please refer to Figure 1 An automatic repair method for program problems comprises the following steps:

[0044] S1, a breakpoint debugging instruction is obtained, and breakpoint debugging information in the current debugging round is recorded according to the breakpoint debugging instruction.

[0045] In the embodiment, first, the developers of the front end and the back end need to unify the development environment, such as the back end personnel uniformly developing by using IDEA, and the front end personnel uniformly developing by using Visual Studio. For the same development environment, the embodiment proposes a new debugging storage plug-in. The development process of the plug-in is similar to the common plug-in process. After being developed and published to the corresponding plug-in platform, the rest of the developers can quickly download and automatically install the debugging storage plug-in. When the developer downloads the plug-in, in the process of local breakpoint debugging, the plug-in automatically pays attention to the breakpoint situation.

[0046] Specifically, when the breakpoint debugging instruction is acquired, all breakpoint debugging information in the current debugging round is acquired. The breakpoint debugging information includes the number of breakpoints in a debugging process, the breakpoint position, the file path and the file name corresponding to the breakpoint, and the debugging repair result.

[0047] In the embodiment, the developer adds multiple breakpoints in each debugging process. When each debugging ends, the plug-in automatically acquires the breakpoint information of the current debugging process, mainly including the following: the number of breakpoints, the file path corresponding to each breakpoint, the file name [including the file suffix], and the position of the breakpoint (that is, which line in the code). Then, the plug-in automatically uploads and stores the collected information of the current round to the corresponding data source.

[0048] S2, from all breakpoint debugging information in the current debugging round, the optimal debugging process is screened, and the corresponding first problem label is configured for the optimal debugging process. The optimal debugging process and the first problem label are stored in the data source.

[0049] Specifically, all breakpoint debugging information in the current debugging round is scored.

[0050] If the debugging process corresponding to the breakpoint debugging information is not executed, the first score is returned; if the debugging process corresponding to the breakpoint debugging information is executed and the debugging repair result is incorrect, the second score is returned; if the debugging process corresponding to the breakpoint debugging information is executed and the debugging repair result is correct, the third score is returned.

[0051] The first score is less than the second score, and the second score is less than the third score.

[0052] If there is only one breakpoint debugging information with the highest score, the breakpoint debugging information is the optimal debugging process, otherwise, the breakpoint debugging information with the highest score and the closest execution time to the current time is taken as the optimal debugging process.

[0053] In the embodiment, for each debugging process, a corresponding score can be set according to preset rules, and the process with the highest score is selected as the optimal way. The preset rules for calculating the score can be as follows:

[0054] (1) If there are multiple breakpoints, the score is 0 when one breakpoint is not executed, or the score is 0 when the final overall program is not executed and there is no return value.

[0055] (2) If the final overall program has been executed, but the output data is incorrect, the score is 5.

[0056] (3) If the final overall program has been executed and the result is correct, the score is 10.

[0057] When the scores of multiple debugging processes are the same, the process with the closest execution time to the present time is selected, and a corresponding problem name or label is set.

[0058] Therefore, if the problem occurs for the first time, the breakpoint debugging is passed for 5 times, and the program is successfully executed after the 5th modification, when similar problems occur in subsequent codes, such as similar problems in other code branches, the same program repair can be directly performed according to the breakpoint logic of this time.

[0059] S3, receiving a second problem label, judging whether the second problem label exists in the data source, if yes, calling the corresponding optimal debugging process according to the second problem label, and automatically performing breakpoint filling and debugging repair of the program corresponding to the second problem according to the optimal debugging process.

[0060] Specifically, the number of breakpoints, breakpoint positions, file paths and file names corresponding to the breakpoints in the optimal debugging process are obtained and parsed, and the breakpoint positions include the code hash value of the code line where the breakpoint is located.

[0061] According to the breakpoint positions of the breakpoints, the breakpoints in the optimal debugging process are added to the corresponding positions of the program corresponding to the second problem, and the corresponding file paths and file names are configured for the breakpoints:

[0062] According to the breakpoint positions of the breakpoints, the code lines with the same code hash value in the program corresponding to the second problem are searched, and the breakpoints are added to the corresponding positions of the code lines in the program corresponding to the second problem.

[0063] Starting the debugger to debug and repair the program corresponding to the second problem.

[0064] In the embodiment, when a new developer intervenes in the system, the debugging plug-in can acquire historical debugging information from the data source, and can search the debugging content according to the current problem description or the tag and other related information, and when the debugging content is searched, the breakpoint information is automatically filled into the local development software. When the new developer starts the project locally, the debugging is automatically performed according to the breakpoint debugging information that has been filled, and the real-time data of the key steps can be conveniently viewed.

[0065] Specifically, according to the class name + method name, the specific method can be located, at this time, according to the keyword to query which line, there can be multiple lines, therefore, in the embodiment, the record of an entire code line is subjected to hash calculation, the calculated hash values are compared, and when the hash values are equal, the corresponding position of the added breakpoint can be confirmed.

[0066] In the embodiment, the program is simulated and repaired in a dynamic running mode.

[0067] Embodiment Two

[0068] Please refer to Figure 2 An automatic repair terminal 1 of a program problem, comprising a memory 2, a processor 3, and a computer program stored in the memory 2 and capable of running on the processor 3, and each step of the automatic repair method of the program problem of the embodiment is realized when the processor 3 executes the computer program.

[0069] In summary, the automatic repair method and the terminal of the program problem provided by the application add a debugging plug-in in the development software commonly used by the developer, automatically collect the breakpoint information into a unified data source during the process of the breakpoint debugging of the developer locally for a problem, and when the problem is repaired, the developer can uniformly manage the data of the breakpoint debugging process through a management interface, and select a suitable process as an optimal debugging process. When a new developer intervenes, the debugging plug-in can quickly acquire the related optimal debugging process from the data source for a certain type or a certain problem, at this time, the new developer can reproduce the debugging steps of the problem locally, and knows the real situation of the key node data. Through the automatic recording of the data of the problem repair process, the problem repair process can be reproduced again, the processing time of the new personnel for solving the problem can be effectively reduced, and the personnel efficiency can be effectively improved.

[0070] The above merely illustrates the embodiments of the present application, and is not intended to limit the patent scope of the present application. Any equivalent transformation or direct or indirect application in the related technical field based on the content of the present application specification and drawings is also included in the patent protection scope of the present application.

Claims

1. An automatic repair method for program problems, characterized in that, Including the following steps: Obtain breakpoint debugging instructions, and record breakpoint debugging information in the current debugging round according to the breakpoint debugging instructions; Filter the optimal debugging process from all breakpoint debugging information in the current debugging round, configure the corresponding first problem label for the optimal debugging process, and store the optimal debugging process and its first problem label in the data source. Receive the second problem tag, determine whether the second problem tag exists in the data source, if so, retrieve the corresponding optimal debugging process according to the second problem tag, and automatically perform breakpoint filling and debugging repair of the program corresponding to the second problem according to the optimal debugging process.

2. The automatic repair method for program problems according to claim 1, characterized in that, Record the breakpoint debugging information in the current debugging round according to the breakpoint debugging instructions, including: When a breakpoint debugging instruction is received, all breakpoint debugging information in the current debugging round is obtained. The breakpoint debugging information includes the number of breakpoints in a debugging process, the breakpoint location, the file path and file name corresponding to the breakpoint, and the debugging and repair results.

3. The automatic repair method for program problems according to claim 2, characterized in that, Filter the optimal debugging process from all breakpoint debugging information in the current debugging round, including: Score the debugging information for all breakpoints in the current debugging round; If only one breakpoint debugging information has the highest score, then that breakpoint debugging information is the optimal debugging process; otherwise, the breakpoint debugging information with the highest score and the execution time closest to the current time is taken as the optimal debugging process.

4. The automatic repair method for program problems according to claim 3, characterized in that, Scoring is performed on all breakpoint debugging information in the current debugging round, including: If the debugging process corresponding to the breakpoint debugging information has not been completed, the first score is returned; If the debugging process corresponding to the breakpoint debugging information is completed and the debugging and repair results are incorrect, then the second score is returned. If the debugging process corresponding to the breakpoint debugging information is completed and the debugging and repair results are correct, then the third score is returned. The first score is less than the second score, and the second score is less than the third score.

5. The automatic repair method for program problems according to claim 2, characterized in that, The optimal debugging process is used to automatically fill breakpoints and debug and repair the program corresponding to the second problem, including: Obtain and parse the number of breakpoints, breakpoint locations, file paths and filenames corresponding to the breakpoints in the optimal debugging process, wherein the breakpoint location includes the code hash value of the line of code where the breakpoint is located; Based on the breakpoint locations, add the breakpoints in the optimal debugging process to the corresponding locations in the program corresponding to the second problem, and configure the corresponding file paths and filenames for the breakpoints: Based on the breakpoint locations of each breakpoint, find the line of code with the same code hash value in the program corresponding to the second problem, and add the breakpoint to the corresponding line of code in the program corresponding to the second problem; Start the debugger to debug and repair the program corresponding to the second problem.

6. An automatic repair terminal for program problems, comprising a memory, a processor, and a computer program stored in the memory and executable on the processor, characterized in that, When the processor executes the computer program, it performs the following steps: Obtain breakpoint debugging instructions, and record breakpoint debugging information in the current debugging round according to the breakpoint debugging instructions; Filter the optimal debugging process from all breakpoint debugging information in the current debugging round, configure the corresponding first problem label for the optimal debugging process, and store the optimal debugging process and its first problem label in the data source. Receive the second problem tag, determine whether the second problem tag exists in the data source, if so, retrieve the corresponding optimal debugging process according to the second problem tag, and automatically perform breakpoint filling and debugging repair of the program corresponding to the second problem according to the optimal debugging process.

7. An automatic repair terminal for program problems according to claim 6, characterized in that, Record the breakpoint debugging information in the current debugging round according to the breakpoint debugging instructions, including: When a breakpoint debugging instruction is received, all breakpoint debugging information in the current debugging round is obtained. The breakpoint debugging information includes the number of breakpoints in a debugging process, the breakpoint location, the file path and file name corresponding to the breakpoint, and the debugging and repair results.

8. An automatic repair terminal for program problems according to claim 7, characterized in that, Filter the optimal debugging process from all breakpoint debugging information in the current debugging round, including: Score the debugging information for all breakpoints in the current debugging round; If only one breakpoint debugging information has the highest score, then that breakpoint debugging information is the optimal debugging process; otherwise, the breakpoint debugging information with the highest score and the execution time closest to the current time is taken as the optimal debugging process.

9. An automatic repair terminal for program problems according to claim 8, characterized in that, Scoring is performed on all breakpoint debugging information in the current debugging round, including: If the debugging process corresponding to the breakpoint debugging information has not been completed, the first score is returned; If the debugging process corresponding to the breakpoint debugging information is completed and the debugging and repair results are incorrect, then the second score is returned. If the debugging process corresponding to the breakpoint debugging information is completed and the debugging and repair results are correct, then the third score is returned. The first score is less than the second score, and the second score is less than the third score.

10. An automatic repair terminal for program problems according to claim 7, characterized in that, The optimal debugging process is used to automatically fill breakpoints and debug and repair the program corresponding to the second problem, including: Obtain and parse the number of breakpoints, breakpoint locations, file paths and filenames corresponding to the breakpoints in the optimal debugging process, wherein the breakpoint location includes the code hash value of the line of code where the breakpoint is located; Based on the breakpoint locations, add the breakpoints in the optimal debugging process to the corresponding locations in the program corresponding to the second problem, and configure the corresponding file paths and filenames for the breakpoints: Based on the breakpoint locations of each breakpoint, find the line of code with the same code hash value in the program corresponding to the second problem, and add the breakpoint to the corresponding line of code in the program corresponding to the second problem; Start the debugger to debug and repair the program corresponding to the second problem.

Citation Information

Patent Citations

  • Program debugger and program debugging method

    CN104346274A

  • Program debugging method, program backtracking method and related products

    CN115827418A