A software development code quality evaluation method and system based on big data processing

CN123030478APending Publication Date: 2026-11-03BEIJING STAR CUBE CLOUD TECH CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202611233834.6
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2026-08-14
Publication Date
2026-11-03

AI Technical Summary

Technical Problem

Existing code quality assessment methods are difficult to accurately correspond to the same program structure in adjacent versions and cannot continuously record the impact propagation status of different dependencies in consecutive code commits. This makes it difficult to locate the source of code anomalies, the scope of impact, and the path of quality impact, thus reducing the efficiency of code review and defect investigation.

Method used

By constructing the code change impact path and combining it with the improved TGN model, a node-edge operator recursive structure is used to synchronously update the code node state and the directed edge propagation operator, forming the code node quality impact residual and the directed edge quality impact residual. This can simultaneously locate the source of the anomaly, the location of the affected code, and the program dependency propagation path, reducing the scope of manual verification.

Benefits of technology

It improves the accuracy of code quality anomaly location and path interpretation capabilities, narrows the scope of quality assessment, reduces the workload of manual verification, and improves the efficiency of code review and defect investigation.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN123030478A_ABST
    Figure CN123030478A_ABST
Patent Text Reader

Abstract

The application discloses a software development code quality evaluation method and system based on big data processing and relates to the technical field of software development quality management, and comprises the following steps: S1, obtaining software development process associated data and establishing a program structure corresponding relationship between adjacent code versions; S2, merging into a code change unit; S3, forming a code change influence path; S4, constructing an unclosed quality influence graph; S5, forming a cross-version quality influence state sequence; S6, inputting the cross-version quality influence state sequence into an improved TGN model to form a quality influence residual error; and S7, corresponding the quality influence residual error to the code change unit and the code change influence path to form a software development code quality evaluation result. The application can realize cross-version code quality influence tracking and accurate positioning of an abnormal transmission path.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This invention relates to the field of software development quality management technology, and in particular to a method and system for evaluating the quality of software development code based on big data processing. Background Technology

[0002] As software scales and code version iterations increase, a single code commit can simultaneously impact multiple program structures, including function calls, variable passing, and control branches. Current code quality assessments typically rely on code complexity, defect rules, test coverage, and verification conclusions, performing static analysis or statistical analysis of the current code version. When code changes span multiple versions and propagate along program dependencies, existing methods struggle to accurately correspond to the same program structure in adjacent versions, and also fail to determine the correlation between verification failures or coverage gaps and specific code changes. Furthermore, traditional sequence graph models primarily update code node states, with program dependency edges typically only acting as connections in message passing. They cannot continuously record the impact propagation status of different dependencies in consecutive code commits, making it difficult to simultaneously pinpoint the source of code anomalies, the affected scope, and the path of quality impact. This still requires developers to inspect numerous code units, reducing the efficiency of code review and defect detection.

[0003] Therefore, how to provide a software development code quality assessment method and system based on big data processing is a problem that urgently needs to be solved by those skilled in the art. Summary of the Invention

[0004] One objective of this invention is to propose a software development code quality assessment method and system based on big data processing. This invention connects adjacent code versions through program structure correspondences, merging logically related code changes into code change units, and constructing code change impact paths along function call relationships, variable definition-usage relationships, and control dependencies. After verifying the execution trajectory's reflection back to the code change impact path, verified path segments are excluded, and unclosed path segments are organized into an unclosed quality impact graph, thereby narrowing the scope of quality assessment. The improved TGN model employs a node-edge operator recursive structure to synchronously update code node states and directed edge propagation operators, enabling program dependency edges to preserve cross-version state propagation relationships. The low-rank write-back path of node residuals further writes node state changes not explained by existing program dependencies into the corresponding directed edge propagation operators. The resulting code node quality impact residuals and directed edge quality impact residuals can simultaneously correspond to the source of code changes, affected code units, and program dependency propagation locations, improving the accuracy of code quality anomaly localization, path interpretation capability, and cross-version state continuity.

[0005] A software development code quality assessment method based on big data processing according to an embodiment of the present invention includes the following steps: S1. Obtain relevant data in the software development process and establish the program structure correspondence between adjacent code versions according to the code submission order; S2. Compare the differences of program structures with corresponding relationships, and merge code changes belonging to the same program structure and having a logical succession relationship into code change units. S3. Trace the affected code units from the code change unit along the program dependency relationship, and connect the code change unit and the affected code units according to the direction of code change propagation to form the code change impact path; S4. Reflect the code quality verification results back to the code change impact path, divide the verification closed section and unclosed section of the code change impact path according to the reflection results, and construct an unclosed quality impact diagram from the unclosed section; S5. Connect the unclosed influence states of the same code unit in adjacent code versions according to the correspondence of program structure, and arrange the code node states and directional edge propagation operators along the program dependency direction to form a cross-version quality influence state sequence. S6. Input the cross-version quality impact state sequence into the improved TGN model, replace the node single memory update structure with the node-edge operator recursive structure, and convert the node unabsorbed state difference into a low-rank correction matrix and write it into the corresponding directional edge propagation operator to form the quality impact residual. S7. Map the quality impact residuals to code change units and code change impact paths to form software development code quality assessment results.

[0006] Optionally, S1 includes: S11. Obtain code version data, code commit records, and code quality verification results. Bind the commit identifier to the corresponding code version data and code quality verification results, and sort the code versions according to the code repository, development branch, and commit order. S12. Perform syntax parsing on each code version and construct an abstract syntax tree. Divide the program structure according to the hierarchical relationship of files, classes, functions and program blocks, and extract the declaration information, hierarchical path and syntax node sequence of each program structure. S13. Establish a direct correspondence for program structures with consistent declaration information and hierarchical paths in adjacent code versions. Establish a migration correspondence for the remaining program structures to be matched using the abstract syntax tree matching method. Mark program structures in the previous code version that did not have a corresponding relationship as deleted program structures, and mark program structures in the subsequent code version that did not have a corresponding relationship as newly added program structures.

[0007] Optionally, S2 includes: S21. The abstract syntax tree difference method is used to compare program structures with direct or migration correspondences to locate the syntax nodes for insertion, deletion, update and movement. S22. Map the difference results of the syntax nodes to the original code locations, and group the difference results that belong to the same program structure and have continuous code ranges, share the same upper-level syntax node, or are located in the same control branch into the same change group. S23. Merge the code content before and after the change corresponding to the same change group, retain the correspondence between the code before and after the change and the program structure, and form a code change unit.

[0008] Optionally, S3 includes: S31. Based on the abstract syntax tree and control flow graph of each code version, extract function call relationships, variable definition-usage relationships and control dependencies, construct a directed program dependency graph, and map code change units to the starting code units in the directed program dependency graph; S32. Perform a breadth-first traversal along the outgoing dependency edges of the directed program dependency graph from the starting code unit to determine the directly affected code units and indirectly affected code units, and record the predecessor code unit and dependency edge of each affected code unit. S33. Backtrack along the predecessor code unit and the dependency edge to the starting code unit, and arrange the code change units and affected code units according to the direction of dependency edge propagation to form the code change impact path.

[0009] Optionally, S4 includes: S41. Perform code coverage tracing during the code quality verification process, record the actual program structure, execution order, and verification conclusions, and form a verification execution trajectory; S42. Using the correspondence of program structure, the verification execution trajectory is mapped to the code change impact path. Path segments that are continuously distributed along the same code change impact path, have completed execution coverage, and have all verification conclusions of "pass" are marked as verification closed segments. Path segments that have not completed execution coverage or whose verification conclusions include "fail" are marked as unclosed segments. S43. Preserve the code units and program dependencies in the unclosed sections, merge duplicate code units and directed connections, and construct an unclosed quality impact graph.

[0010] Optionally, S5 includes: S51. Based on the correspondence of program structure, connect code nodes belonging to the same code unit in the unclosed quality influence diagram of adjacent code versions, and arrange the unclosed influence status of each code node according to the code submission order. S52. Perform vectorized mapping on the unclosed influence state of the code node to form the code node state; encode the program dependency type, propagation direction and unclosed influence state of the directional edge, set the row position according to the target code node state dimension, set the column position according to the source code node state dimension, and assemble the encoding result into the directional edge propagation operator; S53. Arrange the code node states and directional edge propagation operators of each code version according to the code submission order, and arrange them according to the program dependency direction within the same code version to form a cross-version quality impact state sequence.

