Artificial intelligence-based r&d test two-way synchronization method
By constructing a causal intent graph and dynamically updating the R&D task state graph, the problem of information asymmetry between R&D and testing was solved, enabling real-time two-way synchronization and test-driven R&D, thus improving testing efficiency and system stability.
Patent Information
- Application Number
- CN202511525506.9
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2025-10-24
- Publication Date
- 2026-02-06
- Estimated Expiration
- 2045-10-24
AI Technical Summary
In DevOps and Agile development models, information asymmetry between the R&D and testing processes leads to delayed test case generation, insufficient regression coverage, and difficulty in reproducing online defects. In particular, in multi-team collaborative environments, data structure heterogeneity and semantic barriers are severe, making it difficult to achieve real-time bidirectional synchronization.
The AI-based bidirectional synchronous method for R&D testing analyzes R&D task data through a multimodal neural network, constructs a causal intent graph, identifies coverage blind spots and conflict risks, generates structured test cases, collects behavior logs in real time for correction, and dynamically updates the R&D task status graph, thereby achieving reverse linkage between test-driven R&D.
It achieves deep coupling and intelligent linkage between R&D and testing, identifies test problems in real time, automatically marks changes in task status, improves the response speed to R&D problems and system stability, and significantly improves the efficiency of engineering utilization of test value.
Smart Images

