Test case recommendation method and device, electronic equipment, medium and product

By constructing a dynamic knowledge graph and using multi-source data fusion technology, the problems of low efficiency and incomplete coverage in test case generation were solved, enabling accurate response and comprehensive coverage to changing requirements, and improving the efficiency of test case generation and resource utilization.

CN121478637APending Publication Date: 2026-02-06CHINA FAW CO LTD
View PDF 0 Cites 3 Cited by

Patent Information

Application Number
CN202511462452.6
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2025-10-13
Publication Date
2026-02-06

AI Technical Summary

Technical Problem

In existing technologies, test case generation suffers from inefficiency, incomplete coverage, and inconsistency with requirements. This is especially true as the level of automotive intelligence and electrification continues to improve, making it difficult for manually written test cases to adapt to rapidly iterating functional requirements.

Method used

By constructing a dynamic knowledge graph to store the relationships between functional requirements, test scenarios, and test cases, and combining it with test environment status data, a set of test cases to be recommended is output. By utilizing NLP parsing, code difference analysis, and multi-source data fusion technologies, accurate association and rapid response to changing requirements can be achieved.

Benefits of technology

It improved the efficiency of test case generation, ensured the comprehensive coverage of test cases with changed requirements, reduced the false negative and false positive rates, reduced the proportion of manual review of high-risk test cases, and optimized the utilization of test resources.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN121478637A_ABST
    Figure CN121478637A_ABST
Patent Text Reader

Abstract

The invention discloses a test case recommendation method and device, electronic equipment, a medium and a product. The method comprises the following steps: when it is monitored that a function demand is changed, obtaining change content; constructing a dynamic knowledge graph according to the change content; wherein the dynamic knowledge graph stores an association relationship among a function requirement, a test scene and a test case; collecting test environment state data; and outputting a to-be-recommended test case set according to the test environment state data and the dynamic knowledge graph. According to the method, the problems of low test case generation efficiency, incomplete coverage and inconsistency with requirements caused by frequent change of function requirements can be solved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This application relates to the field of whole vehicle testing technology, specifically to a test case recommendation method, apparatus, electronic device, readable storage medium, and computer program product. Background Technology

[0002] In the field of vehicle development, test cases are the core means of verifying automotive functional requirements, and their generation efficiency and quality directly affect the project cycle. With the continuous improvement of automotive intelligence and electrification, functional requirements are characterized by high complexity and frequent changes, such as adding driver assistance functions, modifying energy management strategies, or removing redundant systems. Currently, the widely used test case generation method mainly relies on manual writing by test engineers. However, manual writing is slow and difficult to adapt to rapidly iterating changes in requirements, often resulting in test cases that are inconsistent with the latest requirements or lack complete coverage. On the other hand, facing increasingly complex system functional logic, manual writing lacks effective knowledge management and correlation analysis capabilities, making it difficult to ensure test adequacy, thus extending the testing cycle and becoming a bottleneck restricting on-time project delivery. Summary of the Invention

[0003] In view of the above problems, this application provides a test case recommendation method, apparatus, electronic device, readable storage medium, and computer program product, which can solve the problems of low test case generation efficiency, incomplete coverage, and inconsistency with requirements caused by frequent changes in functional requirements.

[0004] Firstly, this application provides a test case recommendation method, including: When a change in functional requirements is detected, obtain the details of the change; A dynamic knowledge graph is constructed based on the changes; wherein the dynamic knowledge graph stores the relationships between functional requirements, test scenarios, and test cases; Collect test environment status data; Based on the test environment status data and the dynamic knowledge graph, output a set of test cases to be recommended.

[0005] In the above technical solution, this method, upon detecting changes in functional requirements, acquires the changed content and constructs a dynamic knowledge graph that stores the relationships between functional requirements, test scenarios, and test cases. This accurately associates changed requirements with corresponding test elements, preventing test cases from becoming disconnected from requirements due to changes. Simultaneously, by combining collected test environment status data and outputting a recommended set of test cases based on the dynamic knowledge graph, it can quickly respond to requirement changes to improve test case generation efficiency. Furthermore, through association analysis of the knowledge graph, it ensures the comprehensive coverage of changed requirements by test cases, thereby solving the problems of low test case generation efficiency, incomplete coverage, and inconsistency with requirements.

[0006] In some embodiments, the method further includes: Collect full-process feedback data after the execution of the test case set; wherein, the full-process feedback data includes execution results, performance indicators and resource consumption; The entire process feedback data is analyzed for process anomalies and test performance to obtain the analysis results. The test case recommendation strategy is optimized based on the analysis results.

[0007] In the above technical solution, the method can accurately identify test execution problems and performance shortcomings, continuously optimize the test case recommendation strategy, and improve the adaptability and effectiveness of the recommended test cases.

[0008] In some implementations, obtaining the changed content includes: Obtain the original requirements document; The original requirements document is subjected to structured preprocessing to obtain preprocessed data; The key elements of the requirement change are extracted from the preprocessed data to obtain the change content; wherein, the change content includes the change type, the scope of impact, and the related functional domains.

[0009] In the above technical solution, this method can accurately identify the type of change, the scope of impact, and the related functional domains by performing structured preprocessing and key element extraction on the original requirements document, providing accurate change information support for subsequent construction of dynamic knowledge graphs and test case recommendations.

[0010] In some implementations, constructing a dynamic knowledge graph based on the changed content includes: Obtain the code change content corresponding to the aforementioned changes; A differential report is generated based on the changes and the code changes. The potential risk level of the changes is marked according to the differentiated report to obtain a set of confirmed changes with priority tags; Based on the confirmed change set, multi-source data fusion processing is performed to obtain a unified knowledge identifier; The unified knowledge identifier is matched against existing nodes to obtain the existing node matching results and the newly added entity. A dynamic knowledge graph is constructed by employing a progressive indexing strategy and matching the newly added entities with the existing nodes.

[0011] In the above technical solution, this method can generate differentiated reports by combining requirement changes and code changes and mark risk levels, so as to achieve accurate identification and priority ranking of changes; then, through multi-source data fusion and progressive index construction, the knowledge graph is updated efficiently to ensure the timeliness and accuracy of test case recommendations, while reducing potential risks.

[0012] In some implementations, obtaining the code change content corresponding to the changed content includes: Retrieve code commit records from the version control system based on the changes described; Obtain the target code based on the code submission record; The target code is analyzed at the code level using an abstract syntax tree to obtain the code changes.

[0013] In the above technical solution, the method can obtain code commit records related to requirement changes from the version control system, perform code-level change analysis on the target code through abstract syntax tree, and accurately identify the code change content.

[0014] In some implementations, generating a differentiation report based on the changes and the code changes includes: Establish a mapping relationship between the code changes and the requirement changes; Calculate the change confidence level based on the mapping relationship; Generate a differentiated report that includes the confidence level of the changes.

[0015] In the above technical solution, the method can establish a mapping relationship between requirement changes and code changes and calculate the change confidence level, generate a differentiated report containing the confidence level, thereby quantitatively evaluating the consistency between requirements and code implementation.

[0016] In some implementations, the step of marking potential risk levels of changes based on the differentiated report to obtain a set of confirmed changes with priority tags includes: The impact of change propagation was obtained by analyzing the differential report using a dependency graph. Based on pre-stored historical test data and the impact of the change propagation, predict the potential risk level of the change; Based on the potential risk level of the change and the differentiation report, a set of confirmed changes with priority tags is generated.

[0017] In the above technical solution, the method can analyze the impact of change propagation through dependency graphs and predict potential risk levels by combining historical test data, thereby prioritizing changes and ensuring that high-risk changes are processed first.

[0018] In some implementations, the step of performing multi-source data fusion processing based on the confirmed change set to obtain a unified knowledge identifier includes: The resource description triple is obtained by using the predefined ontology template and the confirmed change set; Obtain unstructured text and supplementary information; wherein the unstructured text includes at least historical test reports and design documents, and the supplementary information includes at least device topology and interface specifications; The joint extraction model is used to extract the functional component test item associations from the unstructured text; A similarity-based clustering-based conflict resolution algorithm is used to perform multi-source data fusion processing on the resource description triples, the functional component test item associations, and the supplementary information to obtain a unified knowledge identifier.

