CN-121996540-A - Code change information processing method, apparatus, device, storage medium, and program product
Abstract
The embodiment of the application provides a code change information processing method, a device, equipment, a storage medium and a program product. Belonging to the technical field of data processing. The method comprises the steps of responding to a test information acquisition request aiming at a modified file, acquiring a file change record, acquiring a call chain map, determining an affected path and a corresponding responsible person of the code change according to the call relation of a method in the code and the corresponding modifier, modification time and modification content of the modified file each time, and outputting the affected path and the responsible person of the code change, wherein the file change record comprises a modifier, modification time and modification content corresponding to the modified file. The method solves the problems that the allocation of test resources is unreasonable, the test cost is obviously increased, and the code responsible person is difficult to quickly locate.
Inventors
- ZHANG JIAJIE
- YU JICHENG
- LONG JIAHAO
Assignees
- 中国人民财产保险股份有限公司
Dates
- Publication Date
- 20260508
- Application Date
- 20251217
Claims (11)
- 1. A code change information processing method, comprising: Responding to a test information acquisition request for a modified file, and acquiring a file change record, wherein the file change record comprises a modifier, modification time and modification content corresponding to the modified file; Acquiring a calling chain map, wherein the calling chain map comprises calling relations of methods in codes; Determining an affected path and a corresponding responsible person of the code change according to the calling relation of the method in the code and the corresponding modifier, modification time and modification content of the modified file each time; Outputting the affected path of the code change and the responsible person.
- 2. The method according to claim 1, wherein the determining the affected path of the code change and the corresponding responsible person according to the calling relation of the method in the code and the modified file each time the corresponding modifier, the modification time, and the modification content comprises: Searching the calling relation according to the modification content corresponding to the modified file to obtain an affected path; and determining the responsible person according to the modifier, the modification time and the modification content corresponding to the modified file.
- 3. The method according to claim 2, wherein the determining the responsible person according to the modifier, the modification time, and the modification content corresponding to the modified file includes: counting the number of modification times corresponding to the modifier; And determining the responsible person according to the modification times, the modification time and the modification content corresponding to the modifier.
- 4. The method of claim 3, wherein the determining the responsible person according to the number of modifications, the modification time, and the modification content corresponding to the modifier comprises: Determining a submission time value corresponding to the modifier according to the modification time corresponding to the modifier; Determining a secondary value corresponding to the modifier according to the number of modification times corresponding to the modifier; Counting the number of modification lines in the modification content corresponding to the modifier; Determining a row value corresponding to the modifier according to the number of the modified rows; Determining a comprehensive score corresponding to the modifier according to the submitting time value, the secondary value and the line number value; and determining the modifier with the maximum comprehensive score as the responsible person.
- 5. The method of claim 4, wherein the determining the commit time value corresponding to the modifier according to the modification time corresponding to the modifier comprises: If the modification time corresponding to the target modifier is earliest, determining the score of the creator as the submission time value corresponding to the target modifier; if the modification time corresponding to the target modifier is the latest, determining the final modifier score as a submission time value corresponding to the target modifier; and if the modification time corresponding to the target modifier is not earliest or latest, determining the common modifier score as the submission time value corresponding to the target modifier.
- 6. The method of claim 4, wherein determining the composite score corresponding to the modifier based on the commit time value, the secondary value, and the number of lines comprises: And carrying out weighted summation on the submitting time value, the secondary value and the line number value to obtain the comprehensive score corresponding to the modifier.
- 7. The method of claim 6, wherein the weighting and summing the commit time value, the secondary value, and the line number value to obtain a composite score corresponding to the modifier comprises: Acquiring a project risk level and a team cooperation mode corresponding to the modified file; and determining the submission time weight corresponding to the submission time value according to the project risk level and the team cooperation mode.
- 8. A code change information processing apparatus, comprising: The system comprises a record acquisition module, a file modification module and a file modification module, wherein the record acquisition module is used for acquiring a file modification record in response to receiving a test information acquisition request for a modified file, and the file modification record comprises a modifier, modification time and modification content corresponding to the modified file; The map acquisition module is used for acquiring a calling chain map, wherein the calling chain map comprises calling relations of methods in codes; The information determining module is used for determining an affected path of the code change and a corresponding responsible person according to the calling relation of the method in the code and the corresponding modifier, the modification time and the modification content of the modified file each time; And the information output module is used for outputting the affected path of the code change and the responsible person.
- 9. An electronic device is characterized by comprising a memory and a processor; The memory stores computer-executable instructions; The processor executing computer-executable instructions stored in the memory, causing the processor to perform the method of any one of claims 1 to 7.
- 10. A computer readable storage medium having stored therein computer executable instructions which when executed by a processor are adapted to carry out the method of any one of claims 1 to 7.
- 11. A computer program product comprising a computer program which, when executed by a processor, implements the method of any one of claims 1 to 7.
Description
Code change information processing method, apparatus, device, storage medium, and program product Technical Field The present application relates to the field of data processing technologies, and in particular, to a method, an apparatus, a device, a storage medium, and a program product for processing code change information. Background In the field of software development, particularly in modern enterprise systems employing micro-service architecture and agile development modes, frequent iterative and multi-person collaborative development of code has become a norm. Taking an enterprise-level application system (such as a marketing management platform) as an example, a hierarchical architecture design (foreground, middle stage, background) is generally adopted, the foreground is responsible for user interaction, the middle stage processes core business logic, and the background manages data storage. Currently, in the related art, a tester usually depends on manual experience or simply submits a record query to judge the test range, so that the test efficiency is low and the omission risk is high. However, the inventor finds that the related technology has at least the following technical problems that the influence of code change on the whole call chain cannot be dynamically analyzed at present, so that the test resource allocation is unreasonable, the test cost is obviously increased, and the code responsible person is difficult to quickly locate. Disclosure of Invention The embodiment of the application provides a code change information processing method, a device, equipment, a storage medium and a program product, which are used for solving the problems that test resource allocation is unreasonable, test cost is obviously increased, and code responsibility people are difficult to quickly locate. In a first aspect, an embodiment of the present application provides a method for processing code change information, including obtaining a file change record in response to receiving a test information obtaining request for a modified file, where the file change record includes a modifier, a modification time, and a modification content corresponding to the modified file, obtaining a call chain map, where the call chain map includes a call relationship of a method in a code, determining an affected path and a corresponding responsible person for the code change according to the call relationship of the method in the code and the modifier, the modification time, and the modification content corresponding to each modification of the modified file, and outputting the affected path and the responsible person for the code change. In one possible implementation, the method comprises the steps of determining an affected path and a corresponding responsible person of code change according to the calling relation of a method in a code and the corresponding modifier, the modification time and the modification content of a modified file each time, searching the calling relation according to the modification content corresponding to the modified file to obtain the affected path, and determining the responsible person according to the modifier, the modification time and the modification content corresponding to the modified file. In one possible implementation, determining the responsible person according to the modifier, the modification time and the modification content corresponding to the modified file comprises counting the modification times corresponding to the modifier, and determining the responsible person according to the modification times, the modification time and the modification content corresponding to the modifier. In one possible implementation, the determination of the responsible person is performed according to the number of modifications, the modification time and the modification content corresponding to the modifier, and comprises the steps of determining a submitting time value corresponding to the modifier according to the modification time corresponding to the modifier, determining a number of times value corresponding to the modifier according to the number of modifications corresponding to the modifier, counting the number of modified lines in the modification content corresponding to the modifier, determining a number of lines value corresponding to the modifier according to the number of modified lines, determining an integrated score corresponding to the modifier according to the submitting time value, the number of times value and the number of lines value, and determining the modifier with the maximum integrated score as the responsible person. In one possible implementation, determining the time value of the submission corresponding to the modifier according to the modification time corresponding to the modifier includes determining the creator score as the time value of the submission corresponding to the target modifier if the modification time corresponding to the target modifier is e