[0011] Optionally, the improved TGN model includes a message function, a message aggregator, a node-edge operator recursive structure, a node residual low-rank write-back path, and a graph embedding module; The message function converts the cross-version quality impact state sequence into node time-series messages and edge time-series messages. The message aggregator collects node time-series messages and edge time-series messages according to code nodes and directed edges, respectively. The node-edge operator recursive structure updates the directed edge propagation operator based on the edge time sequence message. The updated directed edge propagation operator forms the edge propagation component and propagation coefficient of each incoming directed edge, and recursively updates the code node state. The low-rank write-back path of node residuals deducts the node update component reconstructed by the edge-transmitted component from the node time-series message to form the node unabsorbed state difference. The node unabsorbed state difference is used as a column vector. The corresponding source code node state is transposed into a row vector and an outer product is performed. The outer product result is adjusted according to the corresponding transmission coefficient to form a low-rank correction matrix corresponding to the row and column of the directional edge-transmitting operator. The low-rank correction matrix is ​​then written into the corresponding directional edge-transmitting operator. The graph embedding module performs embedding mapping on the updated code node state and the directed edge transfer operator that has completed low-rank correction, according to the correspondence between code nodes and directed edges, to form quality influence residuals corresponding to code nodes and directed edges respectively.

[0012] Optionally, the node-edge operator recursive structure updates the directed edge propagation operator based on the edge timing message, and recursively updates the code node state through the updated directed edge propagation operator, including: Read the directional edge passing operator at the previous code commit time and the edge timing message at the current code commit time. Project the edge timing message into the source side correction vector and the target side correction vector respectively. Use the target side correction vector as a column vector. Transpose the source side correction vector into a row vector and perform an outer product to form the operator increment matrix. Write the operator increment matrix into the directional edge passing operator at the previous code commit time to form the directional edge passing operator at the current code commit time. Perform matrix multiplication between the directional edge passing operator at the current code commit time and the node state of the source code node at the previous code commit time to form the edge passing component that is passed to the target code node along the corresponding directional edge; The edge transmission components of each incoming directed edge are collected according to the target code node. The edge transmission components are arranged in columns to form an incoming transmission matrix. The node time sequence message of the target code node is projected into the column space of the incoming transmission matrix using the regularized least squares projection method to obtain the transmission coefficient of each incoming directed edge. The corresponding edge transmission components are scaled according to each transmission coefficient, and the scaled edge transmission components are merged to form the node update components of the target code node. The node update component is superimposed onto the node state of the target code node at the time of the previous code commit, forming the node state of the target code node at the time of the current code commit.

[0013] Optionally, S7 includes: S71. According to the code node index and the directed edge index, paste the quality impact residual back to the corresponding code node and directed edge in the unclosed quality impact diagram; S72. Based on the correspondence of program structure and the transmission order of code change impact path, the quality impact residuals corresponding to code nodes and directional edges are associated with code change units and code change impact paths respectively, forming software development code quality assessment results.

[0014] A software development code quality assessment system based on big data processing according to an embodiment of the present invention includes the following modules: The corresponding module is used to obtain data related to the software development process and establish the program structure correspondence between adjacent code versions according to the code submission order; The change module is used to compare the differences between program structures with corresponding relationships, and merge code changes belonging to the same program structure and having a logical succession relationship into code change units; The tracing module is used to trace the affected code units from the code change unit along the program dependency relationship, and connect the code change unit and the affected code unit according to the direction of code change propagation to form the code change impact path; The closure module is used to reflect the code quality verification results back to the code change impact path. Based on the reflected results, the verification closure section and the unclosed section of the code change impact path are divided, and the unclosed section is used to construct the unclosed quality impact diagram. The orchestration module is used to connect the unclosed influence states of the same code unit in adjacent code versions according to the correspondence of program structure, and arrange the code node states and directional edge propagation operators along the program dependency direction to form a cross-version quality influence state sequence. The residual module is used to input the cross-version quality impact state sequence into the improved TGN model. The node single memory update structure is replaced with a node-edge operator recursive structure. The node residual low-rank write-back path converts the unabsorbed state difference of the node into a low-rank correction matrix and writes it into the corresponding directional edge transfer operator to form the quality impact residual. The evaluation module is used to map the quality impact residuals to code change units and code change impact paths, thereby generating software development code quality evaluation results.

[0015] The beneficial effects of this invention are: 1. By corresponding program structures between adjacent code versions, merging code change units, and tracking program dependencies, scattered code changes are organized into code change impact paths with clear starting points and propagation directions. Then, by using the verification execution trajectory to divide the verification closed section and the unclosed section, the scope of impact that has been verified can be excluded, the object of code quality assessment can be narrowed, and the error associations generated by relying solely on static metrics or test conclusions can be reduced.

[0016] 2. The improved TGN model synchronously saves the state of code nodes and the directed edge propagation operator through the node-edge operator recursive structure. This allows function call relationships, variable definition-usage relationships, and control dependencies to retain the state propagation process across code commit times, avoiding program dependency edges from participating in message passing only as ordinary connection relationships. This improves the continuous expressive ability of the cross-version quality impact propagation process.

[0017] 3. The low-rank write-back path for node residuals converts node state changes that are not explained by program dependencies into low-rank correction matrices and writes them into the corresponding directed edge propagation operators, enabling the actual verification state to correct the propagation parameters of program dependency edges in reverse. The residuals of code node quality impact and the residuals of directed edge quality impact are jointly pasted back to the code change unit and the code change impact path, which can simultaneously locate the location of abnormal code and the location of quality impact propagation, reducing the scope of manual verification. Attached Figure Description

[0018] The accompanying drawings are provided to further illustrate the invention and form part of the specification. They are used in conjunction with embodiments of the invention to explain the invention and do not constitute a limitation thereof. In the drawings: Figure 1 This is a flowchart of a software development code quality assessment method based on big data processing proposed in this invention; Figure 2 This is a schematic diagram of the improved TGN model structure and data flow for a software development code quality assessment method based on big data processing proposed in this invention; Figure 3 This is a structural diagram of a software development code quality assessment system based on big data processing proposed in this invention. Detailed Implementation

[0019] The present invention will now be described in further detail with reference to the accompanying drawings. These drawings are simplified schematic diagrams, illustrating only the basic structure of the invention, and therefore only show the components relevant to the invention.

[0020] refer to Figure 1 and Figure 2 A software development code quality assessment method based on big data processing includes the following steps: S1. Obtain relevant data in the software development process and establish the program structure correspondence between adjacent code versions according to the code submission order; S2. Compare the differences of program structures with corresponding relationships, and merge code changes belonging to the same program structure and having a logical succession relationship into code change units. S3. Trace the affected code units from the code change unit along the program dependency relationship, and connect the code change unit and the affected code units according to the direction of code change propagation to form the code change impact path; S4. Reflect the code quality verification results back to the code change impact path, divide the verification closed section and unclosed section of the code change impact path according to the reflection results, and construct an unclosed quality impact diagram from the unclosed section; S5. Connect the unclosed influence states of the same code unit in adjacent code versions according to the correspondence of program structure, and arrange the code node states and directional edge propagation operators along the program dependency direction to form a cross-version quality influence state sequence. S6. Input the cross-version quality impact state sequence into the improved TGN model, replace the node single memory update structure with the node-edge operator recursive structure, and convert the node unabsorbed state difference into a low-rank correction matrix and write it into the corresponding directional edge propagation operator to form the quality impact residual. S7. Map the quality impact residuals to code change units and code change impact paths to form software development code quality assessment results.

[0021] In this embodiment, S1 includes: S11. Obtain code version data, code commit records, and code quality verification results. Bind the commit identifier to the corresponding code version data and code quality verification results, and sort the code versions according to the code repository, development branch, and commit order. S12. Perform syntax parsing on each code version and construct an abstract syntax tree. Divide the program structure according to the hierarchical relationship of files, classes, functions and program blocks, and extract the declaration information, hierarchical path and syntax node sequence of each program structure. S13. Establish a direct correspondence for program structures with consistent declaration information and hierarchical paths in adjacent code versions. Establish a migration correspondence for the remaining program structures to be matched using the abstract syntax tree matching method. Mark program structures in the previous code version that did not have a corresponding relationship as deleted program structures, and mark program structures in the subsequent code version that did not have a corresponding relationship as newly added program structures.