[0019] In the above technical solution, the method can extract the association between functional components and test items from multi-source heterogeneous data, realize data fusion through similarity clustering conflict resolution algorithm, form a unified knowledge identifier, improve the integrity and consistency of knowledge graph construction, and provide a more comprehensive and accurate knowledge foundation for test case recommendation.

[0020] In some implementations, the step of outputting a set of test cases to be recommended based on the test environment state data and the dynamic knowledge graph includes: The test environment status data is fused to generate a dynamic environment vector; wherein, the test environment status data includes system environment context information, project progress context information, and historical performance context information. Based on the dynamic knowledge graph and the dynamic environment vector, a test applicability scoring model is constructed; An initial test case candidate set is obtained based on the preset test case recommendation strategy and the test applicability scoring model; The initial test case candidate set is optimized and sorted using multiple objectives, and a test case set to be recommended is output.

[0021] In the above technical solution, the method can comprehensively consider multi-dimensional information such as system environment, project progress and historical performance, construct a test applicability scoring model and perform multi-objective optimization and sorting, thereby outputting a test case set that is highly matched with the current environment and has reasonable priority.

[0022] Secondly, this application provides a test case recommendation device, comprising: The acquisition unit is used to acquire the changes when functional requirements are detected. A construction unit is used to construct a dynamic knowledge graph based on the changes; wherein the dynamic knowledge graph stores the relationships between functional requirements, test scenarios, and test cases; The data acquisition unit is used to collect test environment status data; The output unit is used to output a set of test cases to be recommended based on the test environment status data and the dynamic knowledge graph.

[0023] In the above technical solution, when a change in functional requirements is detected, the device can acquire the changed content and construct a dynamic knowledge graph that stores the relationships between functional requirements, test scenarios, and test cases. This allows for accurate association between changed requirements and corresponding test elements, preventing test cases from becoming disconnected from requirements due to changes. Simultaneously, by combining collected test environment status data and outputting a recommended set of test cases based on the dynamic knowledge graph, the device can quickly respond to changes in requirements to improve test case generation efficiency. Furthermore, the association analysis of the knowledge graph ensures comprehensive coverage of changed requirements by the test cases, thereby solving the problems of low test case generation efficiency, incomplete coverage, and inconsistency with requirements.

[0024] Thirdly, this application provides an electronic device including a memory and a processor, the memory storing a computer program, and the processor running the computer program to cause the electronic device to perform the test case recommendation method described in any one of the first aspects.

[0025] Fourthly, this application provides a readable storage medium storing a computer program, which, when executed by a processor, performs the test case recommendation method described in any one of the first aspects.

[0026] Fifthly, this application provides a computer program product comprising a computer program that, when executed by a processor, performs the test case recommendation method described in any one of the first aspects.

[0027] The beneficial effects of this application are as follows: By combining multi-source data fusion technology with NLP parsing, code difference analysis, and requirements management system association, the false negative and false positive rates of change reporting can be effectively reduced; at the same time, by leveraging dynamic expansion mechanisms and graph neural network inference technology, the test case coverage for new functional requirements can be improved, overcoming the limitations of static knowledge bases; in addition, by combining context awareness, reinforcement learning optimization technology, and closed-loop tuning mechanisms, the proportion of manual review of high-risk test cases can be significantly reduced, improving automation level and efficiency; finally, through resource monitoring and collaborative filtering algorithms, the utilization rate of test equipment can be improved and the overall test cost can be reduced, adapting to the current industry situation of scarce test resources. Attached Figure Description

[0028] To more clearly illustrate the technical solutions of the embodiments of this application, the accompanying drawings used in the embodiments of this application will be briefly introduced below. It should be understood that the following drawings only show some embodiments of this application and should not be regarded as a limitation of the scope. For those skilled in the art, other related drawings can be obtained based on these drawings without creative effort.

[0029] Figure 1 This is a flowchart illustrating the test case recommendation method in some embodiments of this application; Figure 2 This is a framework diagram of the intelligent recommendation processing system for test cases in some embodiments of this application; Figure 3 This is a schematic diagram of the test case recommendation device in some embodiments of this application; Figure 4 This is a schematic diagram of the structure of an electronic device in some embodiments of this application. Detailed Implementation

[0030] The embodiments of the technical solution of this application will now be described in detail with reference to the accompanying drawings. These embodiments are only used to more clearly illustrate the technical solution of this application and are therefore merely examples, and should not be used to limit the scope of protection of this application.

[0031] Unless otherwise defined, all technical and scientific terms used herein have the same meaning as commonly understood by one of ordinary skill in the art to which this application pertains; the terminology used herein is for the purpose of describing particular embodiments only and is not intended to limit the application; the terms “comprising” and “having”, and any variations thereof, in the specification, claims, and foregoing description of the drawings are intended to cover non-exclusive inclusion.

[0032] In the description of the embodiments of this application, technical terms such as "first" and "second" are used only to distinguish different objects and should not be construed as indicating or implying relative importance or implicitly specifying the number, specific order, or primary and secondary relationship of the indicated technical features. In the description of the embodiments of this application, "multiple" means two or more (including two), similarly, "multiple sets" refers to two or more sets (including two sets), and "multiple pieces" refers to two or more pieces (including two pieces) unless otherwise explicitly defined.

[0033] In this document, the term "embodiment" means that a particular feature, structure, or characteristic described in connection with an embodiment may be included in at least one embodiment of this application. The appearance of this phrase in various places throughout the specification does not necessarily refer to the same embodiment, nor is it a separate or alternative embodiment mutually exclusive with other embodiments. It will be explicitly and implicitly understood by those skilled in the art that the embodiments described herein can be combined with other embodiments.

[0034] In the description of the embodiments in this application, the term "and / or" is merely a description of the relationship between related objects, indicating that three relationships can exist. For example, A and / or B can represent: A existing alone, A and B existing simultaneously, and B existing alone. Additionally, the character " / " in this document generally indicates that the preceding and following related objects have an "or" relationship.

[0035] In existing technologies, traditional methods mainly face four core problems: first, over-reliance on historical document comparison leads to incomplete change identification; second, the limited coverage of static knowledge bases makes it difficult to adapt to new requirements; third, high-risk test cases still require a lot of manual review; and fourth, there is a lack of dynamic optimization and configuration of test resources.

[0036] To address the aforementioned technical issues, this application provides a test case recommendation method. This method utilizes multi-source data fusion technology from a dynamic requirement change perception module (combining NLP parsing, code difference analysis, and association with the requirement management system) to systematically reduce both false negative and false positive rates, thus resolving the problem of inaccurate change identification caused by incomplete historical documentation in traditional methods.

[0037] Secondly, the dynamic expansion mechanism and graph neural network reasoning technology adopted by the intelligent knowledge graph construction module improve the test case coverage of the system for new functional requirements compared to traditional methods, effectively breaking through the limitations of static knowledge bases.

[0038] In terms of automation, the test case recommendation engine in this method, through context awareness and reinforcement learning optimization techniques, can reduce the proportion of manual review of high-risk test cases by combining the closed-loop tuning mechanism of the adaptive feedback module.

[0039] Meanwhile, the new resource monitoring and collaborative filtering algorithms can also improve the utilization rate of testing equipment and reduce the overall testing cost.

[0040] like Figure 1 As shown, some embodiments of this application provide a test case recommendation method, which includes: S101. When a change in functional requirements is detected, obtain the details of the change; S102. Construct a dynamic knowledge graph based on the changes; wherein, the dynamic knowledge graph stores the relationships between functional requirements, test scenarios, and test cases; S103. Collect test environment status data; S104. Based on the test environment status data and dynamic knowledge graph, output the set of test cases to be recommended; S105. Collect the full-process feedback data after the test case set is executed; the full-process feedback data includes execution results, performance indicators and resource consumption. S106. Analyze the process anomalies and test performance of the feedback data throughout the entire process, and obtain the analysis results; S107. Optimize the test case recommendation strategy based on the analysis results.