Figure CN120994571B_ABST
Abstract
Description
TECHNICAL FIELD
[0001] The present application relates to the field of artificial intelligence and software testing technology, in particular to a research and development test bidirectional synchronization method based on artificial intelligence. BACKGROUND
[0002] Under the background of rapid iteration of today's software systems, the information flow between research and development and testing processes is becoming increasingly complex, especially under the DevOps and agile development mode, the change frequency of research and development tasks and the consistency requirements of test coverage are increasing. However, the existing test process generally has the problem of "research and development-test" information asymmetry, mainly reflected in that the generation of test cases lags far behind the update of research and development tasks, resulting in problems such as test lag, insufficient regression coverage, and difficulty in online defect reproduction. Although existing technologies attempt to use natural language processing (NLP) or rule engines to assist in generating test cases, most are limited to one-way automated processes, lacking real-time bidirectional synchronization mechanisms between research and development and testing.
[0003] More seriously, in a multi-team collaboration environment, due to the use of different tools, task formats, and terminology systems by each team, the data structure is heterogeneous, and the semantic gap is serious, making it difficult for the test system to accurately understand the research and development semantic context and dynamically adjust and automatically synchronize the test behavior.
[0004] For example, in the implementation of the upgrade process of a certain large financial system, due to the short update cycle and high concurrency of research and development tasks, the traditional test process cannot real-time perceive the research and development change content, and needs to manually compare test coverage points one by one, which is not only low in efficiency, but also prone to errors and omissions. This "asynchronous testing" mode has become a key bottleneck affecting software quality and delivery cycle. SUMMARY
[0005] The purpose of the present application is to provide a research and development test bidirectional synchronization method based on artificial intelligence to solve the problems in the background art.
[0006] In order to achieve the above purpose, the present application provides the following technical solution: a research and development test bidirectional synchronization method based on artificial intelligence, comprising:
[0007] Extracting task descriptions, code changes, user stories, PRD documents, and UI design data, and analyzing behavior intent and semantic logic through a multi-modal neural network to construct a causal intent graph;
[0008] Based on the causal intent graph, reasoning upstream and downstream, identifying causal nodes with high coverage blind spots and conflict risks, and generating potential completion tasks in reverse;
[0009] Fusing the original research and development tasks and the completion tasks to form a complete state set, and driving the generation of structured test cases after conditional encoding, with task identification and causal path information attached.
[0010] After the test is executed, the behavior log and the running log are collected in real time, the mismatch area between the modalities is detected, if there is deviation, a correction suggestion is generated through the deviation correction model and the task pool is automatically written back;
[0011] According to the correction result, the R&D task state atlas is dynamically updated, and the reverse linkage of the test-driven R&D is realized.
[0012] Preferably, the behavior intention and semantic logic are analyzed through the multi-modal neural network, and a causal intention atlas is constructed, including:
[0013] The task text, user story and PRD document are semantically encoded based on the pre-trained language model, and a text semantic vector V_text is output;
[0014] The UI design diagram is component-recognized and layout-modeled using a visual Transformer or a target detection network, and an image semantic vector V_ui is output;
[0015] The Git Diff is semantically changed using a CodeBERT model, and a code feature vector V_code is output;
[0016] The text semantic vector V_text, the image semantic vector V_ui and the code feature vector V_code are identified as graph nodes through a node identification mechanism, and the semantic relationship strength between the nodes is calculated using a Transformer encoder, the nodes are connected according to a relationship strength threshold, and a causal intention atlas G_causal with semantic paths is formed, wherein the edges represent potential causal driving or dependent relationships.
[0017] Preferably, the upstream and downstream reasoning based on the causal intention atlas includes:
[0018] A pre-post adjacency subgraph structure is constructed for each node in the causal intention atlas, and a graph neural network model is used to aggregate and propagate the node features in the subgraph, generating an upstream and downstream semantic representation vector for each node, the graph neural network being a graph convolution network or a graph attention network, used to model the potential causal chain dependent relationship between the task behaviors.
[0019] Preferably, the causal nodes with high conflict risk and coverage blind area are identified, including:
[0020] Based on the obtained upstream and downstream representation vectors of the nodes, the structural entropy, semantic deviation degree and task path frequency of the nodes are calculated, a comprehensive score threshold is set, and nodes with low structural centrality, large semantic deviation or not covered by historical test paths are screened out to form a high-risk causal node set;
[0021] The semantic deviation degree calculation method comprises: calculating the cosine similarity between the behavior semantic vector of each candidate node and the upstream trigger node vector, and taking the inverse difference as the semantic deviation degree index; if the semantic deviation degree index is higher than the set threshold, it indicates that the node has semantic mutation.
[0022] Preferably, the reverse generation of the potential completion task comprises:
[0023] Each node in the high-risk node set is taken as a seed point, and reverse path backtracking is performed along its upstream path, and based on the missing behavior type and historical task template in the path, a structured completion task is generated, the completion task includes title, suggestion description, trigger condition and coverage object field, and is marked as a "test guide task".
[0024] Preferably, the reverse generation of the structured test case after conditional coding comprises:
[0025] The original research and development task set and the completion task set generated by the causal graph reasoning are merged at the structure level, task redundancy and semantic duplicates are removed, and a complete task state set containing task number, behavior label, data source and causal relationship path is formed;
[0026] Based on the semantic vector representation of the task nodes in the causal graph, the semantic cosine similarity between the task pairs is calculated, and if the similarity is greater than the preset threshold θ_merge, it is judged as a task redundancy or a semantic equivalent task, and a task merging operation is performed; all the antecedent and consequent relationship edges in the causal path are retained after merging;
[0027] For each task node in the complete task state set, its behavior type, source mode, causal position and strategy label are extracted to construct a multi-dimensional feature vector, and after all the task vectors are spliced, a multi-modal semantic vector is fused to form a conditional control vector, which is used to guide the generation of structured test cases and task context strongly related test cases.
[0028] Preferably, the detection of the mismatch area between modalities comprises:
[0029] The function path, parameter change and state transition sequence in the test behavior log and the running log are compared, the sequence matching algorithm is used to calculate the behavior consistency score between the log pairs, and the strategy recognition modal mismatch area is extracted through the difference vector, and if the consistency score is lower than the set threshold θ_diff, it is determined that there is semantic deviation or uncovered behavior.
[0030] Preferably, the generation of the correction suggestion by the rectification model comprises:
[0031] The feature code of the mismatch area is input into a pre-trained rectification suggestion generation model, the rectification suggestion generation model is based on a double-tower structure, the left tower input is a mismatch behavior semantic vector, the right tower input is a historical repair case vector, and the output suggestion repair content includes recommended supplementary test items, input parameter change suggestions, expected result adjustment or task completion prompts through a similarity matching and context semantic synthesis mechanism.
[0032] Preferably, the development task state graph is dynamically updated according to the correction result, including:
[0033] The correction type and task identifier in the rectification suggestion are mapped to the corresponding node in the development task state graph, and the node is marked as a "to be updated", "to be supplemented" or "abnormal coverage" state label;
[0034] The node represents a development task unit, and the edge represents the causal dependence relationship between tasks;
[0035] The graph state updating process includes: for the node marked as "to be updated", the update influence score is propagated to its upstream and downstream, and a propagation function F_update is used, wherein the influence degree is proportional to the propagation weight of the dependent edge, and when the propagation score exceeds a set threshold θ_propagation, the state of the adjacent node is synchronized to be upgraded to "to be reviewed" or "influenced", thereby forming a chain linkage reminding mechanism;
[0036] The "to be supplemented" and "to be reviewed" nodes in the state graph are re-evaluated for priority, and task weight, path centrality and influence radius are combined to automatically generate a completion task suggestion or a change order and push it to the development personnel task pool, marked as a "test feedback driven task", to realize the reverse activation and dynamic linkage of the test result to the development process.
[0037] In the above technical solution, the technical effects and advantages provided by the present application are:
[0038] 1、The present application introduces a development task state graph, and dynamically updates it combined with test feedback results, realizing deep coupling and intelligent linkage between development and testing. Compared with the defects of isolated task state, lagging test feedback and static task scheduling in traditional development process, this scheme can identify problems exposed in testing in real time, automatically label task state changes, and propagate state through the task graph through causal paths, effectively revealing the potential chain influence range, and improving the response speed of development problems and system stability.
[0039] 2、The application converts the mismatch information found in the test system into an operable research and development completion task through the construction of a task state priority scoring mechanism and a reverse scheduling engine, forming a closed-loop feedback path of "test-driven research and development". The system not only supports fine expression and intelligent evolution of task states, but also has cross-module linkage perception and task automatic generation capability, significantly improving the engineering utilization efficiency of test value. BRIEF DESCRIPTION OF DRAWINGS
[0040] In order to more clearly illustrate the technical solutions in the embodiments of the present application or the prior art, the drawings needed in the embodiments will be briefly introduced below. Obviously, the drawings described below are only some embodiments described in the present application, and other drawings can also be obtained by those skilled in the art based on these drawings.
[0041] Figure 1 The flowchart of the research and development test bidirectional synchronization method based on artificial intelligence of the present application. DETAILED DESCRIPTION
[0042] In order to make the objects, technical solutions and advantages of the embodiments of the present application clearer, the technical solutions in the embodiments of the present application will be described clearly and completely below with reference to the drawings in the embodiments of the present application. Obviously, the described embodiments are only some embodiments of the present application, not all embodiments. Based on the embodiments in the present application, all other embodiments obtained by those skilled in the art without creative labor fall within the scope of protection of the present application.
[0043] Embodiment, please refer to Figure 1 The research and development test bidirectional synchronization method based on artificial intelligence described in the present embodiment includes:
[0044] Extract task description, code change, user story, PRD document and UI design data, and analyze behavior intention and semantic logic through a multi-modal neural network to construct a causal intention graph;
[0045] Based on the causal intention graph, infer upstream and downstream, identify causal nodes with high coverage blind area and conflict risk, and reversely generate potential completion tasks;
[0046] Fuse the original research and development task and the completion task to form a complete state set, automatically generate structured test cases after conditional coding, and attach task identification and causal path information;
[0047] After test execution, real-time collection of behavior logs and running logs, detection of mismatch areas between modalities, if there is deviation, generate correction suggestions through a rectification model and automatically write back to the task pool;
[0048] According to the correction result, the R&D task state graph is dynamically updated, and the reverse linkage of test-driven R&D is realized.
[0049] In the present application, in order to realize the intelligent, structured and high-precision semantic linkage between R&D tasks and test tasks, the original information with business behavior meaning needs to be extracted from multiple R&D data sources, and the information is subjected to multi-modal semantic modeling, and then a "causal intention graph" is constructed. The graph is the basic knowledge representation structure of the present application, and its quality and precision will directly affect the subsequent test strategy planning and use case generation effect.
[0050] The "causal intention graph" (Causal Intention Graph, abbreviated as G_causal) proposed in the present application is a directed graph structure with R&D task behavior units as graph nodes and semantic relationships as edges, which is used to express the causal driving relationship and behavior triggering path between tasks and modules. Its construction process is as follows:
[0051] Firstly, the system is connected with multiple software R&D support platforms through an integrated interface, and the following five types of key task data are collected:
[0052] Task description text: obtain task title, description, label and associated task field from project management platform (such as Jira, TAPD);
[0053] Code change difference (Git Diff): obtain the code change information submitted by the R&D personnel from the code repository (such as GitLab, GitHub);
[0054] User story and requirement document: extract user story and PRD document text from product management platform (such as Confluence, Notion);
[0055] API interface definition file: such as Swagger or OpenAPI format interface definition;
[0056] UI design draft: capture UI changes and function expectations by connecting Figma or Sketch exported canvas JSON or PNG image resources.
[0057] The collected multi-source data is subjected to structure standardization processing, and is uniformly converted into a set of intermediate data objects for modeling, including text type task units, structured field descriptions, image design resources, etc., forming a unified input format {D_task} for subsequent semantic modeling module calling.
[0058] For the above multi-source heterogeneous data, a multi-modal semantic modeling subsystem is designed and deployed, and a targeted deep learning model is used to vectorize the encoding of different types of input data. Mainly including the following three submodules:
[0059] Text Feature Extraction Module: Use the field pre-trained language model BERT (Bidirectional Encoder Representations from Transformers) to encode the task description, user story, and PRD document content. This model uses WordPiece tokenization to divide the input text into Token sequences and learns the context relationship through a 12-layer Transformer encoder. The output is a vector representation for each Token. Finally, the [CLS] marker vector is used as the sentence semantic vector, denoted as V_text.
[0060] Code Semantic Modeling Module: For Git Diff data, use the CodeBERT model for encoding. CodeBERT is a Transformer model designed for source code and natural language dual-modal tasks, supporting multiple programming languages. The model takes the modified and pre-modified code snippets as double sequence input and outputs the code semantic change vector, denoted as V_code, which is used to capture the evolution trend of interface logic.
[0061] Image Visual Modeling Module: UI design image is processed through the DETR (DEtection TRansformer) model. DETR is an end-to-end target detection model based on Transformer, which can extract component elements (such as buttons, input boxes, pop-up windows, etc.) and their spatial layout relationships from UI original images. The extraction results are encoded into image semantic vectors V_ui through a visual feature embedding layer, and combined with image position encoding to reflect the interaction possibility between components.
[0062] The above three types of vectors will be projected into the same semantic space to form the feature vector group {V_text, V_code, V_ui} after modal alignment.
[0063] To extract behavior nodes that can construct a graph from semantic vectors, the invention introduces a "Task Action Recognition Model". This model is based on the sequence labeling structure of BERT and is fine-tuned through BiLSTM-CRF to recognize potential behavior phrases, operation verbs, module names, and other entities in the input text.
[0064] The recognized behavior units are represented in the following five-tuple structure: Node_i = (ID, Action_Label,Trigger_Condition, Affected_Object, Source_Type);
[0065] Where:
[0066] ID: unique identifier;
[0067] Action_Label: action intent label, e.g. "interface refactoring", "validation logic change", "visual difference optimization";
[0068] Trigger_Condition: pre-condition of the action, e.g. "membership level takes effect", "button is clicked";
[0069] Affected_Object: target of the action, e.g. "order settlement interface", "login page UI";
[0070] Source_Type: source modality (text / code / image).
[0071] All identified action units constitute the initial node set N_causal of the graph.
[0072] Causal connections between nodes are constructed by the "semantic-driven path reasoning algorithm". This algorithm is based on the following two core criteria:
[0073] Semantic similarity matching: the cosine similarity is used to calculate the vector distance between any two nodes. If it is less than the pre-set threshold θ1 = 0.3, it is judged that there is a potential semantic dependency relationship.
[0074] Trigger-response chain pattern recognition: according to the timestamps, call chains, or PRD logical sequences in the source modality field, a directed dependency edge is constructed. For example, "interface change behavior" → "UI change behavior" → "test verification behavior". The edge weight is denoted as W_ij, whose value ranges from 0 to 1, representing the causal confidence between two nodes, which is determined by the following function: ; where: sim(V_i, V_j) is the semantic cosine similarity; Logic_Correlation(i, j) is the logical relationship strength score (value 0~1), based on the context sequence and causal vocabulary pair recognition; α and β are weighting coefficients, recommended to be set as α = 0.6, β = 0.4. When the edge weight W_ij ≥ threshold θ2 = 0.5, the system connects the nodes i and j, adds the edge set E_causal, and labels the edge type (such as dependency, trigger, coverage, completion, etc.).
[0075] The final causal intent graph G_causal is represented as G = (N_causal, E_causal), which is a directed and weighted graph structure. Each node is attached with structured information such as action intent label, modality source, and semantic vector, and the edge contains behavior trigger type, causal confidence score, and semantic path description.
[0076] The graph supports the following two main uses:
[0077] The test generation module is provided with a context behavior path as a task dependency input;
[0078] The graph structure input is provided to the graph neural network module (such as GCN or GAT) for subsequent behavior gap prediction and reverse task generation.
[0079] In addition, G_causal supports export in JSON-LD format for integration with external knowledge graphs or test platforms.
[0080] After completing the construction of the causal intent graph, it is necessary to further understand the upstream and downstream dependency relationships of each behavior node in the global semantic structure. The present application uses a graph neural network model to reason and process the graph.
[0081] The system can select one of the following two graph neural network structures:
[0082] Graph Convolutional Network (GCN);
[0083] Graph Attention Network (GAT).
[0084] The initial vector of each node comes from the semantic vector generated when the graph is constructed, which is a 512-dimensional real-valued vector, denoted as V_node_initial.
[0085] For GCN: information propagation is achieved through weighted averaging of first-order neighbor features;
[0086] For GAT: an attention mechanism is introduced to calculate the attention weight for each neighbor node, and the neighbor vectors are aggregated according to the weight.
[0087] The number of propagation layers is set to 2, i.e. each node considers at most 2-hop adjacent nodes in the information propagation process, ensuring that both upstream and downstream behavior relationships are considered without introducing redundant interference.
[0088] After reasoning, the upstream and downstream aggregated representation vectors of each node are output, denoted as V_node_contextual, which are used for subsequent structure and semantic analysis.
[0089] In order to discover potential test coverage blind spots or demand conflict points, it is necessary to analyze the importance of the nodes in the graph and evaluate the semantic deviation degree. The specific process is as follows:
[0090] For each node, calculate its "influence" in the graph structure, i.e. graph centrality indicators, including betweenness centrality and PageRank value. If a node has low centrality but large semantic deviation, it indicates that it is on the edge of the structure but has high risk.
[0091] For each node, calculate the semantic cosine similarity between it and all upstream nodes. If the upstream nodes are set P (including upstream behavior nodes), the current node vector is V_cur, and the vector of each node in P is V_pj, then the semantic deviation degree D_p is: D_p = 1 minus the average (cosine similarity of V_cur and V_pj); when D_p is higher than the threshold θ_gap (recommended value is 0.35), it means that the current node has a large semantic mutation, which may be a demand break or abnormal behavior.
[0092] Combine the historical use case library and task log to count the frequency of each node being covered by the test path. If a node is never included in any path or its path only exists in non-mainstream flow, it is determined to be a coverage blind area.
[0093] Standardize the above three indicators to a decimal between 0 and 1, and calculate the node risk score according to the following weighting formula: R_score = 0.4 × D_p + 0.4 × coverage blind area score + 0.2 × inverse centrality score; if R_score is greater than 0.6, add the node to the high-risk causal node set N_gap.
[0094] For each node in the high-risk node set N_gap, perform the following completion process:
[0095] From each high-risk node, trace its predecessor node chain according to the graph structure, with a maximum backtracking depth of 3 hops. If there is a missing behavior type in the backtracking path (such as missing logic verification, missing boundary check, etc.), mark it as "behavior chain defect".
[0096] Match the behavior defect type with the predefined task template library in the system. For example, if "data input" is found in the path but "format validation" is missing, it is mapped to the "input validation task template" and the template structure is extracted:
[0097] Title field: "Supplement XXX field validation logic";
[0098] Description field: "The field has not been checked for format boundaries, it is recommended to add XXX rules";
[0099] Condition field: "When the input is user form data";
[0100] Type field: "Test-driven R&D completion task".
[0101] Generate a structured task data object named T_back_i and attach a flag field source = 'from_test_gap' to facilitate subsequent identification as a test guide completion task in the R&D system.
[0102] The system pushes T_back_i to the task management platform (such as Jira) through an open interface and establishes an association with the original test task, supporting R&D personnel review, confirmation, and merging.
[0103] To ensure that this mechanism can adapt to different projects or organizations, some key parameters are provided with a configuration interface:
[0104] θ_gap (semantic deviation threshold): recommended value 0.35, adjustable range 0.2 to 0.5;
[0105] Maximum backtracking depth: default 3 hops, can be configured to 2 to 5 hops;
[0106] Risk score threshold R_score: default 0.6, can be set to 0.5 to 0.8;
[0107] Number of graph neural network propagation layers: recommended 2 layers, maximum 4 layers;
[0108] Completion template library: loaded in JSON or YAML file format, supports adding / editing templates.
[0109] The original R&D task set (T_forward) is usually provided by the project management platform and contains explicit task numbers, task descriptions, priority, module attribution, and other structured fields; while the completion task set (T_back) is generated based on the high-risk nodes in the causal graph inferred by the graph neural network, and has the same structure as the original task but with a "reasoning generated" label.
[0110] The system first merges the two sets to form the task full set T_all. During the merging process, the following processing is considered:
[0111] Structural field alignment: unify the field structure of tasks, including task number (T_id), task semantic vector (V_task), origin type (origin_type), action label (action_type), module attribution (module_id), etc.
[0112] To avoid semantic repetition tasks leading to redundancy in test case generation, the system uses graph structure alignment to eliminate task redundancy. The specific method is:
[0113] Calculate the cosine similarity of semantic vectors between all task nodes in T_forward and T_back;
[0114] If the similarity is greater than a set threshold value θ_merge (recommended value is 0.85), it is considered as a semantically equivalent task;
[0115] In the atlas structure, the task nodes with stronger upstream and downstream connections are retained, and weakly connected nodes are deleted or merged;
[0116] The merging operation retains all causal edge relationships and ensures the integrity of the causal path.
[0117] After the processing is completed, a complete task state set T_all with a standard structure and non-redundant semantics is obtained, which serves as the basis for subsequent test case generation.
[0118] The present application adopts a "conditional guided generation" strategy, so that test case generation is not only limited to requirement text input, but is jointly controlled by multi-dimensional task context. To this end, a condition control vector C_all needs to be constructed.
[0119] The specific construction method is as follows:
[0120] For each task in T_all, the following features are extracted to form a task feature vector C_task: task semantic vector (512 dimensions): output by BERT or RoBERTa encoder; behavior type vector (10 dimensions One-hot encoding): such as "interface modification", "UI change", "permission check", etc.; source marker vector (2 dimensions): original task / reasoning generated task; causal level position (integer value): the level of the node from the root node in the atlas; module attribution code (64-dimensional sparse vector): such as order, user, payment module, etc.; path depth (scalar): the longest causal path depth involved in the task. Finally, the feature vector C_task_i of each task is formed, and the unified dimension is set to 640 dimensions. All task feature vectors are spliced according to the causal path order to form the overall condition control vector C_all. If the number of tasks is N, then: C_all = concatenate(C_task_1, C_task_2,..., C_task_N); before input to the generation model, truncate to K=10 tasks according to the maximum length, and use a sliding window mechanism for the part exceeding.
[0121] In the test case generation model, C_all is input as an external condition vector of the Transformer decoder, and is fused with the semantic input (such as PRD text, Git Diff, etc.) for processing to guide the generation of structured test cases.
[0122] The generation module is a conditional generation model based on the Transformer architecture, and the core components include:
[0123] Encoder: Input is the aforementioned multi-modal semantic features, such as sentence vectors of PRD documents, UI image embedding vectors, and code Diff change vectors.
[0124] Decoder: Generates test case items field by field in an autoregressive manner, with the generation order being: test item (test_item), precondition (precondition), input data (input_data), expected result (expected_result), test method label (test_method), task number (T_id), and causal path encoding (P_causal).
[0125] Condition vector C_all serves as the Key and Value of the cross-attention layer, guiding the decoder to refer to the behavior features in the current task chain when generating each field.
[0126] To enhance the explainability and post-maintenance capability of test cases, the invention proposes to attach task numbers and causal path information to each test case:
[0127] Task number (T_id): Used to mark which task the test case directly comes from, facilitating one-way tracing from test case to task.
[0128] Causal path encoding (P_causal): Represents the task causal chain that the test case depends on, for example: T12→T18→T22.
[0129] The path is represented by a sequence of node numbers and stored as a structured field in the test case, which can be visualized in the test management platform and supports causal positioning of test defects.
[0130] The log collection system interfaces with two main data sources:
[0131] Test behavior log (L_log): Output by the test management platform (such as Metersphere, TestRail), containing case number, execution time, input data, expected output, actual output, and call path.
[0132] System runtime log (L_runtime): Automatically generated when the system under test runs, collected in real time by the embedded collection agent (Agent), including interface call chain, parameter flow, state transition record, exception stack, and module response behavior, etc.
[0133] For subsequent comparative analysis, the system maps the above two types of logs into a unified structure, defined as a five-tuple form: LogEntry = (Entity_ID, Timestamp, Input_Vector, Execution_Path, Output_Vector).
[0134] Entity_ID: Log belongs to test case or system module identification;
[0135] Timestamp: Event occurrence timestamp;
[0136] Input_Vector: Input parameters after vectorization encoding;
[0137] Execution_Path: Module call chain encoding;
[0138] Output_Vector: Output response embedding representation (such as JSON result embedding).
[0139] All logs are uniformly encoded and saved in the behavior comparison cache area for mismatch detection module call.
[0140] This step is used to identify areas of inconsistency or insufficient coverage between behavior and operation, referred to as modal mismatch area (S_diff).
[0141] First, based on the Execution_Path field, compare the behavior path sequences of the two log sources, use the Edit Distance algorithm to calculate the path difference, the larger the difference value, the more serious the behavior branch deviation. The matching score (Path_Score) is defined as: Path_Score = 1 minus (normalized edit distance between actual behavior path and test path);
[0142] Input_Vector and Output_Vector are considered as high-dimensional embedding vectors, and their cosine similarity between behavior and operation logs is calculated, respectively denoted as Input_Similarity and Output_Similarity.
[0143] By weighted combination of the three score items, the overall modal consistency score is defined: Consistency_Score = 0.4*Path_Score + 0.3*Input_Similarity + 0.3*Output_Similarity; if Consistency_Score is lower than threshold value θ_diff (recommended value is 0.7), it is determined that the current use case has modal mismatch, the behavior of which is marked as mismatch candidate area S_diff, and the relevant context information is recorded for subsequent correction model.
[0144] To intelligently give operable repair suggestions, the present application designs a correction suggestion generation model (CSG), which is implemented based on a double-tower neural network structure.
[0145] The CSG model includes two parts: a left tower network: used to encode the context vector of the current mismatch area, the input is the Input_Vector, Output_Vector and Execution_Path triplets of the mismatch use case, and after fusion, a mismatch semantic vector V_diff is formed;
[0146] a right tower network: used to index the use case semantic vectors in the historical repair case library, each historical repair record includes a pre-repair vector V_hist_pre and a post-repair suggestion text.
[0147] In the model training phase, the triplet loss (Triplet Loss) optimization target is adopted, so that the repair vectors of similar mismatch scenarios are close.
[0148] In the inference phase, the model receives the current mismatch semantic vector V_diff, searches for the most similar repair vector V_hist_pre in the historical library, and obtains a candidate repair suggestion set through vector distance Top-K retrieval.
[0149] At the same time, the Transformer decoder is introduced to reconstruct the context of the most similar vector, and finally output the specific repair suggestion text R_fix, including the following types of suggestions:
[0150] Suggesting to add test case fields;
[0151] Adjusting input parameter boundaries;
[0152] Modifying expected output logic;
[0153] Prompting potential missing R&D behaviors.
[0154] To realize the closed-loop linkage of test→R&D, the repair suggestions are automatically structured and pushed to the task management platform.
[0155] Connect to Jira, TAPD, etc. task management platform through Webhook or open API interface; submit CorrectionTask as a new "suggestion task" or "use case change item"; associate the original test case with the repair suggestion to ensure traceability; update the task state graph G_state, and mark the affected task nodes as "to be repaired" or "suggested update". All correction suggestions and corresponding mismatch areas, original behavior paths are recorded into the log database.
[0156] The R&D task state graph G_state is a directed graph G = (N, E), where: N represents the task node set, each node corresponds to an independent R&D task; E represents the edge set of the dependency relationship between tasks, including functional dependency, interface call, process sequence, etc. trigger logic.
[0157] Task node attribute design
[0158] Each node N_i contains the following attribute fields to fully express the task state and context information:
[0159] Task number (T_id): unique identifier;
[0160] Behavior label (action_type): such as "interface modification", "permission verification", "page update";
[0161] Current state (state_tag): initially "completed", and can be marked as "to be updated", "need to supplement", "test failed", "influence" and other states;
[0162] Origin type (origin_type): originally created or test feedback generated;
[0163] Coverage state (test_coverage): whether an effective test case has been associated;
[0164] Last update timestamp (last_update_ts);
[0165] Source feedback number (from_diff_id): if derived from mismatch correction, indicate the mismatch area ID.
[0166] Attribute design of edges in the graph
[0167] Each edge E_ij represents the causal relationship between node i and node j, with the following attributes:
[0168] Trigger type (trigger_type): such as "call dependency", "data input", "process preposition";
[0169] Propagation weight (W_ij): between 0 and 1, used to measure the degree of state influence;
[0170] Propagation directionality: default is i→j, i.e. upstream task influences downstream task.
[0171] The data structure of the state graph uses an adjacency list for storage, supporting fast insertion and update in a dynamic task environment.
[0172] When the test system identifies a modal mismatch and generates a correction suggestion R_fix from the rectification model, the system maps it to the task node in G_state and updates the node state field according to the suggestion type. For example:
[0173] If the suggestion is "add input validation", the original node is marked as "need to supplement";
[0174] If the suggestion is "expected output logic is wrong", it is marked as "to be updated";
[0175] If the suggestion cannot be located to a specific node, select the higher centrality in the adjacency node as the repair target.
[0176] The following state labels are predefined in the present application to give different linkage semantics to task nodes:
[0177] completed: completed;
[0178] test_failed: test failed;
[0179] pending_update: to be updated;
[0180] suggest_patch: suggest supplement;
[0181] affected: affected;
[0182] deprecated: marked as obsolete.
[0183] The state label supports dynamic switching, and the state transition history is recorded to support audit and evolution analysis.
[0184] When the state of a node changes, its influence may not be limited to the node itself, so it needs to propagate the "state influence degree" to adjacent task nodes to identify potential chain update requirements. This mechanism uses a weighted propagation function F_update to achieve it.
[0185] For state change node N_i, its influence degree to adjacent node N_j is recorded as S_ij, which is calculated as follows: S_ij=W_ij×A_i×D_f; wherein: W_ij is the propagation weight of edge E_ij, ranging from 0 to 1; A_i is the source node state severity coefficient, which is set according to the state, for example: pending_update: 0.8; suggest_patch: 0.6; test_failed: 1.0; D_f is the path distance attenuation factor, the default value is 0.9, and it is multiplied by 1 for each hop of propagation. The total score S_ij of the propagation influence is compared with the propagation threshold θ_propagation (the recommended threshold is 0.5): if S_ij≥θ_propagation, N_j is marked as affected; otherwise, the current state remains unchanged.
[0186] To prevent false positives caused by excessive propagation, the system sets the maximum propagation depth to 3 layers, and automatically truncates the propagation path beyond this depth. At the same time, the system supports a propagation blacklist mechanism, i.e. some uncontrollable or historically frozen modules do not participate in state linkage propagation.
[0187] When there are multiple task nodes with the state marked as "to be updated" or "affected" in the graph, the system will trigger the reverse R&D task generation or supplement process through the scheduling engine.
[0188] The new scheduling priority Score_priority is calculated for all candidate task nodes: Score_priority=w1×Centrality+w2×Severity +w3×Propagation_Radius; wherein: Centrality is the graph centrality score (such as PageRank); Severity is the current state severity score (test_failed is 1.0, suggest_patch is 0.6); Propagation_Radius is the number of affected neighbors of the node state; w1, w2, w3 are weighting factors, the default settings are 0.3, 0.4, 0.3. The higher the priority score, the more likely the task becomes the completion target of the reverse scheduling generation.
[0189] For high-priority nodes, the system generates new task suggestions from the task template library, including:
[0190] Task title and suggestion content;
[0191] Recommended responsible person (assigned by module);
[0192] Expected repair impact range;
[0193] Flow to the R&D task pool and mark the source as "test feedback driven".
[0194] The above description is only specific embodiments of the present application, but the protection scope of the present application is not limited thereto, and any person skilled in the art can easily think of changes or replacements within the technical scope disclosed by the present application, which should be covered in the protection scope of the present application.
Claims
1. An artificial intelligence-based R&D test two-way synchronization method, characterized in that: The application comprises: extracting original information with business behavior implications from multiple R&D data sources, including task descriptions, code changes, user stories, PRD documents and UI design data, and analyzing task behavior intentions and semantic logic through a multi-modal neural network to construct a causal intention graph; the causal intention graph is a directed graph structure with R&D task behavior units as graph nodes and semantic relationships as edges, used to express the causal driving relationship and behavior triggering path between tasks and modules; Based on the causal intention graph, upstream and downstream reasoning is performed to identify high-risk nodes and generate potential completion tasks in reverse; The high-risk nodes are divided by calculating the node risk score based on node semantic deviation degree, coverage blind area score and node centrality inverse score; The original R&D tasks and the completion tasks are fused to form a complete state set, and after conditional encoding, structured test cases are automatically generated, with task identifiers and causal path information attached; After test execution, behavior logs and running logs are collected in real time to detect mismatches between modalities. If there is a deviation, a correction suggestion is generated through a rectification model and automatically written back to the task pool; According to the correction result, the R&D task state graph is dynamically updated to realize the reverse linkage of test-driven R&D. 2.The AI-based R&D test bidirectional synchronization method of claim 1, wherein: The causal intention graph is constructed by analyzing behavior intentions and semantic logic through a multi-modal neural network, comprising: Based on the pre-trained language model, the task text, user story and PRD document are semantically encoded, and the task description vector V_text is outputted; The visual Transformer or object detection network is used for component recognition and layout modeling of UI design data, and the image semantic vector V_ui is outputted; The CodeBERT model is used for semantic change modeling of code changes, and the code feature vector V_code is outputted; The task description vector V_text, the task description vector V_text and the code feature vector V_code are identified as graph nodes through a node identification mechanism, and the semantic relationship strength between nodes is calculated using a Transformer encoder. According to the relationship strength threshold, the nodes are connected to form a causal intention graph G_causal with semantic paths, wherein the edges represent potential causal driving or dependent relationships. 3.The AI-based R&D test bidirectional synchronization method of claim 2, wherein: The upstream and downstream reasoning based on the causal intention graph comprises: For each node in the causal intention graph, a pre- and post-adjacent subgraph structure is constructed, and a graph neural network model is used to aggregate and propagate the node features in the subgraph to generate an upstream and downstream semantic representation vector for each node. The graph neural network is a graph convolution network or a graph attention network, which is used to model the potential causal chain dependent relationship between task behaviors. 4.The AI-based R&D test bidirectional synchronization method of claim 3, wherein: The high-risk node identification comprises: For each node, calculate its "influence" in the graph structure, i.e. the node centrality inverse score, including betweenness centrality and PageRank value; For each node, calculate the semantic cosine similarity between it and all upstream nodes; if the upstream nodes are set P, the current node vector is V_cur, and each node vector in P is V_pj, then the node semantic deviation degree D_p is: D_p = 1 minus the average (cosine similarity of V_cur and V_pj); Combine the historical use case library and the task log to count the frequency of each node being covered by the test path; if a node is never included in any path or its path only exists in a non-main stream, it is determined to be a coverage blind area; Calculate the node risk score: R_score = 0.4 × D_p + 0.4 × coverage blind area score + 0.2 × node centrality inverse score; if R_score is greater than 0.6, add the node to the high-risk causal node set. 5.The AI-based R&D test bidirectional synchronization method of claim 4, wherein: The reverse generation of the potential completion task includes: Take each node in the high-risk node set as a seed point, perform reverse path backtracking along its upstream path, and based on the missing behavior type and historical task template in the path, generate a structured completion task, including title, suggestion description, trigger condition and coverage object field, and mark it as a "test guide task". 6.The AI-based R&D test bidirectional synchronization method of claim 5, wherein: The conditionally encoded post-generation structured test case includes: Merge the original R&D task set and the completion task set generated by the causal graph reasoning at the structure level, remove task redundancy and semantic duplicates, and form a complete task state set containing task number, behavior label, data source and causal relationship path; Based on the semantic vector representation of the task nodes in the causal graph, calculate the semantic cosine similarity between the task pairs, and if the similarity is greater than a preset threshold θ_merge, determine that the tasks are redundant or semantically equivalent, and perform task merging operation; all the antecedent and consequent relationship edges in the causal path are retained after merging; For each task node in the complete task state set, extract its behavior type, source modality, causal position and strategy label to construct a multi-dimensional feature vector, and after concatenating all task vectors, fuse them with the multi-modal semantic vector to form a condition control vector, which is used to guide the generation of structured test cases and the strong correlation between task context and downstream test cases. 7.The AI-based R&D test bidirectional synchronization method of claim 6, wherein: Detecting the mismatch area between modalities includes: Compare the function paths, parameter changes and state transition sequences in the test behavior log and the running log, calculate the behavior consistency score between the log pairs using a sequence matching algorithm, and identify the modality mismatch area through a difference vector, if the consistency score is lower than the set threshold θ_diff, it is determined that there is a semantic deviation or an uncovered behavior. 8.The AI-based R&D test bidirectional synchronization method of claim 7, wherein: The generation of correction suggestions through the rectification model includes: Input the feature encoding of the mismatch area into the pre-trained rectification suggestion generation model, the rectification suggestion generation model is based on a double tower structure, the left tower input is the mismatch behavior semantic vector, and the right tower input is the historical repair case vector, through the similarity matching and context semantic synthesis mechanism, the suggestion repair content is output, including recommended supplementary test items, input parameter change suggestions, expected result adjustment or task completion prompts. 9.The AI-based R&D test bidirectional synchronization method of claim 8, wherein: The dynamic update of the R&D task state graph according to the correction result includes: The correction type in the deviation correction suggestion and the task identification are mapped to corresponding nodes in the R&D task state graph, and the nodes are marked as "to be updated", "to be supplemented" or "abnormal coverage" state labels; The nodes represent R&D task units, and the edges represent causal dependency relationships between tasks; The state updating process of the graph includes: for the nodes marked as "to be updated", propagating the updating influence score to the upstream and downstream, using the propagation function F_update, where the influence is proportional to the propagation weight of the dependent edge, and when the propagation score exceeds the set threshold θ_propagation, the state of the adjacent node is synchronously upgraded to "to be reviewed" or "influencing", thereby forming a chain linkage reminding mechanism; The "to be supplemented" and "to be reviewed" nodes in the state graph are re-evaluated for priority, combined with task weight, path centrality and influence radius, to automatically generate completion task suggestions or change orders, and push them to the R&D personnel task pool, marked as "test feedback driven task", to realize the reverse activation and dynamic linkage of test results on the R&D process.
Citation Information
Patent Citations
Software test management system and test method
CN119292931A
Research and development document processing method and device
CN120087351A