[0022] In practice, a version key is composed of the code repository identifier, development branch identifier, and commit identifier. Code version data, code commit records, and code quality verification results are linked to the corresponding version key. Code versions are arranged according to the parent commit time and commit sequence number, and multiple commits at the same time are arranged in lexicographical order of commit identifiers. Code quality verification results retain the verification task identifier, execution conclusion, covered program structure, and execution time. Verification results that do not match the version key are added to the set to be corrected.

[0023] An abstract syntax tree is constructed using a parser that matches the source code language. Before parsing, character encoding and consecutive whitespace characters are standardized, while preserving the original code location. The program structure is divided into files, classes, functions, and program blocks; declaration information includes structure type, structure name, number of parameters, and return type; hierarchical paths record the nesting position of program structures; the sequence of syntax nodes is arranged according to the preorder traversal result of the abstract syntax tree, and records the node type, parent node type, and original code location.

[0024] When adjacent code versions share the same program structure type, normalization declaration information, and hierarchical path, a direct correspondence is established. If the source code language is case-sensitive, the original case is preserved; otherwise, the structure name and parameter type are converted to lowercase. When multiple candidate objects correspond to the same program structure, the candidate object with the highest syntax node sequence consistency rate and the smallest original code position offset is selected sequentially.

[0025] For program structures without a direct correspondence, tree editing matching is performed within the scope of paired parent program structures. The percentages of nodes retained, parent-child relationships retained, and node type consistency retained are multiplied by 0.4, 0.35, and 0.25 respectively, and then summed. A migration correspondence is established when the structural similarity is not less than 0.82, and the candidate with the highest structural similarity is retained. Program structures without a correspondence in the previous code version are marked as deleted program structures, and those without a correspondence in the subsequent code version are marked as newly added program structures. Files that fail to be parsed are isolated according to file boundaries, and matching continues for the remaining files; after parsing is recovered, the program structure correspondence results for the failed files are supplemented.

[0026] In this embodiment, S2 includes: S21. The abstract syntax tree difference method is used to compare program structures with direct or migration correspondences to locate the syntax nodes for insertion, deletion, update and movement. S22. Map the difference results of the syntax nodes to the original code locations, and group the difference results that belong to the same program structure and have continuous code ranges, share the same upper-level syntax node, or are located in the same control branch into the same change group. S23. Merge the code content before and after the change corresponding to the same change group, retain the correspondence between the code before and after the change and the program structure, and form a code change unit.

[0027] In the specific implementation process, the abstract syntax tree subtrees at both ends of the direct correspondence and the migration correspondence are extracted respectively. The identifier writing format, constant representation format and syntax modification order are unified, while the node type, parent node position, child node order and original code range are preserved. First, syntax nodes with the same node type, normalized text and child node arrangement similarity of not less than 0.80 are matched downwards from the root node. Then, syntax nodes with paired parent nodes and descendant node overlap ratio of not less than 0.60 are matched upwards from the leaf nodes.

[0028] Syntax nodes that did not have a corresponding node in the previous code version are marked as deleted nodes, while those that did not have a corresponding node in the later code version are marked as inserted nodes. Paired nodes are marked as updated nodes when their normalized text changes, and as moved nodes when the position of the parent node or its sibling position changes. Both types of markers are retained when updates and moves occur simultaneously.

[0029] The difference results of syntax nodes are mapped back to the source code through the original code location. Inserted nodes use the modified code range, deleted nodes use the unmodified code range, and updated and moved nodes retain both the modified and unmodified code ranges. When a node lacks an ending position, the code range extends to the ending position of the same-level syntax unit; if the same-level syntax unit cannot be determined, it is truncated to the ending position of the corresponding program structure.

[0030] The difference results are first arranged according to the program structure and the original code location. Codes with overlapping ranges, line intervals of no more than 3 lines, shared direct parent syntax nodes, or located in the same conditional branch, loop branch, or exception handling branch are grouped into the same change group. Difference results across functions or classes are retained separately. Within each change group, the code range before and after the change are merged, duplicate ranges that are completely covered are deleted, and ranges that overlap or are no more than 1 line apart are merged. The content before the change of inserted nodes is set to empty, the content after the change of deleted nodes is set to empty, and the position before and after the move of moved nodes is retained. Change groups that have completed range merging constitute code change units.

[0031] In this embodiment, S3 includes: S31. Based on the abstract syntax tree and control flow graph of each code version, extract function call relationships, variable definition-usage relationships and control dependencies, construct a directed program dependency graph, and map code change units to the starting code units in the directed program dependency graph; S32. Perform a breadth-first traversal along the outgoing dependency edges of the directed program dependency graph from the starting code unit to determine the directly affected code units and indirectly affected code units, and record the predecessor code unit and dependency edge of each affected code unit. S33. Backtrack along the predecessor code unit and the dependency edge to the starting code unit, and arrange the code change units and affected code units according to the direction of dependency edge propagation to form the code change impact path.

[0032] In the implementation process, the positions of functions, program blocks, conditional branches, and variable operations in the abstract syntax tree are paired with the basic blocks of the control flow graph, and a unified code unit number is assigned to the same code range. Function call relationships are determined by the fully qualified name of the function, parameter types, and return types, with function call edges pointing from the called function to the calling position; variable definition-usage relationships are extracted through reach-definition analysis, with dependency edges pointing from the variable definition position to the variable usage position; control dependencies are extracted through the dominance relationships in the control flow graph, with dependency edges pointing from the conditional code unit to the controlled code unit. When different program dependency types exist between the same start and end points, the corresponding dependency edges are retained respectively.

[0033] For insert, update, and move types, the starting code unit is located by the modified code range; for delete types, the starting code unit is located by the pre-modification code range. When the code range covers multiple code units, the starting code unit is set for each unit; when the code range falls within a statement, it is included in the smallest program block containing the statement.

[0034] A breadth-first traversal is performed from each starting code unit along outgoing dependency edges. The first code unit reached at level 1 is recorded as a directly affected code unit, and the first code unit reached at a level greater than 1 is recorded as an indirectly affected code unit. When a code unit first enters the queue, its predecessor code unit and dependency edge are recorded. When code units at the same level are reached via different dependency edges, their parallel predecessor relationships are retained. Expanded code units are not re-entered into the queue.

[0035] Starting from the affected code unit, trace back along the predecessor relationship to the starting code unit, then reverse the tracing order to form the code change impact path arranged according to the program dependency direction. Paths with the same starting code unit, dependency edge sequence, and ending code unit are merged into one path. Shared code nodes or directional edges are repeatedly referenced by index but not saved repeatedly.

[0036] In this embodiment, S4 includes: S41. Perform code coverage tracing during the code quality verification process, record the actual program structure, execution order, and verification conclusions, and form a verification execution trajectory; S42. Using the correspondence of program structure, the verification execution trajectory is mapped to the code change impact path. Path segments that are continuously distributed along the same code change impact path, have completed execution coverage, and have all verification conclusions of "pass" are marked as verification closed segments. Path segments that have not completed execution coverage or whose verification conclusions include "fail" are marked as unclosed segments. S43. Preserve the code units and program dependencies in the unclosed sections, merge duplicate code units and directed connections, and construct an unclosed quality impact graph.

[0037] In practice, each code quality verification task is bound to a code commit identifier and a verification task identifier, and execution probes are deployed at the program entry point, function entry point, control flow graph basic block entry point, conditional branch entry point, and exception handling entry point. The execution probes record the program structure identifier, basic block identifier, entry time, exit time, and call depth, and reconstruct the verification execution trajectory according to the entry time and call depth. Verification is recorded as successful when all assertions pass; verification is recorded as unsuccessful when assertions fail or uncaught exceptions occur; and verification is recorded as interrupted when execution times out, process terminates, or the task is canceled. Both unsuccessful and interrupted verifications are considered unclosed conclusions.