[0041] In some embodiments, functional requirement changes refer to functional requirements that need to be added, modified, or deleted during the automotive development process. These changes can be monitored and captured in real time by the requirement change dynamic perception module through multi-dimensional data collection (such as requirement documents and code commit records). The changes will be accurately identified through intelligent technologies such as semantic parsing and code difference analysis.

[0042] In some embodiments, the changed content refers to the key information on functional requirement changes extracted by the requirement change dynamic perception module, including the change type (addition / modification / deletion), scope of impact, and associated functional domains. This information is extracted from the requirement document by the NLP unit using semantic parsing technology, and verified by the version difference analysis unit in conjunction with code changes. Finally, it forms a structured information with confidence and is synchronized to the intelligent knowledge graph construction module.

[0043] In some embodiments, a dynamic knowledge graph refers to a dynamic and scalable knowledge structure built by an intelligent knowledge graph construction module based on changes in content. It stores the relationships between functional requirements, test scenarios, and test cases (including historical test cases). It adopts a two-layer graph structure (the basic graph layer persistently stores core entities and static relationships, and the incremental graph layer maintains newly added relationships after changes). It also uses graph neural network reasoning to mine potential test association rules and supports real-time updates to adapt to changes in requirements.

[0044] In some embodiments, test environment status data refers to multi-dimensional information related to test execution collected in real time by the context-aware unit of the test case recommendation engine, including system environment (such as test equipment status, test bench configuration), project progress (such as milestone data, defect convergence curves) and historical performance (such as historical pass rate and average execution time of similar test cases). After feature fusion, a dynamic environment vector is generated for test case adaptation analysis.

[0045] In some embodiments, the test case set to be recommended refers to the set of adapted test cases output by the test case recommendation engine in combination with test environment state data and dynamic knowledge graph. The collaborative filtering recommendation unit first generates an initial candidate set based on the dimensions of function, environment and team, and then the reinforcement learning optimization unit optimizes the ranking through the MDP model (considering coverage, execution efficiency and quality risk). Each test case is accompanied by a recommendation decision path (such as the triggered graph node and the referenced historical records).

[0046] In some embodiments, the full-process feedback data refers to the test case set execution full-cycle data captured in real time by the multi-dimensional data acquisition unit of the adaptive optimization and feedback module, including execution results (such as pass / fail, defect level), performance indicators (such as runtime, memory usage, communication latency) and resource consumption (such as test equipment utilization, energy consumption, frequency of manual intervention), which are stored in a time-series database and preprocessed by stream processing technology for strategy optimization.

[0047] In some embodiments, process anomaly analysis refers to the identification and analysis of abnormal situations in the test execution process by the intelligent analysis and evaluation unit of the adaptive optimization and feedback module. It uses the CUSUM control chart model to monitor test performance fluctuations in real time, locate problems such as test equipment malfunctions and execution delays, and the results serve as one of the bases for optimizing test case recommendation strategies.

[0048] In some embodiments, test performance analysis refers to the evaluation operation carried out by the intelligent analysis and evaluation unit of the adaptive optimization and feedback module on the test execution effect. Combining the feedback data of the whole process, the trend of indicators such as test cycle and defect detection rate is analyzed by using time series prediction (such as the Prophet algorithm), and the SHAP framework is used to quantify the influence weight of each factor on the test effect, so as to provide performance data support for the optimization of recommended strategies.

[0049] In some embodiments, the analysis result refers to the comprehensive evaluation result obtained by the intelligent analysis and evaluation unit of the adaptive optimization and feedback module after performing process anomaly analysis and test performance analysis on the feedback data of the whole process. It includes anomaly location, performance indicator trend, influencing factor weight and standardization improvement direction, which can be dynamically supplemented to the intelligent knowledge graph and used by the strategy optimization decision unit to adjust the test case recommendation strategy (such as recommendation algorithm weight and risk judgment threshold).

[0050] In some embodiments, the test case recommendation strategy refers to the set of algorithms and rules used by the test case recommendation engine to generate and sort test cases to be recommended. It is supported by collaborative filtering (three-dimensional filtering) and reinforcement learning (DDQN algorithm) technologies. The adaptive optimization and feedback module will perform multi-objective (coverage, efficiency, cost) optimization through mixed integer programming (NSGA-II algorithm) based on the analysis results to achieve automatic iterative optimization 24 hours a day.

[0051] In the above embodiments, when functional requirement changes are detected, this method can acquire the changed content and construct a dynamic knowledge graph that stores the relationships between functional requirements, test scenarios, and test cases. This accurately associates changed requirements with corresponding test elements, preventing test cases from becoming disconnected from requirements due to changes. Simultaneously, by combining collected test environment status data and outputting a set of recommended test cases based on the dynamic knowledge graph, it can quickly respond to requirement changes to improve test case generation efficiency. Furthermore, the association analysis of the knowledge graph ensures the comprehensive coverage of changed requirements by test cases, thereby solving the problems of low test case generation efficiency, incomplete coverage, and inconsistency with requirements.

[0052] In some embodiments, obtaining the changed content includes: Obtain the original requirements document; The original requirements document is preprocessed in a structured manner to obtain preprocessed data; The key elements of the requirement change are extracted from the preprocessed data to obtain the change content; the change content includes the change type, scope of impact, and related functional domains.