[0038] The execution probes are mapped to code units in the code change-affected path using program structure identifiers and original code locations. When the program structure is migrated, the program structure identifier is converted according to the program structure correspondence; when a probe falls into multiple nested code units simultaneously, the code unit with the smallest code range is selected; when multiple probes are mapped to the same code unit, they are merged into a single overwrite record.

[0039] Coverage records are arranged according to the path delivery order, and coverage segments are cut off at uncovered code units. When multiple verification tasks are associated with the same path, the coverage boundaries of each verification task are aggregated and the path is divided into a unified segment. When all verification tasks completely cover the unified path segment and all conclusions are verification passed, the unified path segment is marked as a verification closed segment; when there are coverage gaps, verification failures, or verification interruptions, the unified path segment is marked as an unclosed segment. When conclusions conflict, verification failures take precedence over verification interruptions, and verification interruptions take precedence over verification passes.

[0040] Preserve code units and program dependencies within unclosed sections, and identify code nodes using both code unit identifiers and code version identifiers. Merge directional edges with the same starting code node, target code node, and program dependency type, while retaining edges with different program dependency types separately. Verify that closed sections are not included in the unclosed quality impact graph; when closed and unclosed sections share boundary code nodes, retain the boundary code nodes, and only retain directional edges entering or located within the unclosed section.

[0041] In this embodiment, S5 includes: S51. Based on the correspondence of program structure, connect code nodes belonging to the same code unit in the unclosed quality influence diagram of adjacent code versions, and arrange the unclosed influence status of each code node according to the code submission order. S52. Perform vectorized mapping on the unclosed influence state of the code node to form the code node state; encode the program dependency type, propagation direction and unclosed influence state of the directional edge, set the row position according to the target code node state dimension, set the column position according to the source code node state dimension, and assemble the encoding result into the directional edge propagation operator; S53. Arrange the code node states and directional edge propagation operators of each code version according to the code submission order, and arrange them according to the program dependency direction within the same code version to form a cross-version quality impact state sequence.

[0042] In practice, each code node is mapped to a nine-dimensional code node observation state. The first four dimensions use one-hot encoding to record non-execution, verification passed, verification failed, and verification interrupted. The fifth dimension records the number of verification failures, the sixth dimension records the number of verification tasks that were not fully covered, the seventh dimension records the path location category, the eighth dimension records the traversal level relative to the code change unit, and the ninth dimension records the number of associated verification tasks. When the number of verification failures, the number of incomplete coverage tasks, and the number of associated verification tasks exceed 20, they are truncated to 20 and divided by 20; when the traversal level exceeds 10, it is truncated to 10 and divided by 10. The starting code unit, directly affected code unit, and indirectly affected code unit corresponding to the code change unit are written as 1, 0.75, and 0.5 respectively in the seventh dimension.

[0043] Read the established direct and migration mappings, and write code nodes belonging to the same code unit in adjacent code versions to the same cross-version mapping index. Delete program structures to terminate cross-version mapping indexes, and assign new cross-version mapping indexes to newly added program structures.

[0044] Each directed edge is configured with a nine-row, nine-column initial directed edge transit operator. The row positions correspond to the observation state dimension of the target code node, and the column positions correspond to the observation state dimension of the source code node. Function call relationships are written with 1 in the main diagonal position; variable definition-usage relationships are written with 0.5 at the intersection of the fifth to ninth rows and the first to fourth columns; control dependencies are written with 0.5 at the intersection of the first to fourth rows and the seventh to ninth columns; and 0 in the remaining positions. When a directed edge connects a code node at the boundary of an unclosed segment, non-zero matrix elements are multiplied by 0.75. Different program dependency types are equipped with directed edge transit operators separately, and matrix merging is not performed.

[0045] The cross-version quality impact state sequence is first arranged according to the code commit order, and then within the same code version, the sequence items are arranged according to the program dependency direction. Each sequence item is bound to the source code node observation state, the directed edge propagation operator, the target code node observation state, the program dependency type, the code commit position, and the node index. Sequence items at the same traversal level are arranged according to the source code position, the target code position, and the program dependency type. The code node state is saved only once, and each sequence item is accessed through the node index; cyclic dependency edges retain the sequence item but do not repeatedly save the target code node state. The arranged cross-version quality impact state sequence is then fed into the improved TGN model.

[0046] In this embodiment, the improved TGN model includes a message function, a message aggregator, a node-edge operator recursive structure, a node residual low-rank write-back path, and a graph embedding module. The message function converts the cross-version quality impact state sequence into node time-series messages and edge time-series messages. The message aggregator collects node time-series messages and edge time-series messages according to code nodes and directed edges, respectively. The node-edge operator recursive structure updates the directed edge propagation operator based on the edge time sequence message. The updated directed edge propagation operator forms the edge propagation component and propagation coefficient of each incoming directed edge, and recursively updates the code node state. The low-rank write-back path of node residuals deducts the node update component reconstructed by the edge-transmitted component from the node time-series message to form the node unabsorbed state difference. The node unabsorbed state difference is used as a column vector. The corresponding source code node state is transposed into a row vector and an outer product is performed. The outer product result is adjusted according to the corresponding transmission coefficient to form a low-rank correction matrix corresponding to the row and column of the directional edge-transmitting operator. The low-rank correction matrix is ​​then written into the corresponding directional edge-transmitting operator. The graph embedding module performs embedding mapping on the updated code node state and the directed edge transfer operator that has completed low-rank correction, according to the correspondence between code nodes and directed edges, to form quality influence residuals corresponding to code nodes and directed edges respectively.

[0047] In this embodiment, the node-edge operator recursive structure updates the directed edge propagation operator based on the edge timing message, and recursively updates the code node state through the updated directed edge propagation operator, including: Read the directional edge passing operator at the previous code commit time and the edge timing message at the current code commit time. Project the edge timing message into the source side correction vector and the target side correction vector respectively. Use the target side correction vector as a column vector. Transpose the source side correction vector into a row vector and perform an outer product to form the operator increment matrix. Write the operator increment matrix into the directional edge passing operator at the previous code commit time to form the directional edge passing operator at the current code commit time. Perform matrix multiplication between the directional edge passing operator at the current code commit time and the node state of the source code node at the previous code commit time to form the edge passing component that is passed to the target code node along the corresponding directional edge; The edge transmission components of each incoming directed edge are collected according to the target code node. The edge transmission components are arranged in columns to form an incoming transmission matrix. The node time sequence message of the target code node is projected into the column space of the incoming transmission matrix using the regularized least squares projection method to obtain the transmission coefficient of each incoming directed edge. The corresponding edge transmission components are scaled according to each transmission coefficient, and the scaled edge transmission components are merged to form the node update components of the target code node. The node update component is superimposed onto the node state of the target code node at the time of the previous code commit, forming the node state of the target code node at the time of the current code commit.

[0048] In its implementation, the improved TGN model retains the message functions, message aggregator, and graph embedding module of the original TGN model. It replaces the update structure, which only stored node memories, with a node-edge operator recursive structure and adds a low-rank write-back path for node residuals between the code node update location and the storage location of the directed edge propagation operator. While the program-dependent edges in the original TGN model only handled node connections and temporal message propagation, the improved TGN model configures a 9x9 directed edge propagation operator for each directed edge, enabling program-dependent edges to store state propagation relationships that change across code commit times.

[0049] To distinguish between model input data and internal model update results, the nine-dimensional code node state, encoded by validation state, number of failures, coverage, and traversal level in the cross-version quality impact state sequence, is denoted as the code node observation state. The nine-dimensional state output by the node-edge operator recursive structure at each code submission time is denoted as the code node recursive state. When a code node first enters the improved TGN model, the corresponding code node observation state is written into the initial code node recursive state; if the code node has already appeared at the previous code submission time, the code node recursive state saved at the previous code submission time is directly read.

[0050] The node message function reads the nine-dimensional code node observation state at the current code commit time, the nine-dimensional code node recursive state at the previous code commit time, and the normalized code commit time interval, and concatenates these nineteen values ​​sequentially. The concatenation result is input into the first fully connected layer, which has 32 neurons and uses the ReLU activation function. The output of the first fully connected layer is input into the second fully connected layer, which outputs the nine-dimensional node time sequence message. When a code node first appears, the code node recursive state at the previous code commit time adopts the current code node observation state.

[0051] The edge message function reads the directed edge propagation operator at the previous code commit time, the source code node observation state at the current code commit time, the target code node observation state, the program dependency type encoding, and the normalized code commit time interval. The nine-row, nine-column directed edge propagation operator is expanded into an 81-dimensional vector in the order of the first to ninth rows; the source code node observation state and the target code node observation state each retain nine dimensions; function call relationships, variable definition-usage relationships, and control dependencies are each written into three-dimensional one-hot encodings. The 81-dimensional operator vector, the two nine-dimensional node observation states, the three-dimensional program dependency type encoding, and a time interval value are concatenated sequentially to form a 103-dimensional edge message input.

[0052] The 103-dimensional edge message is input into the first fully connected layer, which has 64 neurons and uses the ReLU activation function. The output of the first fully connected layer is input into the second fully connected layer, which outputs an 18-dimensional edge temporal message. The first nine components of the edge temporal message are arranged according to the target code node state dimension, forming the target-side correction vector; the last nine components of the edge temporal message are arranged according to the source code node state dimension, forming the source-side correction vector.

[0053] The message aggregator organizes node and edge time-series messages according to code commit location, code node index, and directed edge index. When a code node is referenced repeatedly by multiple paths affected by code changes, the aggregator checks the code commit location and code node index; if both are identical, only one node time-series message is retained. When a directed edge is referenced repeatedly by multiple paths affected by code changes, the aggregator checks the code commit location, source code node index, target code node index, and program dependency type; if all four are identical, only one edge time-series message is retained. Deduplicated node time-series messages proceed to code node recursion processing, and deduplicated edge time-series messages proceed to directed edge propagation operator recursion processing.

[0054] For each directed edge from the source code node to the target code node, the node-edge operator recursive structure reads the directed edge propagation operator saved at the time of the previous code commit and obtains the target-side correction vector and the source-side correction vector from the current edge timing message. The target-side correction vector is arranged in the column direction, and the source-side correction vector is arranged in the row direction. Each component of the target-side correction vector is multiplied by each component of the source-side correction vector, and the product is written into the corresponding row and column position to form a nine-row, nine-column operator increment matrix.

[0055] Multiply each element in the operator increment matrix by 0.1, and then add it item by item to the matrix elements in the same row and column position in the directed edge propagation operator at the time of the previous code submission to form the preliminary directed edge propagation operator. Calculate the sum of the absolute values ​​of the matrix elements in the preliminary directed edge propagation operator row by row; if the sum of the absolute values ​​of the current row is greater than 1, divide each matrix element in the current row by the sum of the absolute values ​​of the current row; if the sum of the absolute values ​​of the current row is not greater than 1, keep the matrix elements in the current row unchanged.

[0056] After row-by-row normalization, the first row of the current directional edge propagation operator is multiplied sequentially by the nine components of the source code node's recursive state and summed to obtain the first component of the edge propagation component. The second to ninth rows are processed in the same way to obtain the nine-dimensional edge propagation component. When the source code node first enters the improved TGN model, the source code node's observed state is used as the source code node's recursive state to participate in matrix multiplication.

[0057] When a target code node is connected to multiple incoming directed edges, the nine-dimensional edge transmission components of each incoming directed edge are arranged according to their index, and each edge transmission component is treated as a column, assembling to form a nine-row, multi-column incoming transmission matrix. The incoming transmission matrix is ​​transposed and multiplied by the target code node to obtain a square matrix. 0.01 is added to each position on the main diagonal of the square matrix, and then the inverse of the square matrix after main diagonal correction is obtained. The inverse result is then multiplied sequentially by the transpose of the incoming transmission matrix and the nine-dimensional node timing message of the target code node to obtain the transmission coefficients corresponding to each incoming directed edge.

[0058] Each incoming directed edge's nine-dimensional edge propagation component is multiplied by its corresponding propagation coefficient. Then, all scaled edge propagation components are summed dimension-by-dimensional to form the nine-dimensional node update component of the target code node. This nine-dimensional node update component is then summed dimension-by-dimensionally with the nine-dimensional code node recursive state saved at the previous code commit. Finally, a Sigmoid mapping is performed on each sum to compress each state component to between 0 and 1, forming the code node recursive state of the target code node at the current code commit.

[0059] The low-rank write-back path of node residuals subtracts the nine-dimensional node update component from the nine-dimensional node time-series message of the target code node dimension by dimension, obtaining the nine-dimensional node unabsorbed state difference. The node unabsorbed state difference represents the node state changes that are still not covered after the current incoming directed edges have been transformed by the directed edge propagation operator.

[0060] For each incoming directed edge of the target code node, arrange the unabsorbed state differences of the nine-dimensional node in the column direction, and arrange the recursive state of the nine-dimensional code node of the corresponding source code node at the previous code commit in the row direction. Multiply each component of the unabsorbed state difference of the node with each component of the recursive state of the source code node, and write the product into the corresponding row and column position to form an initial low-rank correction matrix of nine rows and nine columns.

[0061] The sum of squares of the nine components of the recursive state of the source code node is calculated, and 10^-6 is added to the sum. Each element of the initial low-rank correction matrix is ​​divided by the sum of squares of the completed sums, and then multiplied by the corresponding directional edge transfer coefficient and 0.05 to form the low-rank correction matrix. The elements of the low-rank correction matrix with the matrix elements in the same row and column positions in the current directional edge transfer operator are added one by one to complete the write-back of the node's unabsorbed state difference to the corresponding directional edge transfer operator.

[0062] After writing the low-rank correction matrix, the sum of the absolute values ​​of the matrix elements in the directed edge propagation operator is calculated row by row again. If the sum of the absolute values ​​of the current row is greater than 1, each matrix element in the current row is divided by the sum of the absolute values ​​of the current row; if the sum of the absolute values ​​of the current row is not greater than 1, the current row remains unchanged. After completing row-by-row normalization, matrix elements greater than 1 are rewritten as 1, and matrix elements less than -1 are rewritten as -1, forming the finally saved directed edge propagation operator at the time of the current code commit.

[0063] The directional edge propagation operator finally saved at the current code commit time is used for edge message encoding and operator recursion at the next code commit time. When the unabsorbed state difference of a node is close to zero, the matrix elements in the low-rank correction matrix are close to zero, and the directional edge propagation operator maintains the current propagation relationship; when the unabsorbed state difference of a node increases, the low-rank correction matrix rewrites the propagation parameters between the corresponding state dimensions, so that the edge propagation components at the next code commit time converge in the direction of the actual node state change.

[0064] The graph embedding module inputs the recursive state of the nine-dimensional code nodes into a fully connected mapping layer from nine to 32 dimensions to form code node embeddings. It also expands the nine-row, nine-column directional edge propagation operator into an 81-dimensional vector in row order, and inputs it into a fully connected mapping layer from 81 to 32 dimensions to form directional edge embeddings. The same code node is paired between adjacent code commits using cross-version indexes, and the same directional edge is paired using cross-version indexes of source code nodes, cross-version indexes of target code nodes, and program dependency types.

[0065] The code node quality impact residual is formed by subtracting the code node embedding corresponding to the previous code commit time from the code node embedding at the current code commit time dimension by dimension. Similarly, the directed edge quality impact residual is formed by subtracting the directed edge embedding corresponding to the previous code commit time from the directed edge embedding at the current code commit time dimension by dimension. When a new code node or a new directed edge does not have a corresponding embedding at the previous code commit time, a 32-dimensional zero vector is used as the corresponding embedding at the previous code commit time.

[0066] The improved TGN model is trained using consecutive code submissions. Each training window consists of six consecutive code submissions, and the cross-version quality impact state sequences from the first to the fifth code submission are input into the improved TGN model sequentially according to the code submission order. After the model completes the node-edge operator recursion and low-rank write-back of node residuals for the fifth code submission, it reads the 32-dimensional code node embeddings, nine-dimensional code node recursive states, final directed edge propagation operators for each directed edge, and the corresponding propagation coefficients for each directed edge in the fifth code submission.

[0067] Before training, the program structure correspondence between the fifth and sixth code commits is read. If a code node in the fifth code commit can be connected to the sixth code commit through a direct or migration correspondence, the two code nodes are added to the cross-version training node set. Deleted code nodes from the fifth code commit are not added to the cross-version training node set, and newly added code nodes from the sixth code commit are not added to the cross-version training node set.