[0053] In some embodiments, the original requirements document refers to various documents that record functional requirements during the automotive development process, including structured requirements documents (such as specification definition documents and requirements list tables) and unstructured requirements documents (such as historical test reports, design specification documents, and work order data in requirements management systems (such as JIRA), which are the basic data sources for the requirements change dynamic perception module to carry out change identification.

[0054] In some embodiments, the method can first perform basic text processing on the original requirement document (including structured / unstructured documents), including word segmentation (splitting continuous text into semantically independent words), part-of-speech tagging (annotating the grammatical attributes of each word, such as nouns and verbs), and named entity recognition (identifying key entities in the document that are related to the requirements, such as function names, component types, etc.), and finally obtain preprocessed data with a well-formatted structure and preliminary semantic information.

[0055] In some embodiments, the preprocessed data is intermediate data obtained after the original requirement document has been structured and preprocessed by NLP units. It is characterized by regular format, preliminary extraction of semantic information, and completion of word segmentation, part-of-speech tagging and named entity recognition. It eliminates the problem of messy format of the original document (especially unstructured document) and provides a standardized data foundation for the subsequent extraction of key elements of requirement changes.

[0056] In some embodiments, the method can employ a Transformer-based deep learning model (such as BERT) to perform semantic deep analysis on the preprocessed data, and combine it with professional semantic rules of the requirement domain to extract core information related to requirement changes from the preprocessed data. At the same time, the extraction results will be interactively verified with the code change data output by the version difference analysis unit (such as code commit records obtained from Git and code changes analyzed by AST) to ensure that the extracted key elements accurately reflect the real requirement changes.

[0057] In some embodiments, key elements refer to a set of elements that can accurately describe the core information of requirement changes. These are key contents extracted from preprocessed data to define the nature of requirement changes, specifically including three types of information: change type, scope of impact, and associated functional domains. They serve as the core basis for subsequently building a dynamic knowledge graph and generating differentiated reports.

[0058] In some embodiments, the changed content refers to the structured information that fully describes the change in requirements, which is finally output by the requirement change dynamic perception module. It consists of two parts: first, the key elements extracted by the NLP unit (change type, scope of impact, and associated functional domains); and second, the information supplemented by the version difference analysis unit after verification (such as change confidence). It needs to be confirmed by the closed-loop logic of "document parsing - code verification - comprehensive judgment" and finally synchronized to the intelligent knowledge graph construction module for graph update.

[0059] In some embodiments, the change type refers to the specific form of the requirement change, which is divided into three categories: addition (adding functional requirements that did not exist before), modification (adjusting the parameters, logic or standards of existing functional requirements), and deletion (removing functional requirements that are no longer needed). It is the definition of the "form" of change in the key elements.

[0060] In some embodiments, the scope of impact refers to the range of automotive development-related aspects or components that may be affected by the change in requirements. For example, the impact of a functional change on hardware / software components such as domain controllers and CAN buses, or the impact on testing processes and project schedules. This is the definition of the "breadth of impact" of the change in the key elements.

[0061] In some embodiments, associated functional domains refer to functional areas that are business-related or technically dependent on the change requirements, such as the "charging control functional domain" or "energy recovery functional domain" that may be associated with "battery management function change". This is the definition of the "association relationship" of the change in the key elements.

[0062] In the above embodiments, the method can accurately identify the change type, scope of impact and related functional domains by performing structured preprocessing and key element extraction on the original requirements document, providing accurate change information support for subsequent construction of dynamic knowledge graph and test case recommendation.

[0063] In some embodiments, a dynamic knowledge graph is constructed based on the changed content, including: Retrieve the code change details corresponding to the changed content; Generate a differential report based on the changes and code changes; Based on the differentiated reports, the potential risk levels of the changes are marked to obtain a set of confirmed changes with priority tags; A unified knowledge identifier is obtained by performing multi-source data fusion processing based on the confirmed change set. The unified knowledge identifier is matched against existing nodes to obtain the matching results of existing nodes and the newly added entities. A dynamic knowledge graph is constructed by using a progressive indexing strategy and matching results between new entities and existing nodes.

[0064] In some embodiments, the method can obtain the corresponding code commit records from a version control system (such as Git) based on the changes; perform code-level change analysis on the target code in the commit records using an abstract syntax tree (AST); perform spatiotemporal correlation analysis by combining the work order data from a requirements management system (such as JIRA) to establish a mapping relationship of "requirement change - code modification"; and finally, output the code change content that corresponds one-to-one with the requirement change.

[0065] In some embodiments, code changes refer to modifications identified at the code level that are related to changes in requirements, including the location, scope, and specific content of added or deleted code, and the positional relationship of these changes within the code structure.

[0066] In some embodiments, the method can construct a mapping relationship between requirement changes and code changes; calculate change confidence (i.e., the degree of matching between requirement changes and code changes); and generate a differentiated report containing change confidence for subsequent risk assessment and decision-making.

[0067] In some embodiments, a differential report refers to a structured document generated after analyzing the combined results of requirement changes and code changes. It mainly includes the content of the changes, the corresponding code modification locations, the confidence level of the changes, and possible inconsistency warnings, and is used to verify the consistency between the requirements and the code implementation.

[0068] In some embodiments, the method can analyze the propagation impact of changes through dependency graphs; predict potential risk levels by combining historical test data; prioritize changes according to risk levels; and generate a set of confirmed changes with priority tags.

[0069] In some embodiments, the method can convert confirmed change sets into resource description triples using a predefined ontology template; extract the association between functional components and test items from unstructured text (such as historical test reports and design documents); obtain supplementary information such as device topology and interface specifications from systems such as PLM and ALM; and integrate triples, associations, and supplementary information using a similarity-based clustering conflict resolution algorithm to form a unified knowledge identifier.

[0070] In some embodiments, a unified knowledge identifier is a standardized knowledge format formed by integrating multi-source heterogeneous data (structured, unstructured, and cross-system information). It typically exists in the form of RDF triples or graph structures to ensure that knowledge from different sources can be understood and processed in a unified manner.

[0071] In some embodiments, the method can match entities in the unified knowledge identifier with existing nodes in the knowledge graph; entities that are successfully matched form the existing node matching results; entities that are not successfully matched are added as new entities, ready to be added to the knowledge graph.

[0072] In some embodiments, the existing node matching result refers to the result of a successful match between an entity in the unified knowledge identifier and an existing node in the knowledge graph, indicating that these entities already exist in the graph.

[0073] In some embodiments, a new entity refers to an entity in the unified knowledge identifier that has not been matched in the knowledge graph and needs to be added to the graph as a new node.

[0074] In some embodiments, the method can employ a progressive indexing strategy for newly added entities to ensure query efficiency under large-scale data; add the newly added entities as new nodes to the knowledge graph and establish associations with other nodes; update the attributes or relationships of existing nodes in the graph based on the matching results of existing nodes; and continuously improve and optimize the structure and content of the knowledge graph by combining the analysis results of the graph neural network inference unit to achieve dynamic updates.

[0075] In the above embodiments, the method can generate differentiated reports by combining requirement changes and code changes and mark risk levels, thereby achieving accurate identification and priority ranking of changes; and through multi-source data fusion and progressive index construction, it can efficiently update the knowledge graph, ensuring the timeliness and accuracy of test case recommendations, while reducing potential risks.

[0076] In some embodiments, obtaining the code change content corresponding to the changed content includes: Retrieve code commit records from the version control system based on the changes made; Obtain the target code based on the code commit history; By using an abstract syntax tree to perform code-level change analysis on the target code, the changes to the code can be obtained.

[0077] In some embodiments, code commit records are records stored in a version control system (such as Git) that are generated when developers commit code modifications, and are retrieved from the system by the version difference analysis unit. They include the committer, commit time, commit log (explaining the purpose of the modification), and a list of file changes (deleting, adding, or modifying files involved). Their core function is to provide clues linking "requirement changes and code modifications" for subsequent analysis, serving as the fundamental data source for extracting target code and identifying code changes.

[0078] In some embodiments, target code refers to source code files or code snippets selected from code commit records that are directly related to the current functional requirement changes. It is the core analysis object of the version difference analysis unit. The unit parses the target code using an Abstract Syntax Tree (AST) to identify specific modifications at the code level. The selection criteria match the impact scope and associated functional domains of the requirement changes, ensuring that the analyzed code accurately corresponds to the requirement changes.

[0079] In some embodiments, the code change content refers to the specific modification results obtained by the version difference analysis unit after analyzing the target code, including information such as the addition, deletion, and modification of code segments, as well as code structure adjustments (such as function splitting and class merging). During the analysis process, a tree-structured difference detection algorithm (such as the Gumtree algorithm) is used, and spatiotemporal correlation verification is performed with the requirement change content. Ultimately, a result reflecting the "implementation of requirement changes at the code level" is generated, providing a basis for code-side changes to generate a differentiation report and construct a dynamic knowledge graph.

[0080] In the above embodiments, the method can obtain code commit records related to requirement changes from the version control system, perform code-level change analysis on the target code through abstract syntax tree, and accurately identify the code change content.

[0081] In some embodiments, a differential report is generated based on the changes and code changes, including: Establish a mapping relationship between code changes and requirement changes; Calculate the change confidence level based on the mapping relationship; Generate a differentiated report that includes the confidence level of the change.

[0082] In some embodiments, the mapping relationship refers to the correspondence between requirement changes and code modifications. It uses spatiotemporal correlation analysis to link the work order data of the requirement management system (such as JIRA) with the code commit records of the version control system (such as Git), clarifying which code changes correspond to which requirement changes.

[0083] In some embodiments, change confidence is an indicator that measures the degree of matching between requirement changes and corresponding code changes. It is calculated by the version difference analysis unit when generating the difference report and reflects the consistency and reliability from document parsing to code implementation.

[0084] In some embodiments, the differential report is a structured document generated after integrating the analysis results of requirement changes and code changes. It includes the content of the changes, the corresponding code modification locations, the change confidence level, and possible inconsistency hints. It is used to verify the consistency between requirements and code implementation and to provide a basis for change impact assessment and risk analysis.

[0085] In the above embodiments, the method can establish a mapping relationship between requirement changes and code changes and calculate the change confidence level, generate a differentiated report containing the confidence level, thereby quantitatively evaluating the consistency between requirements and code implementation.

[0086] In some embodiments, the potential risk level of changes is marked based on the differentiated report to obtain a set of confirmed changes with priority tags, including: The impact of change propagation can be obtained by analyzing the differential reports using a dependency graph; Based on pre-stored historical test data and the impact of change propagation, predict the potential risk level of the change; Based on the potential risk level of the change and the differentiated report, generate a set of confirmed changes with priority tags.

[0087] In some embodiments, change propagation impact refers to the chain reaction and scope of a system triggered by a change in a requirement, which is derived through dependency graph analysis. For example, a change in a functional requirement may affect multiple related modules, interfaces, test cases, and even project schedules; change propagation impact is a systematic assessment of this chain reaction.

[0088] In some embodiments, the potential risk level of a change refers to the level of risk predicted by a hybrid model combining a rule engine and machine learning (such as a random forest), based on historical test data, the scope of the change's propagation impact, and system dependencies. Risk levels are typically categorized as high, medium, and low, and are used to guide test resource allocation and execution priorities.

[0089] In some embodiments, the set of confirmed changes with priority tags refers to the set of requirement changes that have been analyzed and confirmed to be valid. Each change is given a priority tag (such as P1 high priority, P2 medium priority, P3 low priority) based on its potential risk level, scope of impact, project schedule, and other factors, so that the test case recommendation engine can prioritize high priority changes.

[0090] In the above embodiments, the method can analyze the impact of change propagation through dependency graphs and predict potential risk levels by combining historical test data, thereby prioritizing changes and ensuring that high-risk changes are processed first.

[0091] In some embodiments, multi-source data fusion processing is performed based on the confirmed change set to obtain a unified knowledge identifier, including: Obtain the resource description triplet by using the predefined ontology template and the confirmed change set; Obtain unstructured text and supplementary information; the unstructured text should include at least historical test reports and design documents, and the supplementary information should include at least device topology and interface specifications. Use a joint extraction model to extract the associations of functional component test items from unstructured text; A similarity-based clustering-based conflict resolution algorithm is used to perform multi-source data fusion processing on resource description triples, functional component test item associations, and supplementary information to obtain a unified knowledge identifier.

[0092] In some embodiments, the resource description triple refers to the "entity-relationship-entity" format data transformed by the knowledge extraction and fusion unit according to the predefined OWL ontology template, which is the basic unit for building a knowledge graph (such as "functional requirement A-association-test scenario B").

[0093] In some embodiments, the functional component test item association refers to the correspondence between “function-component-test item” extracted from historical test reports, design documents and other texts through the BiLSTM-CRF model (such as “battery management function-battery ECU-charging voltage test item”), which is used to improve the knowledge graph association network.

[0094] In some embodiments, the unified knowledge identifier is a standardized knowledge format formed by integrating supplementary information such as resource description triples, functional component test item relationships, and device topology after conflict resolution, ensuring that multi-source knowledge can be uniformly identified and invoked by the knowledge graph.

[0095] In the above embodiments, the method can extract the association between functional components and test items from multi-source heterogeneous data, achieve data fusion through similarity clustering conflict resolution algorithm, form a unified knowledge identifier, improve the integrity and consistency of knowledge graph construction, and provide a more comprehensive and accurate knowledge foundation for test case recommendation.

[0096] In some embodiments, based on test environment state data and a dynamic knowledge graph, a set of test cases to be recommended is output, including: The test environment status data is fused to generate a dynamic environment vector; the test environment status data includes system environment context information, project progress context information, and historical performance context information. A test suitability scoring model is constructed based on dynamic knowledge graphs and dynamic environment vectors; An initial set of candidate test cases is obtained based on a pre-defined test case recommendation strategy and a test suitability scoring model. Perform multi-objective optimization and sorting on the initial candidate set of test cases, and output the set of test cases to be recommended.

[0097] In some embodiments, the dynamic environment vector refers to the context-aware unit of the test case recommendation engine. It is a feature vector generated by weighting and integrating three types of context information—system environment (such as device status), project progress (such as milestones), and historical performance (such as test case pass rate)—through an attention mechanism. It can dynamically reflect the actual conditions of the current test scenario.

[0098] In some embodiments, the test suitability scoring model refers to a model built by the collaborative filtering recommendation unit based on dynamic environment vectors, used to evaluate the suitability of different test cases with the current test scenario, and to select test cases that are more in line with environmental constraints through quantitative scoring.

[0099] In some embodiments, the initial test case candidate set refers to the set of test cases initially selected by the collaborative filtering recommendation unit after dimensionality reduction processing by the SVD++ algorithm, which combines functional similarity (based on graph association), test applicability score (based on environment), and team preference (based on historical records). This set forms the basis for subsequent optimization and ranking.

[0100] In some embodiments, the set of test cases to be recommended refers to the set of suitable test cases that can be output to test engineers after the initial candidate set is further sorted and optimized by the reinforcement learning optimization unit (through the MDP model, which integrates coverage, efficiency, and risk), with a recommended decision path to ensure interpretability.

[0101] In the above embodiments, the method can comprehensively consider multi-dimensional information such as system environment, project progress and historical performance, construct a test applicability scoring model and perform multi-objective optimization and sorting, thereby outputting a test case set that is highly matched with the current environment and has reasonable priority.

[0102] To make the objectives, technical solutions, and advantages of this application clearer, the technical solutions in this application will be clearly and completely described below. In some embodiments, Figure 2This paper presents a test case intelligent recommendation processing system applying this test case recommendation method. The system includes a requirement change dynamic perception module, an intelligent knowledge graph construction module, a test case recommendation engine, and an adaptive optimization and feedback module. The requirement change dynamic perception module is used to monitor changes in functional requirements in real time and output the changes. The intelligent knowledge graph construction module is connected to the requirement change dynamic perception module. It is used to build a dynamic and scalable knowledge graph based on the changed content and store the relationship between functional requirements, test scenarios and historical test cases. The test case recommendation engine, connected to the intelligent knowledge graph construction module, is used to recommend suitable test cases from the knowledge graph by combining contextual information. The adaptive optimization and feedback module connects to the test case recommendation engine and is used to optimize the recommendation strategy based on test execution feedback data.

[0103] In some embodiments, the dynamic requirement change perception module is specifically used to capture and analyze changes in functional requirements in real time. Through multi-dimensional data collection and intelligent analysis technologies, it overcomes the limitations of traditional methods that rely on historical document comparison, achieving more accurate change identification. The dynamic requirement change perception module includes: a Natural Language Processing (NLP) unit, a version difference analysis unit, and a change impact assessment unit.

[0104] In some embodiments, the Natural Language Processing (NLP) unit is used to process structured / unstructured requirement documents using semantic parsing techniques. Specifically, the NLP unit first preprocesses the requirement documents (including word segmentation, part-of-speech tagging, and named entity recognition), and then uses a Transformer-based deep learning model (such as BERT) to extract key elements of requirement changes, including change type (addition / modification / deletion), scope of impact, and associated functional domains. The output of this unit serves as input to the version difference analysis unit and is directly connected to the intelligent knowledge graph construction module, synchronizing the parsed structured change information to the knowledge graph in real time.

[0105] In some embodiments, the version difference analysis unit is used to work in conjunction with the NLP unit, employing a tree-based difference detection algorithm (such as the Gumtree algorithm). Specifically, the version difference analysis unit is implemented according to the following process: (1) Obtain code commit records from version control systems (such as Git) and analyze code-level changes through abstract syntax trees (ASTs); (2) Perform spatiotemporal correlation analysis with the work order data of the demand management system (such as JIRA) to establish a mapping relationship of "demand change - code modification"; (3) Generate a differentiated report containing the confidence level of the change. This unit interacts with the NLP unit through bidirectional data flow for verification. When there is a contradiction between document parsing and code changes, a manual review process is triggered.

[0106] In some embodiments, the change impact assessment unit receives dual inputs from both the NLP unit and the version difference analysis unit. Its implementation employs a hybrid decision-making model based on rule engines and machine learning (such as random forests), and the implementation process is as follows: (1) Analyze the propagation impact of changes using dependency graphs; (2) Predict the potential risk level by combining historical test data; (3) Output the set of changes with priority tags.

[0107] This unit interacts directly with the test case recommendation engine, pushing high-priority changes to the recommendation process in real time.

[0108] In some embodiments, the data flow between units follows a closed-loop logic of "collection-parsing-verification-decision". That is, the NLP unit extracts initial change signals from the document side → the version difference unit provides supporting data from the code side → the impact assessment unit comprehensively judges the validity of the change. This multi-source verification mechanism significantly reduces the false positive rate.

[0109] In some embodiments, the requirement change dynamic awareness module maintains real-time synchronization with the intelligent knowledge graph construction module through a standardized API interface, ensuring that each confirmed change triggers an immediate update of the knowledge graph. Simultaneously, the module's built-in ChangeEventBus pushes asynchronous messages to the test case recommendation engine, supporting real-time responses based on a publish-subscribe model. This design reduces the system's average change response time.

[0110] In some embodiments, the requirement change dynamic awareness module innovatively introduces "change traceability chain" technology: assigning a unique traceability ID to each identified change and recording its complete evidence chain from requirement proposal and document modification to code implementation. This technology not only solves the problem of "omissions due to chaotic version management" in the background technology, but also provides an auditable decision basis for subsequent test case recommendations.

[0111] In some embodiments, the intelligent knowledge graph construction module is mainly used to transform dynamically perceived changes in requirements into structured knowledge and establish a multi-dimensional test association network to overcome the limitations of traditional static knowledge bases. The intelligent knowledge graph construction module includes: a knowledge extraction and fusion unit, a dynamic graph construction unit, and a graph neural network reasoning unit.

[0112] In some embodiments, the knowledge extraction and fusion unit adopts a hybrid knowledge acquisition strategy, specifically including three parallel processing channels: (1) The structured data channel directly parses the standardized change description output by the dynamic perception module of demand change, and converts it into RDF triples through the predefined OWL ontology template; (2) The unstructured text channel uses a joint extraction model based on BiLSTM-CRF to extract the "function-component-test item" relationship from text data such as historical test reports and design documents; (3) Cross-system interface channel obtains supplementary information such as device topology and interface specifications from enterprise systems such as PLM and ALM through adapter interface.

[0113] The outputs of the three channels are integrated at the knowledge fusion layer using a conflict resolution algorithm based on similarity clustering to form a unified knowledge representation. This unit maintains real-time data synchronization with the dynamic requirement change perception module, ensuring that newly identified changes can enter the processing pipeline within 300ms.

[0114] In some embodiments, the dynamic graph construction unit adopts a two-layer graph structure storage system: (1) The basic graph layer uses Neo4j graph database to persistently store core entities (such as functional requirements and test scenarios) and their static relationships; (2) The incremental graph layer maintains temporary associations based on in-memory computing frameworks (such as Apache Flink), especially new edges introduced by changes in requirements.

[0115] During implementation, upon receiving a data packet from the knowledge extraction unit, existing nodes are first matched using entity linking technology. For newly added entities, a progressive indexing strategy is employed to ensure a query response efficiency of over 95% even with large-scale data. This unit interacts with the test case recommendation engine through a graph state listener, proactively pushing graph update events when changes to key entities are detected.

[0116] In some embodiments, the graph neural network inference unit comprises three key technical components: (1) Based on the feature learning stage of GNN, multi-hop neighbor information is aggregated through message passing mechanism to generate semantically aware node embedding representation; (2) The relational reasoning process adopts a reinforcement learning framework. By constructing a "state-action-reward" model (where the state is the current graph substructure, the action is the possible relation prediction, and the reward is determined by the feedback of the validity of historical tests), potential test association rules are automatically discovered. (3) In the knowledge completion stage, translation models (such as TransE) are used to predict missing relation edges, especially for new functional requirements, which can automatically deduce possible applicable test scenarios.

[0117] This unit establishes a two-way data channel with the adaptive optimization and feedback module. On the one hand, it receives test execution feedback to optimize the inference model, and on the other hand, it feeds back the inference results to the optimization module to guide strategy adjustments.

[0118] In some embodiments, the aforementioned units collaborate through a progressive pipeline of "data access - knowledge construction - intelligent reasoning": the knowledge extraction unit completes semantic alignment of multi-source data → the dynamic graph unit maintains a real-time updated storage structure → the reasoning unit mines deep-level correlation patterns. This architecture enables the system to maintain correlation accuracy even when facing the testing requirements of complex systems such as electric vehicle domain controllers.

[0119] In some embodiments, the intelligent knowledge graph construction module interacts decoupled from the test case recommendation engine through a distributed message queue (such as Kafka) to ensure stability under high concurrency scenarios. The designed "knowledge snapshot" mechanism periodically (every 15 minutes by default) merges the incremental knowledge graph into the base graph, while simultaneously generating version difference reports for traceability and auditing. This dynamic knowledge evolution capability effectively addresses the pain point of "incomplete test coverage due to lagging knowledge base updates" in the background technology, improving test case generation efficiency.

[0120] In some embodiments, the test case recommendation engine is responsible for transforming structured information in the knowledge graph into executable test plans. A multimodal recommendation strategy achieves a breakthrough improvement over traditional template-based generation methods.

[0121] In some embodiments, the context-aware unit is used to construct a multi-dimensional environmental feature model and collect three types of key context information in real time: (1) System environment context: Obtain the status of the test equipment (such as the remaining space of ECU flash memory, CAN bus load rate) and the configuration of the test bench through the resource monitoring interface; (2) Project schedule context: integrate time-dimensional features such as milestone data and defect convergence curves from the project management system; (3) Historical performance context: Extract quality indicators such as historical pass rate and average execution time of similar test cases from the adaptive optimization and feedback module.

[0122] During implementation, this unit employs a feature-wise attention algorithm to weightedly integrate contexts from different sources, generating a dynamic environment vector. This unit establishes a real-time data channel with the intelligent knowledge graph construction module, automatically triggering knowledge graph query optimization when constraints such as insufficient test resources are detected.

[0123] In some embodiments, the collaborative filtering recommendation unit is used to implement three-dimensional collaborative filtering of test cases: (1) Functional dimension: Calculate the functional similarity matrix based on the "requirement-test" association edges in the knowledge graph; (2) Contextual dimension: Construct a test applicability scoring model using the contextual vectors provided by the context-aware unit; (3) Team dimension: Analyze historical test execution records and establish a profile of the test engineer’s ability preferences.

[0124] In practice, this segment uses an improved SVD++ (SingularValueDecomposition) algorithm for dimensionality reduction, ensuring recommendation accuracy while keeping computational complexity at the O(nlogn) level. This unit forms a closed loop with the graph neural network inference unit of the knowledge graph construction module, automatically requesting supplementary inference support when the recommendation confidence falls below a threshold (default 0.7).

[0125] In some embodiments, the reinforcement learning optimization unit is used to construct a Markov decision process (MDP) model, wherein: The state space S consists of the current test requirement characteristics, environmental constraints, and knowledge graph substructures; the action space A corresponds to the set of recommended test cases. The reward function R comprehensively considers test coverage (calculated through the correlation of the knowledge graph), execution efficiency (estimated duration provided by the context unit), and quality risk (historical defect data).

[0126] During implementation, this unit employs the Dual Deep Q-Network (DDQN) algorithm for policy optimization, balancing novelty and reliability through an ε-greedy exploration mechanism. This unit is strongly coupled with the adaptive optimization and feedback module; the results of each round of testing serve as new training samples to update the policy network. After 200 iterations, the recommendation accuracy can be improved.

[0127] In some embodiments, the units can work collaboratively through a decision-making chain of "environmental awareness - candidate generation - strategy optimization": the context-aware unit constructs a dynamic environment profile → the collaborative filtering unit generates an initial recommendation set → the reinforcement learning unit completes the final ranking.

[0128] In some embodiments, the test case recommendation engine interacts with the knowledge graph construction module through a low-latency RPC interface, supporting sub-second response times for complex graph queries.

[0129] In some embodiments, the "recommendation tracing" function records the decision path of each output test case (including triggered graph nodes, referenced historical execution records, etc.), providing test engineers with transparent decision-making basis. This interpretable recommendation mechanism effectively solves the trust problem caused by traditional black-box systems, while providing a clear direction for subsequent optimization.

[0130] In some embodiments, the adaptive optimization and feedback module continuously learns from test execution data to iteratively improve system performance. It adopts a closed-loop architecture of "monitoring-analysis-optimization," including: a multi-dimensional data acquisition unit, a strategy optimization decision unit, and a strategy optimization decision-making unit.

[0131] In some embodiments, the multi-dimensional data acquisition unit is used to construct a data monitoring network throughout the entire test lifecycle, capturing three key indicators in real time through distributed probes: (1) Execution process data: including performance indicators such as test case runtime, memory usage, and communication latency, which are collected by embedding a lightweight agent into the test execution environment; (2) Quality verification data: Connect to the defect management system to obtain test case execution results (pass / fail), defect severity level, and problem classification tags; (3) Resource consumption data: monitoring and testing equipment utilization rate, energy consumption, frequency of manual intervention and other cost indicators. During implementation, time-series databases (such as InfluxDB) are used for efficient storage, and stream processing technology (Apache Flink) is used to achieve millisecond-level latency data preprocessing.

[0132] This unit establishes a two-way data channel with the test case recommendation engine, enabling it to receive execution feedback on recommendation results and proactively push anomaly monitoring alerts. Intelligent Analysis and Evaluation Unit: Integrates statistical analysis and time-series prediction technologies. (1) Establish a process monitoring model based on CUSUM (cumulative sum) control chart to detect abnormal fluctuations in test performance in real time; (2) The Prophet time series algorithm is used to predict the trend changes of key indicators such as test cycle and defect detection rate; (3) Use the SHAP (Shapley Additive Explanations) interpretability analysis framework to quantify the influence weight of each factor on the test results.

[0133] In practice, this unit generates an analysis report containing 120+ dimensions of features for each round of testing, transforming unstructured problem descriptions into standardized improvement directions through automated labeling technology. This unit is deeply integrated with the intelligent knowledge graph construction module, dynamically supplementing the knowledge graph with the correlation patterns discovered during analysis (such as "the correlation between a certain type of ECU firmware version and the test failure rate").

[0134] In some embodiments, the strategy optimization decision unit is used to achieve automatic tuning of system parameters using a mixed integer programming (MIP) framework: (1) Define an optimization function that includes three objectives: test coverage, execution efficiency, and resource cost; (2) Construct a parameter search space, covering 38 adjustable parameters such as recommendation algorithm weights, knowledge graph update frequency, and risk judgment threshold; (3) Implement multi-objective optimization based on NSGA-II (non-dominated sorting genetic algorithm) to find Pareto optimal solution while ensuring recommendation quality.

[0135] In terms of operation, this unit automatically starts an optimization cycle every 24 hours, verifying the effectiveness of new strategies through Shadow Mode before gradually deploying them online. It forms a two-layer optimization system with the reinforcement learning unit of the test case recommendation engine: short-term optimization is completed by the recommendation engine's DDQN algorithm, while long-term strategy adjustments are globally coordinated by this unit.

[0136] In some embodiments, each unit can achieve continuous evolution through a closed loop of "data-driven - root cause analysis - strategy iteration": the data acquisition unit builds a test digital twin → the analysis and evaluation unit locates improvement opportunities → the optimization decision unit generates tuning solutions.

[0137] In some embodiments, the adaptive optimization and feedback module provides services externally through a standardized REST API, supporting integration with third-party test management platforms. The "Optimization Traceability Dashboard" visually displays the basis and effects of each strategy adjustment, including: (1) Changes in key metrics that trigger optimization; (2) The version of the algorithm model used; (3) Comparison between expected and actual improvement.

[0138] This transparent optimization mechanism not only solves the trust problem of traditional "black box optimization" but also provides data support for improving the testing process. Simultaneously, the module's built-in A / B testing framework allows for manual intervention to verify specific optimization assumptions, ensuring that the system's evolution direction aligns with actual engineering needs.

[0139] In the above implementation, the adaptive optimization module in this method enables the system to continuously evolve through daily policy iteration, thereby forming a virtuous cycle of technological improvement. These technological effects are not isolated but are achieved through the organic cooperation of various modules. For example, the accurate input of the change perception module provides a reliable foundation for knowledge graph construction, while the improvement of the knowledge graph creates conditions for the efficient operation of the recommendation engine, ultimately forming a complete technological closed loop through feedback optimization.

[0140] In some embodiments, the complete application process of the system in battery management system (BMS) testing is demonstrated. When a "low-temperature fast charging protection" function is added to the BMS requirements document, the requirement change dynamic perception module is activated first. The natural language processing unit accurately extracts key parameters such as function ID, temperature threshold, and current limit from the document, while the version difference analysis unit confirms the implementation of the relevant charging control function by comparing code submission records. After integrating this information, the change impact assessment unit determines that the change is of high priority and generates a change description with complete traceability information.

[0141] The intelligent knowledge graph construction module then intervenes. The knowledge extraction and fusion unit discovers similar "high-temperature charging protection" test scenarios from historical data and establishes preliminary connections. The dynamic graph construction unit creates new functional nodes and establishes connections with hardware components such as temperature sensors. After further analysis, the graph neural network inference unit suggests adding three key test points: -21℃, -20℃, and -19℃, forming a complete test scenario framework.

[0142] The test case recommendation engine operates based on real-time environmental information. After the context-aware unit confirms the usable temperature range of the environment chamber, the collaborative filtering recommendation unit generates three types of candidate test cases—boundary testing, functional verification, and anomaly testing—based on the relationships in the knowledge graph. The reinforcement learning optimization unit evaluates the expected performance of each test case and prioritizes the recommendation of functional verification test cases for execution. The entire process from change identification to test case generation takes only 8 minutes, representing a significant efficiency improvement compared to traditional methods.

[0143] The adaptive optimization and feedback module continues to function after test execution. When boundary test cases fail to trigger protection mechanisms as expected, the intelligent analysis and evaluation unit accurately identifies threshold definition errors in the requirements document. The strategy optimization decision-making unit immediately adjusts the recommendation weights of similar test cases and feeds this experience back to the knowledge graph, enabling the system to self-improve. Throughout the process, the utilization rate of test equipment reached 89%, an improvement of nearly 30 percentage points compared to traditional methods.

[0144] Figure 3 A schematic diagram of a test case recommendation device is shown. It should be understood that this device is related to... Figure 1The method executed in the middle corresponds to the steps involved in the aforementioned method. The specific functions and effects of the device can be found in the description above. To avoid repetition, detailed descriptions are omitted here.

[0145] The recommended device for this test case includes: The acquisition unit 310 is used to acquire the changes when a change in functional requirements is detected. Building unit 320 is used to build a dynamic knowledge graph based on the changes; the dynamic knowledge graph stores the relationships between functional requirements, test scenarios and test cases; Acquisition unit 330 is used to collect test environment status data; Output unit 340 is used to output a set of test cases to be recommended based on test environment status data and dynamic knowledge graph.

[0146] In some embodiments, the test case recommendation apparatus further includes: The data acquisition unit 350 is used to collect feedback data throughout the entire process after the test case set is executed; the feedback data includes execution results, performance indicators, and resource consumption. Analysis unit 360 is used to analyze process anomalies and test performance of the feedback data throughout the process and obtain analysis results. Optimization unit 370 is used to optimize the test case recommendation strategy based on the analysis results.

[0147] In some embodiments, the acquisition unit 310 includes: The first acquisition subunit 311 is used to acquire the original requirements document; The preprocessing subunit 312 is used to perform structured preprocessing on the original requirements document to obtain preprocessed data; Extraction subunit 313 is used to extract key elements of requirement changes from preprocessed data to obtain the change content; the change content includes change type, scope of impact and related functional domains.

[0148] In some embodiments, the building unit 320 includes: The second acquisition subunit 321 is used to acquire the code change content corresponding to the change content; Generating subunit 322 is used to generate a differential report based on the changes and code changes; The annotation sub-unit 323 is used to annotate the potential risk level of changes based on the differential report, and obtain a set of confirmed changes with priority tags; The first fusion subunit 324 is used to perform multi-source data fusion processing based on the confirmed change set to obtain a unified knowledge identifier; Matching subunit 325 is used to match existing nodes of the unified knowledge identifier to obtain the existing node matching results and the newly added entity. Subunit 326 of the National Construction Project adopts a progressive indexing strategy and matches new entities with existing nodes to construct a dynamic knowledge graph.

[0149] In some embodiments, the second acquisition subunit 321 is specifically used to acquire code commit records from the version control system based on the change content; Obtain the target code based on the code commit history; By using an abstract syntax tree to perform code-level change analysis on the target code, the changes to the code can be obtained.

[0150] In some embodiments, the generation subunit 322 is specifically used to construct a mapping relationship between code changes and requirement changes; Calculate the change confidence level based on the mapping relationship; Generate a differentiated report that includes the confidence level of the change.

[0151] In some embodiments, the annotation subunit 323 is specifically used to analyze the difference report through the dependency graph to obtain the impact of change propagation; Based on pre-stored historical test data and the impact of change propagation, predict the potential risk level of the change; Based on the potential risk level of the change and the differentiated report, generate a set of confirmed changes with priority tags.

[0152] In some embodiments, the first fusion subunit 324 is specifically used to obtain a resource description triplet through a predefined ontology template and a confirmed change set; Obtain unstructured text and supplementary information; the unstructured text should include at least historical test reports and design documents, and the supplementary information should include at least device topology and interface specifications. Use a joint extraction model to extract the associations of functional component test items from unstructured text; A similarity-based clustering-based conflict resolution algorithm is used to perform multi-source data fusion processing on resource description triples, functional component test item associations, and supplementary information to obtain a unified knowledge identifier.

[0153] In some embodiments, the output unit 340 includes: The first fusion subunit 341 is used to fuse test environment state data to generate a dynamic environment vector; wherein, the test environment state data includes system environment context information, project progress context information and historical performance context information; Subunit 342 is constructed to build a test applicability scoring model based on dynamic knowledge graph and dynamic environment vector; The third acquisition subunit 343 is used to acquire an initial test case candidate set based on a preset test case recommendation strategy and test applicability scoring model; Output sub-unit 344 is used to perform multi-objective optimization and sorting on the initial test case candidate set and output the test case set to be recommended.

[0154] like Figure 4 As shown, this application provides an electronic device 400, which includes a processor 401 and a memory 402. The processor 401 and the memory 402 are interconnected and communicate with each other through a communication bus 403 and / or other forms of connection mechanism (not shown). The memory 402 stores a computer program that can be executed by the processor 401. When the computing device is running, the processor 401 executes the computer program to perform the method in any of the aforementioned optional implementations.

[0155] This application provides a computer-readable storage medium storing a computer program, which, when executed by a processor, performs the method in any of the aforementioned optional implementations.

[0156] The computer-readable storage medium can be implemented by any type of volatile or non-volatile storage device or a combination thereof, such as Static Random Access Memory (SRAM), Electrically Erasable Programmable Read-Only Memory (EEPROM), Erasable Programmable Read Only Memory (EPROM), Programmable Red-Only Memory (PROM), Read-Only Memory (ROM), magnetic storage, flash memory, magnetic disk, or optical disk.

[0157] This application provides a computer program product, which includes a computer program that, when run by a processor, executes the method in any of the aforementioned optional implementations.

[0158] Finally, it should be noted that the above embodiments are only used to illustrate the technical solutions of this application, and not to limit them. Although this application has been described in detail with reference to the foregoing embodiments, those skilled in the art should understand that modifications can still be made to the technical solutions described in the foregoing embodiments, or equivalent substitutions can be made to some or all of the technical features therein. These modifications or substitutions do not cause the essence of the corresponding technical solutions to deviate from the scope of the technical solutions of the embodiments of this application, and they should all be covered within the scope of the claims and specification of this application. In particular, as long as there is no conflict, the various technical features mentioned in the embodiments can be combined in any way. This application is not limited to the specific embodiments disclosed herein, but includes all technical solutions falling within the scope of the claims.

Claims

1. A test case recommendation method, characterized in that, include: When a change in functional requirements is detected, obtain the details of the change; A dynamic knowledge graph is constructed based on the changes; wherein the dynamic knowledge graph stores the relationships between functional requirements, test scenarios, and test cases; Collect test environment status data; Based on the test environment status data and the dynamic knowledge graph, output a set of test cases to be recommended.

2. The test case recommendation method according to claim 1, characterized in that, The method further includes: Collect full-process feedback data after the execution of the test case set; wherein, the full-process feedback data includes execution results, performance indicators and resource consumption; The entire process feedback data is analyzed for process anomalies and test performance to obtain the analysis results. The test case recommendation strategy is optimized based on the analysis results.

3. The test case recommendation method according to claim 1, characterized in that, The acquisition of changed information includes: Obtain the original requirements document; The original requirements document is subjected to structured preprocessing to obtain preprocessed data; The key elements of the requirement change are extracted from the preprocessed data to obtain the change content; wherein, the change content includes the change type, the scope of impact, and the related functional domains.

4. The test case recommendation method according to claim 1, characterized in that, The step of constructing a dynamic knowledge graph based on the changed content includes: Obtain the code change content corresponding to the aforementioned changes; A differential report is generated based on the changes and the code changes. The potential risk level of the changes is marked according to the differentiated report to obtain a set of confirmed changes with priority tags; Based on the confirmed change set, multi-source data fusion processing is performed to obtain a unified knowledge identifier; The unified knowledge identifier is matched against existing nodes to obtain the existing node matching results and the newly added entity. A dynamic knowledge graph is constructed by employing a progressive indexing strategy and matching the newly added entities with the existing nodes.

5. The test case recommendation method according to claim 4, characterized in that, The step of obtaining the code change content corresponding to the changed content includes: Retrieve code commit records from the version control system based on the changes described; Obtain the target code based on the code submission record; The target code is analyzed at the code level using an abstract syntax tree to obtain the code changes.

6. The test case recommendation method according to claim 4, characterized in that, The step of generating a differential report based on the changes and the code changes includes: Establish a mapping relationship between the code changes and the requirement changes; Calculate the change confidence level based on the mapping relationship; Generate a differentiated report that includes the confidence level of the changes.

7. The test case recommendation method according to claim 4, characterized in that, The process of marking potential risk levels based on the differentiated report yields a set of confirmed changes with priority tags, including: The impact of change propagation was obtained by analyzing the differential report using a dependency graph. Based on pre-stored historical test data and the impact of the change propagation, predict the potential risk level of the change; Based on the potential risk level of the change and the differentiation report, a set of confirmed changes with priority tags is generated.

8. The test case recommendation method according to claim 4, characterized in that, The process of performing multi-source data fusion based on the confirmed change set to obtain a unified knowledge identifier includes: The resource description triple is obtained by using the predefined ontology template and the confirmed change set; Obtain unstructured text and supplementary information; wherein the unstructured text includes at least historical test reports and design documents, and the supplementary information includes at least device topology and interface specifications; The joint extraction model is used to extract the functional component test item associations from the unstructured text; A similarity-based clustering-based conflict resolution algorithm is used to perform multi-source data fusion processing on the resource description triples, the functional component test item associations, and the supplementary information to obtain a unified knowledge identifier.

9. The test case recommendation method according to claim 1, characterized in that, The step of outputting a set of test cases to be recommended based on the test environment state data and the dynamic knowledge graph includes: The test environment status data is fused to generate a dynamic environment vector; wherein, the test environment status data includes system environment context information, project progress context information, and historical performance context information. Based on the dynamic knowledge graph and the dynamic environment vector, a test applicability scoring model is constructed; An initial test case candidate set is obtained based on the preset test case recommendation strategy and the test applicability scoring model; The initial test case candidate set is optimized and sorted using multiple objectives, and a test case set to be recommended is output.

10. A test case recommendation device, characterized in that, The test case recommendation device includes: The acquisition unit is used to acquire the changes when functional requirements are detected. A construction unit is used to construct a dynamic knowledge graph based on the changes; wherein the dynamic knowledge graph stores the relationships between functional requirements, test scenarios, and test cases; The data acquisition unit is used to collect test environment status data; The output unit is used to output a set of test cases to be recommended based on the test environment status data and the dynamic knowledge graph.

11. An electronic device, characterized in that, The electronic device includes a memory and a processor, the memory storing a computer program and the processor running the computer program to cause the electronic device to perform the test case recommendation method according to any one of claims 1 to 9.

12. A readable storage medium, characterized in that, The readable storage medium stores a computer program, which, when executed by a processor, performs the test case recommendation method according to any one of claims 1 to 9.

13. A computer program product, characterized in that, The computer program product includes a computer program that, when executed by a processor, performs the test case recommendation method according to any one of claims 1 to 9.

Citation Information

Cited By

  • Intelligent domain controller test case generation method and system based on knowledge graph

    CN121680359A

  • Intelligent test case generation method and system based on dynamic knowledge graph

    CN121935166A

  • A test case intelligent generation method and system based on a dynamic knowledge graph

    CN121935166B