[0068] Perform the same filtering on directed edges. If source code node correspondences, target code node correspondences, and the same program dependency types exist in both the fifth and sixth code commits, the corresponding directed edges will be added to the cross-version training edge set. Deleted directed edges in the fifth code commit and newly added directed edges in the sixth code commit will not be added to the cross-version training edge set.

[0069] The 32-dimensional code node from the fifth code commit version in the cross-version training node set is embedded into the nine-dimensional state prediction layer. The nine-dimensional state prediction layer uses a fully connected network to map the 32-dimensional code node embeddings to nine-dimensional code node predicted states, and performs Sigmoid mapping on the nine output components. The nine-dimensional code node observation state of the corresponding code node in the sixth code commit version is read, and the nine-dimensional code node predicted state is subtracted from the nine-dimensional code node observation state dimension by dimension. The squares of the nine differences are then averaged over all code nodes in the cross-version training node set to form the code node state prediction error.

[0070] The same 32-dimensional code node is embedded into the input four-class classification layer. The four-class classification layer outputs four predicted values: not executed, validation passed, validation failed, and validation interrupted. Softmax processing is performed on the four predicted values ​​to form the predicted probabilities of the four validation states. The one-hot encoding of the validation state in the first four dimensions of the corresponding code node in the sixth code submission version is read. The one-hot encoding of the validation state and the four predicted probabilities are input into the cross-entropy operation to form the validation state classification error.

[0071] The edge propagation consistency error is calculated using the cross-version training edge set. For each cross-version training edge in the fifth code commit, the directional edge propagation operator that has completed low-rank writeback and the code node recursive state of the source code node in the fifth code commit are read, and matrix multiplication is performed to form the nine-dimensional edge propagation component of the corresponding directional edge. The edge propagation components of all incoming directional edges are collected according to the target code node, and the propagation coefficients already obtained in the fifth code commit are read.

[0072] The nine-dimensional edge propagation components of each incoming directed edge are multiplied by their corresponding propagation coefficients, and then all scaled edge propagation components are added dimension by dimension to form the prediction update component of the target code node. The prediction update component is then added dimension by dimension to the code node recursive state of the target code node in the fifth code commit, and a Sigmoid mapping is performed to form the edge path prediction state of the sixth code commit.

[0073] The nine-dimensional code node observation state of the corresponding target code node in the sixth code commit is read. The edge path prediction state is subtracted from the code node observation state dimension by dimension, and the squares of the nine differences are calculated. Then, the average of these differences is taken over all target code nodes in the cross-version training node set to form the edge propagation consistency error. The edge propagation consistency error directly verifies whether the directed edge propagation operator saved in the fifth code commit can explain the code node state in the sixth code commit through the program dependency path, without using manually assembled directed edge propagation operators as supervision labels.

[0074] The operator change constraint term only processes directed edges with small unabsorbed state differences. For each directed edge in the fifth code commit, the unabsorbed state difference of the target code node is read one by one, and the average of the nine absolute values ​​is calculated. If the average is less than 0.05, the directed edge propagation operators at the current and previous code commit times are read. The matrix elements with the same row and column positions in the two operators are subtracted item by item, and the absolute values ​​are taken. The average of these 81 absolute values ​​is then used to form the operator change amount for the corresponding directed edge. The average of the operator changes for all directed edges that meet the conditions is used to form the operator change constraint term. Directed edges with an average absolute value of unabsorbed state differences of not less than 0.05 are not included in the calculation of the operator change constraint term.

[0075] The code node state prediction error is directly written into the total training loss. The validation state classification error is multiplied by 0.8 and then written into the total training loss. The edge propagation consistency error is multiplied by 0.5 and then written into the total training loss. The operator change constraint term is multiplied by 0.05 and then written into the total training loss. The four terms are added together to form the total training loss of the current batch.

[0076] During training, backpropagation is performed on the total training loss, sequentially updating the network parameters in the node message function, edge message function, nine-dimensional state prediction layer, four-classification layer, code node embedding mapping layer, and directional edge embedding mapping layer. The directional edge propagation operator and the code node recursive state are dynamic states that change with the code submission time within each training time window, and are not considered as static network parameters shared by all code repositories.

[0077] Training uses the Adam optimizer with an initial learning rate of 0.001, a batch size of 32, and a maximum number of training epochs of 80. After each training epoch, the total training loss on the validation set is calculated. Training terminates when the total training loss on the validation set fails to decrease for eight consecutive epochs, and the network parameters of the epoch with the minimum total training loss on the validation set are retained. Training data is divided by code repository. 70% of the code repositories are used in the training set, 15% in the validation set, and 15% in the test set. All code commits from the same repository are included in only one dataset to prevent the same program structure and adjacent code versions from appearing in both the training and test sets simultaneously.

[0078] The nine-dimensional state prediction layer and the four-class classification layer are only connected to code node embeddings during the model training phase. After training, the nine-dimensional state prediction layer and the four-class classification layer are removed, while the node message function, edge message function, message aggregator, node-edge operator recursive structure, node residual low-rank write-back path, and graph embedding module are retained to perform software development code quality assessment.

[0079] The original TGN model primarily uses aggregated time-series messages to update code node memories. Program dependency edges do not store transitive parameters that continuously change across code commit times, making it difficult to distinguish the different transitive effects of function calls, variable usage, and control dependencies on unclosed quality. The improved TGN model records the transitive relationships of each program dependency edge across various state dimensions through a directional edge transitive operator and uses edge time-series messages to form an operator increment matrix, enabling program dependency edges to be continuously updated throughout the code commit process.

[0080] The low-rank write-back path of node residuals further writes node state changes that were not explained by existing program dependencies back into the corresponding directed edge propagation operators, enabling the node state update results to correct the matrix parameters actually involved in the propagation at the next code commit time. Through the joint output of the residuals of code node quality impact and the residuals of directed edge quality impact, the software development code quality assessment results can not only locate code units with abnormal changes, but also indicate the program dependency locations where unclosed quality impacts continue to propagate, thereby improving the location accuracy, path interpretation capability, and state continuity of cross-version code quality assessment.

[0081] In this embodiment, S7 includes: S71. According to the code node index and the directed edge index, paste the quality impact residual back to the corresponding code node and directed edge in the unclosed quality impact diagram; S72. Based on the correspondence of program structure and the transmission order of code change impact path, the quality impact residuals corresponding to code nodes and directional edges are associated with code change units and code change impact paths respectively, forming software development code quality assessment results.

[0082] In the specific implementation process, the residuals of code node quality impact retain the code commit location and code node index, while the residuals of directed edge quality impact retain the code commit location, source code node index, target code node index, and program dependency type. An unclosed quality impact graph with consistent code commit locations is selected, and the residuals of code node quality impact and directed edge quality impact are written to the corresponding code nodes and directed edges according to their object indices.

[0083] When a new code node or a new directional edge does not have a corresponding embedding at the previous code commit time, a 32-dimensional zero vector is used as the previous embedding, and the current embedding directly forms the quality impact residual. When the program structure is migrated, the code node embeddings before and after the migration are paired using cross-version corresponding indices; when the code nodes at both ends of a directional edge are fully mapped and the program dependency type remains unchanged, the directional edge embeddings before and after the migration are paired.

[0084] If a code node or directed edge exists at the previous code commit location, but no corresponding object exists at the current code commit location, the last saved embedding vector before deletion is inverted to form the deletion quality impact residual, which is then attached to the code change unit containing changes to the deleted program structure or dependencies. If no unique object can be determined at the current code commit location, the previous code commit location, and the program structure correspondence, the quality impact residual is marked as an unlocated residual, and unlocated residuals do not participate in the path residual strength calculation.

[0085] The absolute values ​​of each dimension of the quality impact residual are averaged to form the residual amplitude. The code change impact paths already saved in S3 are read, and the quality impact residuals of the code nodes and directed edges are appended according to the order of the code nodes and directed edges in the path, without performing predecessor backtracking or shortest path filtering. When a code node or a directed edge is located on multiple paths simultaneously, only one set of quality impact residuals is saved, and each path references the corresponding residual record through an index.

[0086] For each code change affecting a path, the residual magnitudes of the code nodes and the directional edges are summed, and then divided by the total number of code nodes and directional edges in the path to form the path residual strength. When the same code change unit corresponds to multiple paths, they are arranged in descending order of path residual strength, ascending order of the number of directional edges, and ascending order of the position of the terminal code.

[0087] Software development code quality assessment results are attributed to code change units, recording code version identifier, code change unit identifier, code range before and after the change, associated code node index, associated directional edge index, residual quality impact of code nodes, residual quality impact of directional edges, impact path of code change, and path residual strength. Code change units within the same code commit version are arranged in descending order of maximum path residual strength.

[0088] refer to Figure 3 A software development code quality assessment system based on big data processing includes the following modules: The corresponding module is used to obtain data related to the software development process and establish the program structure correspondence between adjacent code versions according to the code submission order; The change module is used to compare the differences between program structures with corresponding relationships, and merge code changes belonging to the same program structure and having a logical succession relationship into code change units; The tracing module is used to trace the affected code units from the code change unit along the program dependency relationship, and connect the code change unit and the affected code unit according to the direction of code change propagation to form the code change impact path; The closure module is used to reflect the code quality verification results back to the code change impact path. Based on the reflected results, the verification closure section and the unclosed section of the code change impact path are divided, and the unclosed section is used to construct the unclosed quality impact diagram. The orchestration module is used to connect the unclosed influence states of the same code unit in adjacent code versions according to the correspondence of program structure, and arrange the code node states and directional edge propagation operators along the program dependency direction to form a cross-version quality influence state sequence. The residual module inputs the cross-version quality impact state sequence into the improved TGN model, replaces the node single memory update structure with a node-edge operator recursive structure, and the node residual low-rank write-back path converts the unabsorbed state difference of the node into a low-rank correction matrix and writes it into the corresponding directional edge propagation operator to form the quality impact residual. The evaluation module is used to map the quality impact residuals to code change units and code change impact paths, thereby generating software development code quality evaluation results.

[0089] Example 1: To verify the feasibility of this invention in practice, it was applied to a remote operation and maintenance platform of an industrial equipment software company. The remote operation and maintenance platform is developed using Java and a microservice architecture, including 20 code repositories, 38 microservices, and 6 long-term development branches, with a total source code of approximately 726,000 lines. During development, frequent equipment data access, fault diagnosis rule adjustments, and work order process updates are performed. A single code commit often simultaneously affects function calls, variable passing, and control branches. Existing code quality assessment methods mainly rely on static code complexity, test coverage, and verification conclusions. While these methods can identify code versions that fail verification, they struggle to pinpoint the code change units causing the anomalies and cannot reconstruct the propagation path of quality impacts within program dependencies.

[0090] This embodiment collected 2,680 code commits and 24,160 code quality verification tasks generated over nine consecutive months, including 15,340 unit test tasks, 6,280 interface test tasks, and 2,540 integration test tasks. Training data, verification data, and test data were divided according to code repositories. 1,840 code commits from 14 code repositories were selected as training data, 360 code commits from 3 code repositories were selected as verification data, and the remaining 480 code commits from 3 code repositories were selected as test data. In the test data, 148 code commits exhibited verification failures, verification interruptions, or incomplete coverage of code change impact paths. After verification by developers using test logs, defect repair records, and code review results, a total of 312 code change units and 427 unclosed code change impact paths were identified as related to quality anomalies.

[0091] During implementation, code versions were first organized according to code repository, development branch, and commit order. A program structure correspondence was established between adjacent code versions, and continuous code changes with logical connections were merged into code change units using abstract syntax tree differentiation. Then, affected code units were traced along function call relationships, variable definition-usage relationships, and control dependencies from these code change units, constructing code change impact paths. 480 test code commits resulted in 5926 code change units and 13684 code change impact paths. During code quality verification, execution trajectories of program structure and control flow basic blocks were collected and mapped back to the code change impact paths. Path segments with complete coverage and all verification results were recorded as closed verification segments; path segments with missing coverage, failed verification, or interrupted verification were recorded as unclosed segments. The test data ultimately formed 718 unclosed quality impact graphs, containing 8752 code nodes and 12846 directed edges.

[0092] The verification status, coverage status, and path location of code nodes are mapped to observed states of code nodes. Directed edge propagation operators are configured for different program dependency types, and a cross-version quality impact state sequence is formed according to code commit order and program dependency direction. After the cross-version quality impact state sequence is input into the improved TGN model, the node-edge operator recursive structure synchronously updates the code node recursive state and the directed edge propagation operators. The low-rank write-back path of node residuals writes node state changes that are not explained by existing program dependencies into the corresponding directed edge propagation operators. The graph embedding module outputs the code node quality impact residuals and the directed edge quality impact residuals, and pastes these two types of residuals back to the code change unit and the code change impact path, forming the software development code quality assessment results.

[0093] To verify the evaluation results, the existing static code metrics combined with coverage analysis, the evaluation method using the original TGN model, and the method of this invention were compared. All three methods used the same 480 test code submissions and the same manual verification results. The statistical results are shown in Table 1.

[0094] Table 1 Comparison of Software Development Code Quality Assessment Results

[0095] Code change unit location accuracy represents the proportion of code change units in the evaluation results that are consistent with the manual verification results out of the total number of output code change units; unclosed impact path recall rate represents the proportion of unclosed code change impact paths that are successfully identified in the manual verification; average number of code units manually checked represents the average number of code units that developers need to check before confirming the source of the anomaly.

[0096] The data in Table 1 show that the static code metrics combined with coverage analysis can only utilize code complexity, coverage location, and verification conclusions. The accuracy rate for locating code change units is 72.18%, and the recall rate for unclosed impact paths is 64.40%. The original TGN model can handle cross-version timing information, but program dependency edges do not store independent cross-commit delivery states. The accuracy rate for locating code change units and the recall rate for unclosed impact paths are 83.65% and 77.52%, respectively.

[0097] This invention uses directional edge propagation operators to record the state propagation process of function call relationships, variable definition-use relationships, and control dependencies. It also utilizes the unabsorbed state differences of nodes to correct the corresponding directional edge propagation operators, enabling code node state changes and program dependency locations to participate in quality assessment simultaneously. The accuracy rate for locating code change units reaches 93.27%, and the recall rate for unclosed impact paths reaches 89.23%, representing improvements of 9.62 percentage points and 11.71 percentage points respectively compared to the original TGN model. The average number of code units manually checked is reduced from 27.8 to 14.3.

[0098] This embodiment demonstrates that the present invention can locate the code change unit that causes quality anomalies in a development environment where continuous code submissions and multiple verification tasks run in parallel, and present the path of quality impact propagation along program dependencies, thereby reducing the scope of code that developers need to check and improving the accuracy of software development code quality assessment and engineering usability.

[0099] The above description is only a preferred embodiment of the present invention, but the scope of protection of the present invention is not limited thereto. Any equivalent substitutions or modifications made by those skilled in the art within the scope of the technology disclosed in the present invention, based on the technical solution and inventive concept of the present invention, should be covered within the scope of protection of the present invention.

Claims

1. A method for evaluating the quality of software development code based on big data processing, characterized in that, Includes the following steps: S1. Obtain relevant data in the software development process and establish the program structure correspondence between adjacent code versions according to the code submission order; S2. Compare the differences of program structures with corresponding relationships, and merge code changes belonging to the same program structure and having a logical succession relationship into code change units. S3. Trace the affected code units from the code change unit along the program dependency relationship, and connect the code change unit and the affected code units according to the direction of code change propagation to form the code change impact path; S4. Reflect the code quality verification results back to the code change impact path, divide the verification closed section and unclosed section of the code change impact path according to the reflection results, and construct an unclosed quality impact diagram from the unclosed section; S5. Connect the unclosed influence states of the same code unit in adjacent code versions according to the correspondence of the program structure, and arrange the code node states and directional edge propagation operators along the program dependency direction to form a cross-version quality influence state sequence. S6. Input the cross-version quality impact state sequence into the improved TGN model, replace the node single memory update structure with the node-edge operator recursive structure, and convert the node unabsorbed state difference into a low-rank correction matrix and write it into the corresponding directional edge propagation operator to form the quality impact residual. S7. Map the quality impact residuals to code change units and code change impact paths to form software development code quality assessment results.

2. The software development code quality assessment method based on big data processing according to claim 1, characterized in that, S1 includes: S11. Obtain code version data, code commit records, and code quality verification results. Bind the commit identifier to the corresponding code version data and code quality verification results, and sort the code versions according to the code repository, development branch, and commit order. S12. Perform syntax parsing on each code version and construct an abstract syntax tree. Divide the program structure according to the hierarchical relationship of files, classes, functions and program blocks, and extract the declaration information, hierarchical path and syntax node sequence of each program structure. S13. Establish a direct correspondence for program structures with consistent declaration information and hierarchical paths in adjacent code versions. Establish a migration correspondence for the remaining program structures to be matched using the abstract syntax tree matching method. Mark program structures in the previous code version that did not have a corresponding relationship as deleted program structures, and mark program structures in the subsequent code version that did not have a corresponding relationship as newly added program structures.

3. The software development code quality assessment method based on big data processing according to claim 1, characterized in that, S2 includes: S21. The abstract syntax tree difference method is used to compare program structures with direct or migration correspondences to locate the syntax nodes for insertion, deletion, update and movement. S22. Map the difference results of the syntax nodes to the original code location, and group the difference results that belong to the same program structure and have continuous code range, share the same upper-level syntax node, or are located in the same control branch into the same change group. S23. Merge the code content before and after the change corresponding to the same change group, retain the correspondence between the code before and after the change and the program structure, and form a code change unit.

4. The software development code quality assessment method based on big data processing according to claim 1, characterized in that, S3 includes: S31. Based on the abstract syntax tree and control flow graph of each code version, extract function call relationships, variable definition-usage relationships and control dependencies, construct a directed program dependency graph, and map code change units to the starting code units in the directed program dependency graph; S32. Perform a breadth-first traversal along the outgoing dependency edges of the directed program dependency graph from the starting code unit to determine the directly affected code units and indirectly affected code units, and record the predecessor code unit and dependency edge of each affected code unit. S33. Backtrack along the predecessor code unit and the dependency edge to the starting code unit, and arrange the code change units and affected code units according to the direction of dependency edge propagation to form the code change impact path.

5. The software development code quality assessment method based on big data processing according to claim 1, characterized in that, S4 includes: S41. Perform code coverage tracing during the code quality verification process, record the actual program structure, execution order, and verification conclusions, and form a verification execution trajectory; S42. Using the correspondence of program structure, the verification execution trajectory is mapped to the code change impact path. Path segments that are continuously distributed along the same code change impact path, have completed execution coverage, and have all verification conclusions of "pass" are marked as verification closed segments. Path segments that have not completed execution coverage or whose verification conclusions include "fail" are marked as unclosed segments. S43. Preserve the code units and program dependencies in the unclosed sections, merge duplicate code units and directed connections, and construct an unclosed quality impact graph.

6. The software development code quality assessment method based on big data processing according to claim 1, characterized in that, S5 includes: S51. Based on the correspondence of program structure, connect code nodes belonging to the same code unit in the unclosed quality influence diagram of adjacent code versions, and arrange the unclosed influence status of each code node according to the code submission order. S52. Perform vectorized mapping on the unclosed influence state of the code node to form the code node state; encode the program dependency type, propagation direction and unclosed influence state of the directional edge, set the row position according to the target code node state dimension, set the column position according to the source code node state dimension, and assemble the encoding result into the directional edge propagation operator; S53. Arrange the code node states and directional edge propagation operators of each code version according to the code submission order, and arrange them according to the program dependency direction within the same code version to form a cross-version quality impact state sequence.

7. The software development code quality assessment method based on big data processing according to claim 1, characterized in that, The improved TGN model includes a message function, a message aggregator, a node-edge operator recursive structure, a node residual low-rank writeback path, and a graph embedding module. The message function converts the cross-version quality impact state sequence into node time-series messages and edge time-series messages. The message aggregator collects node time-series messages and edge time-series messages according to code nodes and directed edges, respectively. The node-edge operator recursive structure updates the directed edge propagation operator based on the edge time sequence message. The updated directed edge propagation operator forms the edge propagation component and propagation coefficient of each incoming directed edge, and recursively updates the code node state. The low-rank write-back path of node residuals deducts the node update component reconstructed by the edge-transmitted component from the node time-series message to form the node unabsorbed state difference. The node unabsorbed state difference is used as a column vector. The corresponding source code node state is transposed into a row vector and an outer product is performed. The outer product result is adjusted according to the corresponding transmission coefficient to form a low-rank correction matrix corresponding to the row and column of the directional edge-transmitting operator. The low-rank correction matrix is ​​then written into the corresponding directional edge-transmitting operator. The graph embedding module performs embedding mapping on the updated code node state and the directed edge transfer operator that has completed low-rank correction, according to the correspondence between code nodes and directed edges, to form quality influence residuals corresponding to code nodes and directed edges respectively.

8. The software development code quality assessment method based on big data processing according to claim 7, characterized in that, The node-edge operator recursive structure updates the directed edge propagation operator based on the edge time sequence message, and recursively updates the code node state through the updated directed edge propagation operator, including: Read the directional edge passing operator at the previous code commit time and the edge timing message at the current code commit time. Project the edge timing message into the source side correction vector and the target side correction vector respectively. Use the target side correction vector as a column vector. Transpose the source side correction vector into a row vector and perform an outer product to form the operator increment matrix. Write the operator increment matrix into the directional edge passing operator at the previous code commit time to form the directional edge passing operator at the current code commit time. Perform matrix multiplication between the directional edge passing operator at the current code commit time and the node state of the source code node at the previous code commit time to form the edge passing component that is passed to the target code node along the corresponding directional edge; The edge transmission components of each incoming directed edge are collected according to the target code node. The edge transmission components are arranged in columns to form an incoming transmission matrix. The node time sequence message of the target code node is projected into the column space of the incoming transmission matrix using the regularized least squares projection method to obtain the transmission coefficient of each incoming directed edge. The corresponding edge transmission components are scaled according to each transmission coefficient, and the scaled edge transmission components are merged to form the node update components of the target code node. The node update component is superimposed on the node state of the target code node at the time of the previous code commit, forming the node state of the target code node at the time of the current code commit.

9. The software development code quality assessment method based on big data processing according to claim 1, characterized in that, S7 includes: S71. According to the code node index and the directed edge index, paste the quality impact residual back to the corresponding code node and directed edge in the unclosed quality impact diagram; S72. Based on the correspondence of program structure and the transmission order of code change impact path, the quality impact residuals corresponding to code nodes and directional edges are associated with code change units and code change impact paths respectively, forming software development code quality assessment results.

10. A software development code quality assessment system based on big data processing, comprising executing the software development code quality assessment method based on big data processing as described in any one of claims 1 to 9, characterized in that, Includes the following modules: The corresponding module is used to obtain data related to the software development process and establish the program structure correspondence between adjacent code versions according to the code submission order; The change module is used to compare the differences between program structures with corresponding relationships, and merge code changes belonging to the same program structure and having a logical succession relationship into code change units; The tracing module is used to trace the affected code units from the code change unit along the program dependency relationship, and connect the code change unit and the affected code unit according to the direction of code change propagation to form the code change impact path; The closure module is used to reflect the code quality verification results back to the code change impact path. Based on the reflected results, the verification closure section and the unclosed section of the code change impact path are divided, and the unclosed section is used to construct the unclosed quality impact diagram. The orchestration module is used to connect the unclosed influence states of the same code unit in adjacent code versions according to the correspondence of program structure, and arrange the code node states and directional edge propagation operators along the program dependency direction to form a cross-version quality influence state sequence. The residual module is used to input the cross-version quality impact state sequence into the improved TGN model. The node single memory update structure is replaced with a node-edge operator recursive structure. The node residual low-rank write-back path converts the unabsorbed state difference of the node into a low-rank correction matrix and writes it into the corresponding directional edge transfer operator to form the quality impact residual. The evaluation module is used to map the quality impact residuals to code change units and code change impact paths, thereby generating software development code quality evaluation results.