Intelligent optimization verification method and system for AI test case

By using AI-powered intelligent optimization and verification methods for test cases, and leveraging natural language processing and knowledge graph technologies to identify and optimize black-box test cases, the problem of increasing test case numbers and unreasonable design has been solved, achieving efficient and intelligent test case management and improved coverage.

CN121979797APending Publication Date: 2026-05-05GUANGZHOU JISHANG NETWORK TECH CO LTD
View PDF 0 Cites 1 Cited by

Patent Information

Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
GUANGZHOU JISHANG NETWORK TECH CO LTD
Filing Date
2026-02-04
Publication Date
2026-05-05

AI Technical Summary

Technical Problem

Existing black-box testing suffers from problems such as an explosive increase in the number of test cases, low efficiency, wasteful repetitive testing, poorly designed test cases leading to decreased coverage and accuracy, and heavy workload for test engineers.

Method used

An AI-powered intelligent optimization and verification method for test cases is adopted. Test case sets are imported through a multi-format parser, transformed into structured data using natural language processing technology, and a test case knowledge graph is constructed. Redundant and invalid test paths are identified, supplementary test cases are generated, and strategies are dynamically adjusted using an integrated reinforcement learning model. Input parameter variation samples are generated and fuzz testing is performed. Human verification feedback is obtained to optimize model parameters.

Benefits of technology

Significantly improves black-box testing efficiency and coverage, reduces the burden on test engineers, enhances test quality and accuracy, and enables intelligent processing of test cases from import to boundary expansion.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN121979797A_ABST
    Figure CN121979797A_ABST
Patent Text Reader

Abstract

The invention discloses an AI test case intelligent optimization verification method and system, and the method specifically comprises the steps: employing a causal discovery algorithm to analyze an implicit dependency relationship for an entity association structure in a test case knowledge graph, recognizing redundant test cases and invalid test paths, and obtaining a causal dependency network; on the basis of a causal dependence network, traversing uncovered entity relationship paths in the test case knowledge graph, and generating supplementary test case suggestions; dynamically adjusting analysis strategy parameters according to historical optimization data through a self-adaptive engine to obtain an optimization test case set; and based on the optimized test case set, generating an input parameter variation sample by using a fuzzy test engine, and expanding a test boundary. According to the method, the black box test efficiency can be remarkably improved, the test coverage rate and accuracy are improved, meanwhile, the workload of a test engineer is relieved, the user experience is improved, and an efficient and intelligent solution is provided for the field of software test.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This invention relates to the field of artificial intelligence technology, and in particular to an intelligent optimization and verification method and system for AI test cases. Background Technology

[0002] In the field of software testing, black-box testing, as a commonly used testing method, is widely applied in various stages of software development due to its significant advantage of not requiring knowledge of the software's internal structure. It primarily ensures that the software's functionality meets expected specifications by testing its external behavior, playing a crucial role in guaranteeing software quality.

[0003] However, with the rapid development of the software industry, software is becoming increasingly large in scale and complex. This change brings many serious challenges to black-box testing, mainly in the following aspects: 1. Efficiency Issues: In the current testing environment, the number of black-box test cases is growing explosively. Faced with such a massive number of test cases, traditional manual screening and optimization methods not only consume a significant amount of time and manpower but are also highly susceptible to human error. For example, during manual screening, test engineers may overlook some critical test cases or mistakenly retain redundant test cases, which will undoubtedly severely impact the overall efficiency of the testing work.

[0004] 2. Effectiveness Issues: A large number of repetitive test cases fill the test case set. These duplicate cases not only fail to bring additional value to the testing work but also waste valuable testing resources. Furthermore, unreasonable test case design, such as improper test path selection and inaccurate assertion condition settings, directly leads to a decrease in test coverage and accuracy. For example, some critical business logic may not be fully covered due to unreasonable test case design, thus preventing the timely discovery of potential defects in the software and posing a threat to the stable operation of the software.

[0005] 3. User Experience Issues: Test engineers dedicate a significant amount of time and energy to the management and maintenance of test cases in their daily work. From writing, organizing, updating, to storing test cases, each step requires meticulous operation. This makes it difficult for them to focus their energy on the core work of testing itself, such as in-depth analysis of software functionality and exploration of potential defects. Over time, this not only affects the work enthusiasm and creativity of test engineers but also hinders the improvement of the overall quality of testing work.

[0006] While some test optimization methods exist to address the aforementioned issues, most have limitations. For example, some methods focus only on simple classification and management of test cases, lacking in-depth analysis and exploration of the logical relationships between test cases, and thus failing to effectively identify redundant test cases and invalid test paths. Furthermore, some methods lack a scientific and reasonable evaluation mechanism when generating supplementary test cases, resulting in inconsistent quality of generated test cases that are difficult to meet actual testing needs. Summary of the Invention

[0007] The purpose of this invention is to provide an AI test case intelligent optimization and verification method and system, which can significantly improve the efficiency of black-box testing, increase test coverage and accuracy, reduce the workload of test engineers, improve user experience, and provide an efficient and intelligent solution for the field of software testing to solve at least one of the above-mentioned problems in the prior art.

[0008] In a first aspect, the present invention provides an intelligent optimization and verification method for AI test cases, the method specifically comprising: Import test case sets through a multi-format parser, and transform the test case sets into structured data using natural language processing technology; Based on structured data, logical dependencies between test steps are established through entity relationship extraction, and a test case knowledge graph is constructed. For the entity association structure in the test case knowledge graph, a causal discovery algorithm is used to analyze implicit dependencies, identify redundant test cases and invalid test paths, and obtain a causal dependency network. Based on causal dependency networks, a graph reasoning mechanism is used to traverse the entity relationship paths not covered in the test case knowledge graph and generate supplementary test case suggestions. Based on causal dependency networks and supplementary test case suggestions, an adaptive engine integrating reinforcement learning models dynamically adjusts analysis strategy parameters according to historical optimization data to obtain an optimized test case set. Based on the optimized test case set, a fuzzy testing engine is used to generate input parameter variation samples to expand the test boundary. The optimization process data is transmitted to the verification interface, and the manual verification feedback results from the verification interface are obtained and fed back to the adaptive engine for model parameter optimization.

[0009] Secondly, this invention provides an AI test case intelligent optimization and verification system, the system specifically comprising: The data conversion module is used to import test case sets through a multi-format parser and convert the test case sets into structured data using natural language processing technology. The knowledge graph module is used to establish logical dependencies between test steps based on structured data and extract entity relationships, thereby constructing a test case knowledge graph. The causal analysis module is used to analyze implicit dependencies in the entity association structure of the test case knowledge graph using causal discovery algorithms, identify redundant test cases and invalid test paths, and obtain the causal dependency network. It is recommended to add a module to generate supplementary test case suggestions by traversing the entity relationship paths not covered in the test case knowledge graph based on the causal dependency network and using the graph reasoning mechanism. The test case optimization module is used to obtain an optimized test case set by dynamically adjusting the analysis strategy parameters based on historical optimization data, using an adaptive engine that integrates a reinforcement learning model and causal dependency network and supplementary test case suggestions. The boundary expansion module is used to expand the test boundary by generating input parameter mutation samples based on the optimized test case set using the fuzz testing engine. The verification feedback module is used to transmit the optimization process data to the verification interface, obtain the manual verification feedback results from the verification interface, and feed them back to the adaptive engine for model parameter optimization.

[0010] Thirdly, the present invention provides a computer device, including: a memory and a processor, and a computer program stored in the memory, wherein when the computer program is executed on the processor, it implements the AI ​​test case intelligent optimization and verification method as described in any of the above methods.

[0011] Fourthly, the present invention provides a computer-readable storage medium having a computer program stored thereon, wherein the computer program, when executed by a processor, implements the AI ​​test case intelligent optimization and verification method as described in any of the above methods.

[0012] Compared with the prior art, the present invention has at least one of the following technical effects: 1. This invention can significantly improve the efficiency of black-box testing, increase test coverage and accuracy, reduce the workload of test engineers, improve user experience, and provide an efficient and intelligent solution for the field of software testing.

[0013] 2. This invention realizes intelligent processing of the entire process of test case import to boundary expansion, which effectively improves the quality, coverage and testing efficiency of test cases and reduces the cost of manual intervention.

[0014] 3. This invention employs a dual mechanism of format detection and adapter scheduling, along with natural language processing technology, which can efficiently and accurately convert test cases of different formats into structured data, providing a unified and standardized data foundation for subsequent processing.

[0015] 4. This invention utilizes a multi-stage neural network model, graph construction engine, and logical dependency analysis engine to accurately identify key elements and relationships in the test steps, construct a complete and accurate test case knowledge graph, and clearly present the test logic structure.

[0016] 5. This invention comprehensively utilizes multiple causal discovery algorithms and correction and identification frameworks to gradually eliminate spurious causal relationships, accurately identify redundant test cases and invalid test paths, and obtain a reliable causal dependency network.

[0017] 6. This invention constructs a basic graph model based on test case knowledge graphs. Through a three-level conditional independence testing framework and a two-stage greedy search strategy, it can scientifically and rationally construct an initial causal graph and determine the direction of causal relationships.

[0018] 7. This invention evaluates the coverage of existing test cases based on coverage metrics, and uses a bidirectional breadth-first search algorithm and priority sorting to accurately identify uncovered entity relationship paths and generate specific and effective supplementary test case suggestions.

[0019] 8. This invention constructs a state space containing multiple states, defines a reasonable action space and reward function, and builds an adaptive engine that integrates reinforcement learning models. It can dynamically adjust parameters based on historical data to obtain a high-quality optimized test case set.

[0020] 9. This invention, through a multi-level parameter analysis framework, a mutation strategy library, and a priority model, can generate targeted mutation schemes based on the characteristics of input parameters, and obtain an effective parameter mutation sample set through a series of processing steps.

[0021] 10. Based on the results of fuzz testing, this invention establishes a boundary pattern knowledge base, generates derivative test cases, evaluates the boundary expansion effect, and generates expansion schemes through a series of steps, which can effectively expand the test boundary and improve the comprehensiveness of testing. Attached Figure Description

[0022] To more clearly illustrate the technical solutions in the embodiments of this application, the drawings used in the embodiments will be briefly introduced below. Obviously, the drawings described below are only some embodiments of this application. For those skilled in the art, other drawings can be obtained based on these drawings without creative effort.

[0023] Figure 1 This is a flowchart illustrating an AI test case intelligent optimization and verification method according to an embodiment of the present invention; Figure 2 This is a schematic diagram of the structure of an AI test case intelligent optimization and verification system provided in an embodiment of the present invention; Figure 3This is a schematic diagram of the structure of a computer device provided in an embodiment of the present invention. Detailed Implementation

[0024] In the following description, specific details such as particular system architectures and techniques are set forth for illustrative purposes and not for limitation, in order to provide a thorough understanding of the embodiments of this application. However, those skilled in the art will understand that this application may also be implemented in other embodiments without these specific details. In other instances, detailed descriptions of well-known systems, apparatuses, circuits, and methods have been omitted so as not to obscure the description of this application with unnecessary detail.

[0025] It should be understood that, when used in this application specification and the appended claims, the term "comprising" indicates the presence of the described features, integrals, steps, operations, elements and / or components, but does not exclude the presence or addition of one or more other features, integrals, steps, operations, elements, components and / or a collection thereof.

[0026] It should also be understood that the term "and / or" as used in this application specification and the appended claims refers to any combination of one or more of the associated listed items and all possible combinations, and includes such combinations.

[0027] As used in this application specification and the appended claims, the term "if" may be interpreted, depending on the context, as "when," "once," "in response to determination," or "in response to detection." Similarly, the phrase "if determined" or "if detected [the described condition or event]" may be interpreted, depending on the context, as meaning "once determined," "in response to determination," "once detected [the described condition or event]," or "in response to detection [the described condition or event]."

[0028] Furthermore, in the description of this application and the appended claims, the terms "first," "second," "third," etc., are used only to distinguish descriptions and should not be construed as indicating or implying relative importance.

[0029] References to "one embodiment" or "some embodiments" as used in this specification mean that one or more embodiments of this application include a specific feature, structure, or characteristic described in connection with that embodiment. Therefore, the phrases "in one embodiment," "in some embodiments," "in other embodiments," "in still other embodiments," etc., appearing in different parts of this specification do not necessarily refer to the same embodiment, but rather mean "one or more, but not all, embodiments," unless otherwise specifically emphasized. The terms "comprising," "including," "having," and variations thereof mean "including but not limited to," unless otherwise specifically emphasized.

[0030] In this application embodiment, the entity executing the process includes a terminal device. This terminal device includes, but is not limited to, devices capable of executing the methods disclosed in this application, such as servers, computers, smartphones, and tablets. Figure 1 A flowchart illustrating an AI test case intelligent optimization and verification method according to an embodiment of the present invention is shown below: S101 imports the test case set through a multi-format parser and uses natural language processing technology to transform the test case set into structured data; S102, based on structured data, establishes logical dependencies between test steps through entity relationship extraction, and constructs a test case knowledge graph; S103, targeting the entity association structure in the test case knowledge graph, uses a causal discovery algorithm to analyze implicit dependencies, identify redundant test cases and invalid test paths, and obtain a causal dependency network; S104, based on causal dependency network, uses graph reasoning mechanism to traverse the entity relationship paths not covered in the test case knowledge graph and generate supplementary test case suggestions; S105, based on causal dependency networks and supplementary test case suggestions, uses an adaptive engine that integrates reinforcement learning models to dynamically adjust analysis strategy parameters according to historical optimization data to obtain an optimized test case set; S106, based on the optimized test case set, uses a fuzzy testing engine to generate input parameter variation samples to expand the test boundary; S107: The optimization process data is transmitted to the verification interface, the manual verification feedback results of the verification interface are obtained, and the data is fed back to the adaptive engine for model parameter optimization.

[0031] In this embodiment, a multi-format parser is developed, capable of parsing various common test case formats (such as Excel, XML, JSON, etc.). When importing a test case set, the parser can automatically identify the file format and extract test cases of different formats according to preset rules. For example, for Excel format test cases, the parser will read the test case information in each worksheet, including fields such as test case number, test steps, and expected results; for XML format test cases, the parser will extract the corresponding test case content based on the XML tag structure.

[0032] Natural Language Processing (NLP) techniques are used to process the extracted test case set. NLP performs operations such as word segmentation, part-of-speech tagging, and named entity recognition on the text information in the test cases, transforming unstructured text information into structured data. For example, the description of the test steps "Click the login button, enter username and password" is broken down into words such as "click," "login button," "enter," "username," and "password," and identified "login button," "username," and "password" as key entities. Simultaneously, the action relationships between them are determined, such as "clicking" the "login button," and "entering" the "username" and "password." Through this processing, the entire test case set is transformed into a structured data set, providing a data foundation for subsequent knowledge graph construction.

[0033] Based on structured data, logical dependencies between test steps are established using entity relationship extraction techniques. Entity relationship extraction analyzes the relationships between entities in the structured data. For example, in a test case, the output of a previous test step may be the input of a subsequent test step, or the execution of a test step depends on the successful completion of other test steps. By identifying these logical dependencies, the steps in the test case and the relationships between them are represented in the form of a graph, constructing a test case knowledge graph. In the knowledge graph, nodes represent key entities in test steps or test cases, and edges represent the logical dependencies between them.

[0034] For the entity association structure in the test case knowledge graph, a causal discovery algorithm is used to deeply analyze the implicit causal dependencies. This algorithm infers which node dependencies are causal by analyzing the association patterns and statistical characteristics between nodes in the knowledge graph. For example, if in a test scenario, executing test step A always executes test step B, and test step B will not execute if test step A is not executed, then the causal discovery algorithm might infer that test step A is a causal predecessor of test step B.

[0035] By analyzing the causal discovery algorithm, redundant test cases and invalid test paths in the test case knowledge graph are identified. Redundant test cases are those that have highly repetitive logical relationships with other test cases in the knowledge graph, and their execution results contribute little to the overall test objective. Invalid test paths are those that do not have actual causal dependencies in the knowledge graph, or that cannot be executed normally due to certain unmet conditions. For example, if a test step in a test path depends on a non-existent entity or a condition that can never be met, then this test path is invalid.

[0036] The identified causal dependencies are represented as a network, constructing a causal dependency network. In the causal dependency network, nodes represent test steps or key entities, and edges represent the causal dependencies between them. The causal dependency network clearly shows the causal logic between the steps in a test case, providing a basis for subsequent test case optimization.

[0037] Based on causal dependency networks, a graph reasoning mechanism is used to traverse uncovered entity relationship paths in the test case knowledge graph. The graph reasoning mechanism infers possible entity relationship paths that are not currently covered in the test case set based on the causal relationships in the causal dependency network. For example, if the causal dependency network shows that a branch path of a critical business logic is not covered by test cases, the graph reasoning mechanism will identify this uncovered path.

[0038] For identified uncovered entity relationship paths, supplementary test case suggestions are generated. These suggestions design corresponding test steps and expected results based on the characteristics of the uncovered path and business requirements. For example, if an uncovered path involves a new user operation scenario, the supplementary test case suggestions will describe in detail the operation steps to be performed in that scenario and the expected system response. These supplementary test case suggestions can provide a reference for test engineers, helping them improve their test case sets and increase test coverage.

[0039] An adaptive engine integrating a reinforcement learning model is constructed, which takes a causal dependency network and supplementary test case suggestions as input. The reinforcement learning model in the adaptive engine learns and trains based on historical optimization data (such as the effect of previous test case optimizations, test results under different parameter settings, etc.), learning how to adjust the analysis strategy parameters to achieve better optimization results under different conditions.

[0040] When processing the current causal dependency network and supplementary test case suggestions, the adaptive engine dynamically adjusts the analysis strategy parameters based on the learning results of the reinforcement learning model. For example, if historical data shows that using certain parameter settings can more effectively identify redundant test cases and invalid test paths in a certain type of test scenario, the adaptive engine will prioritize using these parameter settings in the current scenario. By dynamically adjusting the analysis strategy parameters, the adaptive engine can perform more accurate analysis and processing of the causal dependency network and supplementary test case suggestions, thereby obtaining an optimized test case set. The optimized test case set removes redundant test cases, optimizes invalid test paths, and incorporates effective content from the supplementary test case suggestions, improving the quality and efficiency of the test case set.

[0041] The optimized test case set is then input into the fuzzing engine. The fuzzing engine analyzes the test cases in the optimized test case set and identifies the input parameters. For example, for a login function test case, the input parameters might include username, password, etc.

[0042] The fuzzing engine mutates the input parameters according to preset rules and algorithms, generating a large number of mutated input parameter samples. Mutation rules can include randomly changing parameter values, increasing or decreasing parameter length, changing parameter types, etc. For example, for username parameters, the fuzzing engine may generate mutated samples such as usernames that exceed the normal length range or usernames containing special characters.

[0043] The generated input parameter mutation samples are used to test the software, expanding the testing boundaries. By inputting these mutation samples, various abnormal situations and boundary conditions can be simulated to test the software's performance under these conditions, discover potential defects and security vulnerabilities in the software, and improve the software's robustness and reliability.

[0044] The optimization process data from the above steps (such as data from the test case structuring transformation process, data from the causal dependency network construction process, and data from the optimized test case set generation process) are transmitted to the verification interface. The verification interface displays this optimization process data in an intuitive way, such as showing the comparison of test cases before and after optimization and the structure of the causal dependency network in the form of charts and reports, making it convenient for test engineers to view and analyze.

[0045] Test engineers manually validate the optimization process data on the verification interface and provide feedback based on their experience and business needs. Feedback can include evaluations of the optimization effectiveness, suggestions for handling certain test cases, and corrections to causal dependencies. For example, test engineers might find that some supplementary test case suggestions do not conform to the actual business logic, or that some causal dependency judgments are incorrect; they will mark these on the verification interface and provide corresponding modification suggestions.

[0046] The feedback from test engineers' manual verification is fed back to the adaptive engine of the integrated reinforcement learning model in Example 4. The adaptive engine further optimizes and adjusts the parameters of the reinforcement learning model based on this feedback. For example, if feedback indicates that a certain parameter setting leads to poor optimization results, the adaptive engine will adjust that parameter setting to improve the accuracy and effectiveness of subsequent optimization processes. Through this closed-loop optimization system, test case optimization methods are continuously improved, enhancing the quality and efficiency of software testing.

[0047] In some embodiments, step S101 above, which involves importing the test case set through a multi-format parser and converting the test case set into structured data using natural language processing technology, specifically includes: The test case set is imported through a multi-format parser. A dual mechanism of format detection and adapter scheduling is used to identify test case files of different formats and convert each format file into an intermediate representation. For the natural language description in the intermediate representation, a Transformer-based encoder and a semantic role labeling model are used to jointly extract the test logic elements. Based on the test logic elements and according to the pre-set conversion rule base, the semantic description, parameter entities, and assertion conditions in the natural language description are converted into operation sequences, typed parameters, and verification expressions, respectively, to obtain structured data.

[0048] In this embodiment, a multi-format parser is developed and used to import the test case set. This multi-format parser has powerful format recognition capabilities and employs a dual mechanism of format detection and adapter scheduling. When importing test case files, the format detection mechanism quickly makes a preliminary judgment on the file's format. By analyzing features such as the file's header information and specific identifiers, it quickly determines the approximate format category of the file, such as whether it is an Excel, XML, or JSON format.

[0049] Once the general format of the file is determined, the adapter scheduling mechanism comes into play. Based on the detected format, it precisely schedules a matching adapter from a pre-prepared adapter library. Each adapter is specifically designed for a particular format and has the ability to convert that format file into a unified intermediate representation. For example, for an Excel-formatted test case file, the corresponding adapter reads each worksheet in the file, extracts the test case information from each cell, and reorganizes it according to certain rules; for an XML-formatted file, the adapter parses the test case content based on the XML tag structure. In this way, regardless of the original format of the test case file, it can be uniformly converted into an intermediate representation, providing a unified data foundation for subsequent processing.

[0050] After obtaining the intermediate representation, the test logic elements are extracted from the natural language description portion using a combination of a Transformer-based encoder and a semantic role labeling model. The Transformer-based encoder possesses powerful text feature extraction capabilities, enabling deep analysis of natural language descriptions and capturing semantic information and contextual relationships. Through a multi-layered self-attention mechanism, the encoder transforms the input natural language text into high-dimensional semantic vector representations, which contain rich semantic features of the text.

[0051] The semantic role labeling model further analyzes the semantic vectors output by the encoder to identify the semantic role relationships between various components in the sentence. For example, in a test step description "Click the login button, enter the username and password," the semantic role labeling model can identify the semantic role information such as the executor and object of the "click" action (login button), and the executor and object of the "enter" action (username and password). Through this joint extraction method, test logic elements, such as test actions, test objects, and input parameters, can be accurately extracted from natural language descriptions, providing key information for subsequent structured transformation.

[0052] After extracting the test logic elements, the semantic descriptions, parameter entities, and assertion conditions in the natural language description are converted into operation sequences, typed parameters, and validation expressions, respectively, according to a pre-set transformation rule library, thus obtaining structured data. The transformation rule library is a summary of extensive practical experience and expert insights, containing transformation rules for various common test logic elements.

[0053] For semantic descriptions, the transformation rule base converts them into corresponding operation sequences based on different test actions and scenarios. For example, "click the login button" is converted into the operation sequence "click(login_button)", explicitly indicating the operation to be performed and the object of the operation. For parameter entities, the transformation rule base converts them into typed parameters based on the parameter type and characteristics. For example, "username" and "password" are converted into parameters with specific data types, such as the strings "username" and "password". For assertion conditions, the transformation rule base converts them into validation expressions used to verify whether the software output meets expectations during testing. For example, "display welcome page after successful login" is converted into a validation expression like "assert(welcome_page_displayed==True)". In this way, natural language descriptions are accurately converted into structured data, enabling test cases to be better understood and processed by computers, facilitating subsequent test case optimization and execution.

[0054] In some embodiments, step S102 above, which involves establishing logical dependencies between test steps based on structured data through entity relationship extraction and constructing a test case knowledge graph, specifically includes: Based on structured data, a multi-stage neural network model is used to extract key elements and their relationships in the test steps. Based on key elements and their relationships, an incremental construction strategy is used to build test suites, test cases, and test steps in layers through a graph construction engine, forming an attribute graph structure. For the constructed attribute graph structure, the dependency path, dependency strength and implicit dependency between test steps are deeply analyzed by the logical dependency analysis engine to obtain the dependency relationship network; Based on dependency networks, a knowledge fusion mechanism is used to verify and complete entity relationships by combining structural evidence, semantic evidence, and statistical evidence, thereby obtaining a test case knowledge graph.

[0055] In this embodiment, after acquiring structured data, a multi-stage neural network model extraction process is used to identify key elements and their relationships in the testing steps. The multi-stage neural network model is a carefully designed and trained deep learning model with powerful feature extraction and relationship analysis capabilities. This model consists of multiple stages, each with its specific tasks and functions.

[0056] In the first stage, the model primarily performs preliminary semantic understanding of the structured data, identifying basic entities in the test steps, such as test actions (clicks, input, etc.), test objects (buttons, text boxes, etc.), and related parameters (usernames, passwords, etc.). Through this stage of processing, the model can quickly locate key information points in the test steps.

[0057] The second stage involves the model further analyzing the relationships between these basic entities. Leveraging the powerful computational capabilities of neural networks, combined with contextual information and semantic features, it determines whether logical connections exist between different entities. For example, it identifies which test object a particular test action is performed on, and what the relationship is between the input parameters and the test object. Through this multi-stage analysis and extraction, the model can accurately identify the key elements and their relationships within the testing steps, providing a solid foundation for subsequent knowledge graph construction.

[0058] Based on the extracted key elements and their relationships, a graph building engine is used to build test suites, test cases, and test steps in a layered manner using an incremental building strategy, forming an attribute graph structure. The graph building engine is a tool specifically designed for building graph structures; it can automatically generate corresponding graph structures based on input data and rules.

[0059] Incremental build strategy is an efficient approach that builds the entire graph structure gradually and layer by layer, rather than all at once. First, based on the set of test cases, each test case is treated as a node, building the test suite layer. The test suite layer is the top layer of the graph, containing multiple related test cases used to test a set of functions or modules. Then, for each test case, the test steps are further broken down, and each test step is treated as a node, building the test case layer. The test case layer is an intermediate layer that details the specific execution steps of each test case. Finally, the previously extracted key elements and their relationships are added as attributes to the test step nodes, forming an attribute graph structure. For example, on the test step node "Click the login button," attributes such as "Test Action: Click" and "Test Object: Login Button" are added. This layered and incremental build approach clearly demonstrates the hierarchical relationships between test suites, test cases, and test steps, as well as the detailed information within each step.

[0060] For the constructed attribute graph structure, a logical dependency analysis engine is used to deeply analyze the dependency paths, dependency strengths, and implicit dependencies between test steps, obtaining a dependency network. The logical dependency analysis engine is a tool specifically designed for analyzing logical relationships in graph structures, enabling comprehensive and in-depth analysis of attribute graph structures.

[0061] In resolving dependency paths, the engine identifies the sequence and relationships between test steps from the graph structure. For example, in a login function test, there might be a dependency path like "enter username -> enter password -> click login button". The engine can accurately identify and record these paths.

[0062] Regarding dependency strength, the engine evaluates it based on the importance and correlation between test steps. For example, if the failure of a test step causes several subsequent steps to fail, then the dependency strength between that step and other steps is high. The engine quantifies the dependency strength by analyzing the attributes of nodes and edges in the graph structure, combined with preset rules.

[0063] Furthermore, the engine also uncovers implicit dependencies between test steps. Some dependencies may not be obvious, but by deeply analyzing the semantic information and contextual relationships within the graph structure, the engine can discover these implicit dependencies. For example, in some cases, entering a specific username may affect the subsequent password verification method; the engine can accurately identify this implicit dependency. Through these analyses, the engine ultimately obtains a complete dependency network, clearly demonstrating the various dependencies between test steps.

[0064] Based on dependency networks, a knowledge fusion mechanism is used to verify and complete entity relationships by combining structural, semantic, and statistical evidence, thereby obtaining a test case knowledge graph. The knowledge fusion mechanism is a process of integrating and optimizing knowledge through multiple sources of evidence, which improves the accuracy and completeness of the knowledge graph.

[0065] Structural evidence primarily comes from the previously constructed attribute graph structure and dependency network, which provides basic connectivity and hierarchical information between entities. By analyzing this structural information, the rationality and consistency of entity relationships can be verified.

[0066] Semantic evidence, based on natural language processing techniques, performs semantic analysis on the text descriptions in the test steps. For example, by calculating semantic similarity, it determines the degree of semantic association between different test steps, thereby further verifying and completing entity relationships. If the descriptions of two test steps have high semantic similarity, then there may be a closer relationship between them.

[0067] Statistical evidence is obtained through statistical analysis of large amounts of test data and historical records. For example, by statistically analyzing the execution frequency and success rate of a certain test step in different test scenarios, the importance of this step and its correlation with other steps can be assessed, thereby optimizing and completing entity relationships.

[0068] The knowledge fusion mechanism comprehensively analyzes and processes these three types of evidence, determining the final entity relationships through weighted averaging, voting, and other methods. After knowledge fusion, the resulting test case knowledge graph is more accurate and complete, clearly displaying the logical dependencies and key element information between test steps, providing strong support for subsequent test case optimization and execution.

[0069] In some embodiments, step S103 above, which involves analyzing implicit dependencies using a causal discovery algorithm to identify redundant test cases and invalid test paths based on the entity association structure in the test case knowledge graph, and obtaining a causal dependency network, specifically includes: For the entity association structure in the test case knowledge graph, a score learning method based on Peter-Clark algorithm constraint learning method and greedy equivalence search algorithm is adopted. An initial causal graph is constructed through conditional independence test and greedy equivalence search. Based on the initial causal graph, a first causal dependency network is obtained by eliminating spurious causal relationships through a correction framework that includes temporal obfuscation correction, selection obfuscation correction, and promiscuous obfuscation correction. For the first causal dependency network, the redundancy relationship between test cases is analyzed through a redundancy identification framework that includes structural redundancy identification, functional redundancy identification, and statistical redundancy identification to obtain the second causal dependency network. For the second causal dependency network, invalid test paths are identified through a multi-level invalid path detection framework that includes logical invalidity detection, effect invalidity detection, and practical invalidity detection, thereby obtaining the target causal dependency network.

[0070] In this embodiment, for the entity association structure in the test case knowledge graph, an initial causal graph is constructed using both a Peter-Clark algorithm-based constraint learning method and a score learning method based on a greedy equivalence search algorithm. The Peter-Clark algorithm-based constraint learning method can uncover potential causal constraints based on the association information between entities in the knowledge graph. These constraints limit the possible causal paths between entities, providing a basic framework for the subsequent construction of the causal graph.

[0071] The score learning method based on the greedy equivalence search algorithm evaluates and scores different causal structures. It considers various factors related to entity associations in the knowledge graph, such as the strength of the association and the frequency of occurrence, and finds the structure with the highest score as the potential causal relationship by continuously searching and comparing different causal structures.

[0072] During the construction process, conditional independence testing is also performed. Conditional independence testing determines whether two entities are independent of each other under certain conditions. If two entities are independent under given conditions, there may be no direct causal relationship between them; otherwise, a causal relationship may exist. Simultaneously, combined with greedy equivalence search, the causal structure is continuously adjusted and optimized, ultimately constructing an initial causal graph. This initial causal graph is a preliminary graph structure that may contain some inaccurate causal relationships, providing a foundation for subsequent optimization and correction.

[0073] Based on the constructed initial cause-effect graph, a correction framework including time obfuscation correction, selection obfuscation correction, and promiscuous obfuscation correction is used to eliminate spurious causal relationships. Time obfuscation correction primarily targets erroneous causal judgments caused by time factors. During the execution of test cases, the order of events can affect our understanding of causal relationships. For example, one test step may execute first, and another later, but this does not necessarily mean that the former is the cause of the latter. Through time obfuscation correction, the impact of time factors on causal relationships is analyzed, eliminating cases where a causal relationship is mistakenly assumed simply because of the order of events.

[0074] Selection confusion correction focuses on biases that may be introduced during test case selection. When constructing a test case knowledge graph, test case selection may not be entirely random but influenced by certain factors. These factors may lead us to mistakenly assume causal relationships between certain entities. Selection confusion correction identifies and eliminates these spurious causal relationships caused by selection bias by analyzing the test case selection mechanism.

[0075] Confounding correction addresses third-party factors that simultaneously affect two entities. In knowledge graphs, there may be unobserved factors that influence both entities, leading us to mistakenly believe a direct causal relationship exists. Confounding correction identifies and adjusts these confounding factors to eliminate such spurious causal relationships. After processing with these three correction methods, a first causal dependency network is obtained. Compared to the initial causal graph, this network more accurately reflects the true causal relationships between entities, removing most of the spurious causal relationships.

[0076] For the first causal dependency network, a redundancy identification framework, including structural redundancy identification, functional redundancy identification, and statistical redundancy identification, is used to analyze the redundancy relationships between test cases. Structural redundancy identification mainly starts from the structural perspective of the causal dependency network, looking for causal paths that are structurally repetitive or similar. For example, in a knowledge graph, there may be two or more causal paths that involve essentially the same entities and causal relationships, only differing slightly in their representation; these paths may exhibit structural redundancy.

[0077] Functional redundancy identification focuses on the functionality achieved by causal paths. If different causal paths can achieve the same or similar test functions, then these paths may contain functional redundancy. For example, in some test scenarios, there may be multiple ways to verify the correctness of a functional module, and the causal paths corresponding to these different verification methods may contain functional redundancy.

[0078] Statistical redundancy identification determines the presence of redundancy by analyzing the frequency and statistical characteristics of causal paths in test data. If certain causal paths appear very frequently in a large amount of test data and their statistical characteristics are similar, then these paths may exhibit statistical redundancy. By comprehensively applying these three redundancy identification methods, redundant test cases in the first causal dependency network are identified, and the network is adjusted to obtain the second causal dependency network. This network removes redundant causal relationships, making it more concise and efficient.

[0079] For the second causal dependency network, a multi-level invalid path detection framework, including logical invalidity detection, effect invalidity detection, and practice invalidity detection, is used to identify invalid test paths. Logical invalidity detection mainly checks whether the causal path is logically reasonable. For example, some causal paths may contain logical contradictions, such as the execution result of one test step not being able to cause another test step to be executed in the way described by the path; such paths are logically invalid.

[0080] Ineffectiveness testing focuses on whether a causal path can achieve the expected test results. During testing, we expect each causal path to effectively verify a specific function or feature of the software. If a causal path fails to achieve the expected test results—for example, failing to discover potential defects in the software or verify the correctness of a function—then that path is considered ineffective.

[0081] Practical invalidity detection combines the actual testing environment and test data to determine whether causal paths are valid in real-world applications. Some causal paths may seem theoretically reasonable, but in actual testing, due to various factors such as limitations of the testing environment and the specificity of the test data, they may fail to execute properly or yield valid test results. Such paths exhibit practical invalidity. By comprehensively judging through these three detection methods, invalid test paths in the second causal dependency network are identified, and the network is further optimized to ultimately obtain the target causal dependency network. This network accurately reflects the true causal relationships between test cases, removing redundant and invalid parts, and providing a reliable foundation for subsequent test case optimization and testing work.

[0082] Furthermore, regarding the entity association structure in the test case knowledge graph, a score learning method based on the Peter-Clark algorithm's constraint learning method and the greedy equivalence search algorithm is employed. An initial causal graph is constructed through conditional independence testing and greedy equivalence search, specifically including: Based on the entity association structure in the test case knowledge graph, each test step entity is taken as a causal node, and the relationship edges between entities are taken as initial causal edge candidates to form a basic graph model. A three-layer conditional independence testing framework is constructed using a Peter-Clark algorithm-based constrained learning method. The first layer of the framework is used to initially screen direct causal relationships using a partial correlation-based local independence test; the second layer is used to identify indirect causal relationships using a conditional mutual information-based global independence test; and the third layer is used to comprehensively determine the causal direction using a Bayesian network-based causal structure learning algorithm. By using a conditional independence testing framework, irrelevant edges are gradually removed from the basic graph model and the direction of the edges is determined to obtain a preliminary causal structure. Based on the initial causal structure, a multi-dimensional scoring function system is designed, and a two-stage greedy search strategy is implemented to find the optimal causal structure in the Markov equivalence class space and obtain the initial causal graph.

[0083] In this embodiment, a basic graph model is constructed based on the entity association structure in the test case knowledge graph. In the test case knowledge graph, each test step entity carries specific test operations and functional information, and these test step entities are used as causal nodes. These causal nodes represent independent units in each stage of the testing process. Simultaneously, various relational edges exist between entities, reflecting the logical connections such as the sequence and dependencies between test steps. Using these relational edges as initial causal edge candidates, and combining the causal nodes and initial causal edge candidates, a basic graph model is formed. This basic graph model is the starting point for subsequently constructing the initial causal graph; it initially outlines the possible causal relationships between test steps, but these relationships are still relatively vague and require further analysis and determination.

[0084] A three-level conditional independence testing framework is constructed using a Peter-Clark algorithm-based constraint learning method. This framework aims to more accurately determine the causal relationships between entities in the test steps, progressively filtering out truly valid causal connections through multi-level testing.

[0085] The first layer employs a partial correlation-based local independence test. Partial correlation analysis eliminates interference from other variables, focusing on the direct relationship between two variables. In this layer, the partial correlation coefficient is calculated to preliminarily screen causal nodes in the basic graphical model, identifying node pairs that may have a direct causal relationship. If the partial correlation coefficient between two nodes is significantly non-zero, then a direct causal relationship may exist between them; otherwise, a direct causal relationship may not exist.

[0086] The second layer applies a global independence test based on conditional mutual information. Conditional mutual information measures the degree of information sharing between two variables given certain other variables. By calculating conditional mutual information, indirect causal relationships can be identified. Even if there is no direct connection between two nodes, they may still have indirect influences through other nodes. This layer of testing can uncover indirect causal relationships hidden within complex relationships from a global perspective.

[0087] The third layer employs a Bayesian network-based causal structure learning algorithm to comprehensively determine the causal direction. A Bayesian network is a probabilistic graphical model that uses probabilistic reasoning to determine the causal direction between variables. In this layer, the test results from the first two layers are combined, and the Bayesian network algorithm is used to comprehensively judge the direction of the causal relationship. By calculating the probability of different causal directions, the direction with the highest probability is selected as the final causal direction, thereby more accurately determining the causal relationship between entities in the test steps.

[0088] The basic graph model is analyzed and processed step by step using a pre-constructed conditional independence testing framework. During the analysis, irrelevant edges are progressively removed based on the results of the conditional independence test. If two causal nodes are determined to be independent in the conditional independence test, their initial causal edge candidates can be deleted because there is no direct or indirect causal relationship between them. Simultaneously, the direction of the remaining edges is determined based on the causal direction identified in the third layer. Through this series of filtering and direction determination operations, the initially ambiguous basic graph model gradually becomes clearer, yielding a preliminary causal structure. This preliminary causal structure can already reflect some of the true causal relationships between the test steps, but there may still be some inaccuracies or imperfections that require further optimization.

[0089] Based on the initial causal structure, a multi-dimensional scoring function system is designed. This scoring function system evaluates the causal structure from multiple aspects, such as the rationality of the causal relationship, the comprehensiveness of test coverage, and the degree of conformity with actual business logic. Each dimension has corresponding scoring criteria and methods. By comprehensively calculating the scores of each dimension, a comprehensive score is assigned to each possible causal structure in the initial causal structure.

[0090] Then, a two-stage greedy search strategy is implemented to find the optimal causal structure in the Markov equivalence class space. The first stage performs a coarse-grained search, quickly filtering out some potential better causal structures within a large range. The second stage performs a fine-grained search, further analyzing and comparing the results from the first stage to find the optimal causal structure. This two-stage greedy search strategy improves search accuracy while maintaining efficiency. Finally, the causal structure with the highest score is found in the Markov equivalence class space and used as the initial causal graph. This initial causal graph accurately reflects the causal relationships between test step entities in the test case knowledge graph, providing an important foundation for subsequent test case optimization and verification.

[0091] In some embodiments, step S104 above, which involves using a graph reasoning mechanism to traverse uncovered entity relationship paths in the test case knowledge graph based on a causal dependency network to generate supplementary test case suggestions, specifically includes: Based on the test logic structure in the causal dependency network, the coverage status of existing test cases is evaluated through a path coverage analysis model according to coverage metrics to obtain coverage analysis results. The coverage metrics include node coverage, edge coverage, and path coverage. Based on the coverage analysis results, a bidirectional breadth-first search algorithm is used to simultaneously search for paths from the key cause nodes and key verification nodes of the test case knowledge graph, and an invalid path is filtered out by applying a path feasibility assessment model to obtain the entity relationship paths that are not covered in the test case knowledge graph. Based on the uncovered entity relationship paths, priority is ranked according to the dimensions of causal importance, business importance, risk importance, and innovation importance, and a comprehensive importance score is generated for each path; The uncovered entity relationship paths are sorted based on a comprehensive importance score, and specific test case suggestions are generated through a graph reasoning mechanism.

[0092] In this embodiment, the causal dependency network clearly presents the logical dependencies between test steps, providing a foundation for accurately assessing coverage. Coverage metrics are used for evaluation, encompassing node coverage, edge coverage, and path coverage. Node coverage measures the extent to which test cases cover each node in the test case knowledge graph, i.e., how many nodes are involved by the test cases. Edge coverage focuses on the coverage of edges in the graph by the test cases, reflecting the degree of coverage of connections between steps in the test path. Path coverage emphasizes the coverage of the complete test path by the test cases, reflecting the comprehensive testing of the software functional flow. Through the path coverage analysis model, combined with these coverage metrics, a comprehensive analysis of existing test cases is conducted to obtain coverage analysis results. These results clearly show which aspects the current test cases cover sufficiently and which aspects are insufficient, providing a basis for subsequently identifying uncovered entity relationship paths.

[0093] Based on the coverage analysis results, a bidirectional breadth-first search algorithm is used for path searching. This algorithm searches simultaneously from both the critical cause nodes and critical verification nodes in the test case knowledge graph. Critical cause nodes are typically the starting points that trigger software function changes or produce specific results, while critical verification nodes are key steps used to verify whether the software function meets expectations. Searching from both critical nodes simultaneously improves search efficiency and helps identify potential uncovered paths more quickly. During the search process, a path feasibility assessment model is applied to filter the searched paths. This model considers various factors, such as test environment limitations and actual software operating conditions, to determine path feasibility. By filtering invalid paths, the algorithm ultimately obtains uncovered entity relationship paths in the test case knowledge graph. These paths represent software functions and logical relationships not yet covered by the current test cases and are the focus of subsequent supplementary test case generation.

[0094] Based on uncovered entity relationship paths, priority is assigned across multiple dimensions to determine which paths require priority for generating supplementary test cases. These dimensions include causal importance, business importance, risk importance, and innovation importance. Causal importance focuses on the criticality of a path within the causal dependency network. If a path plays a crucial role in causal relationship propagation, it may significantly impact the correct operation of the software and should be given higher priority. Business importance assesses the position and value of the business functions involved in the path within the overall business context; paths corresponding to important business functions require priority testing. Risk importance considers the potential risks of a path; if a path contains potentially high-risk defects, such as those leading to software crashes or data loss, it should be tested first. Innovation importance focuses on the innovativeness of the functions or logic involved in the path; innovative parts may have more unknown issues and also require priority testing. A comprehensive importance score is generated for each path based on these dimensions. This comprehensive score fully reflects the importance of the path, providing a quantitative basis for subsequent ranking.

[0095] Uncovered entity relationship paths are ranked based on a comprehensive importance score, and processed sequentially in descending order of priority. A graph reasoning mechanism, combining logical relationships in the causal dependency network and information from the test case knowledge graph, generates specific test case suggestions for each path. This mechanism infers reasonable test steps and expected results based on the attributes of nodes and edges in the path, as well as the logical relationships between them. For example, if a path involves a specific input condition and operation step, the graph reasoning mechanism generates corresponding test cases based on this information, including the settings of input parameters, the specific operation process, and the expected output results. The generated test case suggestions are targeted and actionable, effectively supplementing the deficiencies of existing test cases and improving the comprehensiveness and effectiveness of testing.

[0096] In some embodiments, step S105 above, which involves obtaining an optimized test case set by dynamically adjusting the analysis strategy parameters based on historical optimization data using an adaptive engine that integrates a reinforcement learning model, based on a causal dependency network and supplementary test case suggestions, specifically includes: Based on the structural characteristics of causal dependent networks and the quality assessment results of supplementary test case suggestions, a state space is constructed, which includes network topology state, coverage state, quality state, and resource state. Based on the parameter adjustment requirements for test case optimization, an action space and reward function are designed. The action space is used to define the set of adjustable parameters for redundancy identification, causal analysis, path discovery, and generation of optimization. The reward function includes coverage reward, efficiency reward, quality reward, and stability reward. An adaptive engine integrating reinforcement learning models is constructed based on the state space, action space, and reward function. Based on the adaptive engine, historical optimization data is input, and the feature extraction network processes the test case sequence features and causal network structure features. The strategy generates network output parameter adjustment suggestions to obtain an optimized test case set.

[0097] In this embodiment, the state space is constructed by comprehensively considering the structural characteristics of the causal dependency network and the quality assessment results of the supplementary test case suggestions. The structural characteristics of the causal dependency network reflect the complex logical dependencies between test steps, including information such as the connection methods of each node in the network and the weights of edges. This information reflects the degree of correlation and logical order between test cases. The quality assessment results of the supplementary test case suggestions measure the quality of the suggestions from multiple aspects, such as the completeness, accuracy, and relevance of the suggestions. Based on these two aspects of information, the constructed state space covers the network topology state, coverage state, quality state, and resource state. The network topology state describes the overall structure of the causal dependency network, including the distribution of nodes and the connection patterns of edges, which helps the adaptive engine understand the logical architecture between test cases. The coverage state reflects the degree to which the current test cases cover the software functions and logic, such as which functional modules have been fully tested and which are still missing. The quality state reflects the quality level of the supplementary test case suggestions, such as the rationality and feasibility of the suggestions. The resource state considers the resources used in the testing process, such as manpower, time, and computing resources. By constructing such a comprehensive state space, a rich information foundation is provided for the adaptive engine, enabling it to make reasonable decisions based on different states.

[0098] Based on the parameter adjustment requirements for test case optimization, an action space and reward function are designed. The action space defines the set of adjustable parameters in processes such as redundancy identification, causal analysis, path discovery, and generation optimization. In the redundancy identification stage, adjustable parameters may include thresholds for identifying redundant test cases and similarity criteria for judging duplicate paths; in causal analysis, parameters in the causal discovery algorithm can be adjusted to more accurately analyze implicit dependencies between test steps; in path discovery, parameters of the search algorithm can be adjusted, such as search depth and breadth; in the generation optimization stage, rules and strategy parameters for generating supplementary test cases can be adjusted. By defining such an action space, the adaptive engine can flexibly adjust various parameters to adapt to different test scenarios and requirements.

[0099] Simultaneously, a reward function is designed, including coverage rewards, efficiency rewards, quality rewards, and stability rewards. Coverage rewards encourage the adaptive engine to improve test case coverage; when test cases cover more software functions and logic, corresponding rewards are given, prompting the engine to continuously explore uncovered areas. Efficiency rewards focus on the efficiency of the testing process; if the adaptive engine can complete parameter adjustments and test case optimization in a short time, it will receive an efficiency reward, incentivizing it to improve work efficiency. Quality rewards are issued based on the quality of optimized test cases; high-quality test cases can more accurately discover defects in the software, thus receiving a quality reward. Stability rewards consider the stability of the testing process, avoiding excessive fluctuations in test results due to overly aggressive parameter adjustments; rewards are given when the testing process remains stable. By designing such a reward function, the adaptive engine is guided to adjust parameters in a direction that improves test coverage, efficiency, quality, and stability.

[0100] Based on a pre-constructed state space, action space, and reward function, an adaptive engine integrating reinforcement learning models is built. This integrated reinforcement learning model combines the advantages of multiple reinforcement learning algorithms, enabling better handling of complex test case optimization problems. The engine takes the state space as input and learns the optimal action policy by continuously interacting with the environment (i.e., the test case optimization process) and based on feedback from the reward function. During the interaction, the engine selects appropriate actions based on the current state (i.e., adjusts parameters), then observes the new state and reward obtained after executing the action, updating its policy based on this information to make better decisions in subsequent interactions. Through continuous learning and optimization, the adaptive engine gradually learns how to adjust parameters to obtain the maximum reward under different states, thereby achieving intelligent optimization of test cases.

[0101] Based on the constructed adaptive engine, historical optimization data is input. This data includes relevant information about previous test case optimizations, such as previous test cases, parameter adjustment records, and optimization results. This data provides the adaptive engine with learning material, enabling it to learn from past experiences and avoid repeating mistakes. After inputting the historical optimization data, a feature extraction network processes the test case sequence features and causal network structure features. This network extracts key feature information from large amounts of data, such as the execution order of test cases, important nodes and edges in the causal dependency network, etc. This feature information helps the adaptive engine better understand the relationships and logical structure between test cases.

[0102] Then, a strategy generation network outputs parameter adjustment suggestions. Based on the feature information extracted by the feature extraction network and combined with previously learned strategies, the strategy generation network generates specific parameter adjustment suggestions. These suggestions guide the adaptive engine on how to adjust various parameters to optimize test cases. Based on these parameter adjustment suggestions, the test cases are optimized accordingly, ultimately resulting in an optimized test case set. This optimized test case set better meets actual testing needs, improves testing efficiency, effectiveness, and quality, and effectively solves many problems faced by black-box testing in the current software environment.

[0103] In some embodiments, step S106 above, which involves generating input parameter variation samples using a fuzzy testing engine based on an optimized test case set to expand the test boundary, specifically includes: Based on the input parameter features in the optimized test case set, a multi-level parameter analysis framework is used to identify the parameter structure and constraint relationships to obtain parameter analysis results. The multi-level parameter analysis framework includes a syntax parsing layer, a semantic understanding layer, and a context association layer. Based on the parameter analysis results, a hierarchical set of operations including a basic mutation layer, a semantic mutation layer, and a combined mutation layer is constructed through a mutation strategy library. Then, based on risk prediction, a priority model is used to assign mutation priorities to different parameters and strategies to obtain targeted mutation schemes. The system performs pre-filtering selection, mutation execution, post-validation checks, and sample optimization for targeted mutation schemes, and integrates an adaptive mutation control mechanism to dynamically adjust mutation parameters to obtain a parameter mutation sample set. Based on the parameter variation sample set, fuzz tests are run through the execution monitoring framework to capture abnormal behaviors and obtain the fuzz test execution results; Based on the results of fuzz testing, the test boundaries are expanded through boundary discovery and evaluation mechanisms.

[0104] In this embodiment, a multi-level parameter analysis framework is used to conduct parameter analysis based on the input parameter characteristics of the optimized test case set. This multi-level parameter analysis framework consists of a syntax parsing layer, a semantic understanding layer, and a contextualization layer. The syntax parsing layer is responsible for a detailed analysis of the syntactic structure of the input parameters, clarifying the basic format, data type, and syntactic rules between different parts of the parameters. For example, it determines whether the parameter is an integer, string, or other specific type, and the order and separation of the fields in the parameter. The semantic understanding layer delves into the semantic connotation of the parameters, understanding their actual meaning in the software function. For example, a parameter may represent the user's age, the price of a product, or the type of operation. Through semantic understanding, the role and purpose of the parameters can be grasped more accurately. The contextualization layer considers the context of the parameters in the entire test case and software system, analyzing the relationship between the parameters and other related parameters, test steps, and software modules. For example, the value of a parameter may affect the effective range of other parameters, or there may be a logical dependency between parameters in a test step and parameters in subsequent steps. Through the comprehensive analysis of these three layers, comprehensive and accurate parameter analysis results are obtained, providing a solid foundation for subsequent mutation operations.

[0105] Based on the parameter analysis results obtained above, a hierarchical operation set is constructed using a mutation strategy library. This library contains various mutation strategies, stratified into basic mutation layers, semantic mutation layers, and combined mutation layers. The basic mutation layer mainly involves basic parameter mutation operations, such as simple modifications like adding or subtracting parameters, replacing or truncating strings. The semantic mutation layer, on the other hand, focuses on the semantics of parameters, performing more targeted mutations, such as modifying age parameters to illogical values ​​or replacing operation type parameters with invalid types, to test the software's ability to handle these abnormal semantics. The combined mutation layer combines various basic and semantic mutation strategies to generate more complex and diverse mutation operations, increasing the coverage and depth of the test. Furthermore, to allocate mutation resources more rationally and improve mutation efficiency, a priority model is used to assign mutation priorities to different parameters and strategies based on risk prediction. The priority model comprehensively considers factors such as the importance of a parameter in the software, the frequency of problems with that parameter in historical tests, and the test effects that the mutation strategy may bring. It determines a priority order for each parameter and strategy, thereby obtaining a targeted mutation plan. This ensures that, with limited test resources, priority is given to mutation operations on key parameters and strategies that may uncover more defects.

[0106] The targeted mutation schemes obtained above undergo a series of processing operations to generate a parameter mutation sample set. First, a pre-filtering selection is performed. Based on preset filtering rules, mutation schemes that are clearly unreasonable or do not meet testing requirements are excluded. For example, the mutated parameter values ​​exceed the reasonable range specified by the software, or the mutation operation would cause the test environment to malfunction. This ensures that the mutation schemes entering the subsequent process have a certain degree of rationality and feasibility. Next, the mutation execution operation is performed. The input parameters in the optimized test case set are actually mutated according to the selected mutation scheme, generating mutated parameter samples. Then, a post-verification check is performed. The mutated parameter samples are checked to verify whether they meet the basic requirements and testing objectives of the software. For example, it is checked whether the mutated parameters can be correctly recognized and processed by the software, and whether they will cause abnormal software responses. Samples that do not meet the requirements are corrected or removed. Finally, sample optimization processing is performed. The verified samples are further optimized, duplicate samples are removed, similar samples are merged, and the quality and diversity of the samples are improved. Throughout the process, an adaptive mutation control mechanism is integrated. This mechanism can dynamically adjust mutation parameters, such as mutation amplitude and mutation frequency, based on the actual situation during the mutation process, such as the pass rate of mutated samples and the frequency of occurrence of anomalies, to ensure that the mutation process always proceeds in a more effective direction and ultimately obtains a high-quality parameter mutated sample set.

[0107] Based on the generated parameter mutation sample set, fuzz testing is run through an execution monitoring framework. This framework manages the entire fuzz testing process, including test task scheduling, test resource allocation, and test progress monitoring. During fuzz testing, the parameter mutation sample set is used as input to simulate various possible user input scenarios, performing comprehensive testing on the software. Simultaneously, the execution monitoring framework captures the software's behavior in real time when processing these mutation inputs, especially anomalous behaviors such as software crashes, error messages, and functional abnormalities. Detailed recording of these anomalous behaviors provides rich data support for subsequent analysis and evaluation, helping testers quickly locate problems and potential defects in the software.

[0108] Based on the results of fuzz testing, a boundary discovery and evaluation mechanism is used to expand the test boundaries. This mechanism performs in-depth analysis of captured anomalous behaviors to identify the range of input parameter values ​​and boundary conditions that cause the anomalies. For example, if analysis reveals that a parameter near a specific value causes software anomalies, then this specific value and its surrounding range may constitute a new test boundary. Simultaneously, the mechanism evaluates these newly discovered boundaries, determining their importance and priority, and ascertaining whether further in-depth testing is needed, as well as the intensity and method of testing. Based on the evaluation results, the newly discovered boundaries are incorporated into the test scope, and test cases are updated and expanded accordingly. This continuously expands the test coverage, improves software quality and reliability, and ensures stable operation of the software under various complex input conditions.

[0109] Furthermore, the expansion of the test boundary based on the fuzz test execution results through a boundary discovery and evaluation mechanism specifically includes: Based on the abnormal data in the fuzz test execution results, the direct correlation between anomalies and the variation of specific input parameters is established through basic anomaly classification, noise filtering and anomaly root cause analysis, and the effective boundary scenarios are determined. Based on effective boundary scenarios, a pattern discovery method based on clustering algorithms is used to aggregate similar scenarios into pattern categories and construct a boundary pattern knowledge base. Based on pattern knowledge in the boundary pattern knowledge base, through parameter type generalization, operation combination generalization and scenario context generalization, and by exploring complex boundary scenarios with multi-dimensional combinations, derivative test cases are generated. Based on derived test cases, the boundary expansion effect is evaluated according to coverage expansion metrics, which include spatial coverage expansion, state space coverage expansion, code path coverage expansion, and combined scenario coverage expansion. Based on the evaluation results of the boundary expansion effect, a boundary expansion scheme is generated through priority ranking and resource allocation decisions, and a test boundary expansion is performed according to the boundary expansion scheme.

[0110] In this embodiment, after obtaining the fuzz test execution results, the focus is first on the abnormal data. This abnormal data is a record of abnormal situations that occurred when the software processed variable input parameters, containing potential boundary information of the software. First, the abnormal data is classified into basic anomalies based on their manifestation, such as software crashes, error messages, and functional abnormalities, for targeted processing later. Next, noise filtering is performed to remove abnormal data caused by unstable testing environments, malfunctioning testing tools, or other non-software-related issues, ensuring the accuracy and validity of the data for subsequent analysis. Then, root cause analysis is conducted to delve into the root cause of each anomaly. By analyzing the correlation between the variation of input parameters and the anomalies, a direct link between the anomalies and the variation of specific input parameters is established. For example, if it is found that the software exhibits a specific type of anomaly when the value of a certain input parameter exceeds a certain range, then this range of values ​​for that parameter is identified as a valid boundary scenario, providing a clear direction for subsequent boundary expansion.

[0111] Based on defined valid boundary scenarios, a pattern discovery method based on clustering algorithms is employed. Clustering algorithms group data with similar characteristics together; here, similar valid boundary scenarios are aggregated into different pattern categories. For example, multiple scenarios involving software anomalies caused by input parameter numerical range exceeding limits may be clustered into one category, while scenarios involving anomalies caused by input parameter type mismatches may be clustered into another. In this way, numerous scattered valid boundary scenarios are systematically organized and summarized, constructing a boundary pattern knowledge base. This knowledge base not only stores various boundary pattern categories but also records the specific characteristics and related information of boundary scenarios within each category, providing rich knowledge support for subsequent generation of derived test cases. This allows for more targeted exploration of test boundaries based on existing patterns.

[0112] Based on pattern knowledge in the boundary pattern knowledge base, various generalization operations are performed to generate derived test cases. First, parameter type generalization: for a specific parameter type involved in a boundary pattern, try replacing it with other related or similar parameter types and observe the software's response under different parameter types. For example, if the original boundary pattern involves integer parameters, after generalization, try using floating-point numbers, string types, etc., to explore the software's handling boundaries for these different parameter types. Second, operation combination generalization: change and expand the operation combinations in the boundary pattern. For example, if the original pattern assigns a parameter value before calling a function, after generalization, try calling other functions first and then assigning parameters, or simultaneously calling multiple functions and assigning parameters, to discover the potential boundaries of the software under different operation combinations. Finally, scenario context generalization: consider the scenario context environment in which the boundary pattern exists, change some related contextual factors, such as system state, user permissions, etc., to generate more complex boundary scenarios. At the same time, we actively explore complex boundary scenarios with multi-dimensional combinations, comprehensively consider and combine factors such as parameter type, operation combination and scenario context to generate comprehensive and challenging derivative test cases, further expanding the coverage of the test boundary.

[0113] For the generated derivative test cases, the boundary expansion effect is evaluated based on coverage expansion metrics. Coverage expansion metrics encompass multiple aspects: spatial coverage expansion metrics measure the extent to which derivative test cases cover the input parameter space, indicating whether they cover more unexplored parameter value regions; state space coverage expansion metrics focus on the software's performance under different states, checking whether derivative test cases have led the software into more different states, thereby discovering more potential boundaries; code path coverage expansion metrics analyze the software code execution paths to evaluate whether derivative test cases have triggered more previously unexecuted code paths, improving code test coverage; and combined scenario coverage expansion metrics examine the extent to which derivative test cases cover various combined scenarios, ensuring the discovery of boundary issues in complex combined situations. By comprehensively evaluating the results of these metrics, a comprehensive and accurate understanding of the boundary expansion effect is achieved, clarifying which aspects of the boundaries have been effectively expanded and which aspects require further optimization and improvement.

[0114] Based on the evaluation results of the boundary expansion effect, priority ranking and resource allocation decisions are made. According to factors such as the importance of each derived test case and the likelihood of discovering potential defects, they are prioritized, with test cases that significantly improve the boundary expansion effect and have a high probability of discovering critical defects being executed first. Simultaneously, resources are rationally allocated based on the actual situation of testing resources, such as testing time, manpower, and equipment, to ensure that high-priority test cases receive sufficient testing execution. According to the generated boundary expansion plan, the test boundary expansion work is executed according to the established priority and resource allocation. During execution, the test situation is continuously monitored, and test results and discovered issues are recorded in a timely manner to provide feedback information for subsequent test optimization and further boundary expansion, forming a continuously iterative and improving test boundary expansion cycle. This continuously improves the quality and effectiveness of software testing, ensuring that the software can run stably under various boundary conditions.

[0115] Reference Figure 2 An embodiment of the present invention provides an AI test case intelligent optimization and verification system 2, wherein the system 2 specifically includes: The data conversion module 201 is used to import test case sets through a multi-format parser and convert the test case sets into structured data using natural language processing technology. Knowledge Graph Module 202 is used to build a test case knowledge graph by extracting entity relationships from structured data to establish logical dependencies between test steps. Causal analysis module 203 is used to analyze implicit dependencies, identify redundant test cases and invalid test paths, and obtain causal dependency networks by using causal discovery algorithms to analyze the entity association structure in the test case knowledge graph. It is recommended to add module 204, which is used to traverse the entity relationship paths not covered in the test case knowledge graph based on the causal dependency network and the graph reasoning mechanism to generate supplementary test case suggestions; The test case optimization module 205 is used to obtain an optimized test case set by dynamically adjusting the analysis strategy parameters based on historical optimization data, using an adaptive engine that integrates a reinforcement learning model, based on causal dependency networks and supplementary test case suggestions. Boundary expansion module 206 is used to expand the test boundary by generating input parameter mutation samples using a fuzzy testing engine based on an optimized test case set. The verification feedback module 207 is used to transmit the optimization process data to the verification interface, obtain the manual verification feedback results from the verification interface, and feed them back to the adaptive engine for model parameter optimization.

[0116] It is understandable that, such as Figure 1The content of the AI ​​test case intelligent optimization and verification method embodiment shown is applicable to the AI ​​test case intelligent optimization and verification system embodiment. The specific functions implemented by the AI ​​test case intelligent optimization and verification system embodiment are the same as those shown in the figure. Figure 1 The AI ​​test case intelligent optimization and verification method shown in the example is the same, and the beneficial effects achieved are the same as those shown. Figure 1 The beneficial effects achieved by the AI ​​test case intelligent optimization verification method embodiment shown are also the same.

[0117] It should be noted that the information interaction and execution process between the above systems are based on the same concept as the method embodiments of the present invention. For details on their specific functions and technical effects, please refer to the method embodiments section, which will not be repeated here.

[0118] Those skilled in the art will clearly understand that, for the sake of convenience and brevity, the above-described division of functional units and modules is merely an example. In practical applications, the above functions can be assigned to different functional units and modules as needed, that is, the internal structure of the system can be divided into different functional units or modules to complete all or part of the functions described above. The functional units and modules in the embodiments can be integrated into one processing unit, or each unit can exist physically separately, or two or more units can be integrated into one unit. The integrated unit can be implemented in hardware or as a software functional unit. Furthermore, the specific names of the functional units and modules are only for easy differentiation and are not intended to limit the scope of protection of this application. The specific working process of the units and modules in the above system can be referred to the corresponding process in the foregoing method embodiments, and will not be repeated here.

[0119] Reference Figure 3 The present invention also provides a computer device 3, including: a memory 302 and a processor 301, and a computer program 303 stored in the memory 302. When the computer program 303 is executed on the processor 301, it implements the AI ​​test case intelligent optimization and verification method as described in any of the above methods.

[0120] The computer device 3 may be a desktop computer, laptop, handheld computer, or cloud server, etc. The computer device 3 may include, but is not limited to, a processor 301 and a memory 302. Those skilled in the art will understand that... Figure 3 The computer device 3 is merely an example and does not constitute a limitation on the computer device 3. It may include more or fewer components than shown in the figure, or combine certain components, or different components, such as input / output devices, network access devices, etc.

[0121] The processor 301 may be a Central Processing Unit (CPU), or it may be other general-purpose processors, digital signal processors (DSPs), application-specific integrated circuits (ASICs), field-programmable gate arrays (FPGAs), or other programmable logic devices, discrete gate or transistor logic devices, discrete hardware components, etc. A general-purpose processor may be a microprocessor or any conventional processor.

[0122] In some embodiments, the memory 302 may be an internal storage unit of the computer device 3, such as a hard disk or memory of the computer device 3. In other embodiments, the memory 302 may be an external storage device of the computer device 3, such as a plug-in hard disk, smart media card (SMC), secure digital (SD) card, flash card, etc., equipped on the computer device 3. Furthermore, the memory 302 may include both internal and external storage units of the computer device 3. The memory 302 is used to store the operating system, applications, boot loader, data, and other programs, such as the program code of the computer program. The memory 302 can also be used to temporarily store data that has been output or will be output.

[0123] This invention also provides a computer-readable storage medium storing a computer program thereon, which, when executed by a processor, implements the AI ​​test case intelligent optimization and verification method as described in any of the above methods.

[0124] In this embodiment, if the integrated unit is implemented as a software functional unit and sold or used as an independent product, it can be stored in a computer-readable storage medium. Based on this understanding, all or part of the processes in the methods of the above embodiments can be implemented by a computer program instructing related hardware. The computer program can be stored in a computer-readable storage medium, and when executed by a processor, it can implement the steps of the various method embodiments described above. The computer program includes computer program code, which can be in the form of source code, object code, executable files, or certain intermediate forms. The computer-readable medium can include at least: any entity or device capable of carrying computer program code to a photographing device / terminal device, a recording medium, a computer memory, a read-only memory (ROM), a random access memory (RAM), an electrical carrier signal, a telecommunication signal, and a software distribution medium. Examples include USB flash drives, portable hard drives, magnetic disks, or optical disks. In some jurisdictions, according to legislation and patent practice, computer-readable media cannot be electrical carrier signals or telecommunication signals.

[0125] In the above embodiments, the descriptions of each embodiment have different focuses. For parts that are not described in detail or recorded in a certain embodiment, please refer to the relevant descriptions of other embodiments.

[0126] Those skilled in the art will recognize that the units and algorithm steps of the various examples described in conjunction with the embodiments disclosed herein can be implemented in electronic hardware, or a combination of computer software and electronic hardware. Whether these functions are implemented in hardware or software depends on the specific application and design constraints of the technical solution. Those skilled in the art can use different methods to implement the described functions for each specific application, but such implementation should not be considered beyond the scope of this application.

[0127] In the embodiments disclosed in this application, it should be understood that the disclosed devices / terminal equipment and methods can be implemented in other ways. For example, the device / terminal equipment embodiments described above are merely illustrative. For instance, the division of modules or units is only a logical functional division, and in actual implementation, there may be other division methods. For example, multiple units or components may be combined or integrated into another system, or some features may be ignored or not executed. Furthermore, the displayed or discussed mutual coupling or direct coupling or communication connection may be through some interfaces; the indirect coupling or communication connection between devices or units may be electrical, mechanical, or other forms.

[0128] The units described as separate components may or may not be physically separate. The components shown as units may or may not be physical units; that is, they may be located in one place or distributed across multiple network units. Some or all of the units can be selected to achieve the purpose of this embodiment according to actual needs.

Claims

1. An AI test case intelligent optimization and verification method, characterized in that, The method specifically includes: Import test case sets through a multi-format parser, and transform the test case sets into structured data using natural language processing technology; Based on structured data, logical dependencies between test steps are established through entity relationship extraction, and a test case knowledge graph is constructed. For the entity association structure in the test case knowledge graph, a causal discovery algorithm is used to analyze implicit dependencies, identify redundant test cases and invalid test paths, and obtain a causal dependency network. Based on causal dependency networks, a graph reasoning mechanism is used to traverse the entity relationship paths not covered in the test case knowledge graph and generate supplementary test case suggestions. Based on causal dependency networks and supplementary test case suggestions, an adaptive engine integrating reinforcement learning models dynamically adjusts analysis strategy parameters according to historical optimization data to obtain an optimized test case set. Based on the optimized test case set, a fuzzy testing engine is used to generate input parameter variation samples to expand the test boundary. The optimization process data is transmitted to the verification interface, and the manual verification feedback results from the verification interface are obtained and fed back to the adaptive engine for model parameter optimization.

2. The method according to claim 1, characterized in that, The process of importing test case sets through a multi-format parser and then converting them into structured data using natural language processing techniques specifically includes: The test case set is imported through a multi-format parser. A dual mechanism of format detection and adapter scheduling is used to identify test case files of different formats and convert each format file into an intermediate representation. For the natural language description in the intermediate representation, a Transformer-based encoder and a semantic role labeling model are used to jointly extract the test logic elements. Based on the test logic elements and according to the pre-set conversion rule base, the semantic description, parameter entities, and assertion conditions in the natural language description are converted into operation sequences, typed parameters, and verification expressions, respectively, to obtain structured data.

3. The method according to claim 1, characterized in that, The process of establishing logical dependencies between test steps based on structured data and extracting entity relationships to construct a test case knowledge graph specifically includes: Based on structured data, a multi-stage neural network model is used to extract key elements and their relationships in the test steps. Based on key elements and their relationships, an incremental construction strategy is used to build test suites, test cases, and test steps in layers through a graph construction engine, forming an attribute graph structure. For the constructed attribute graph structure, the dependency path, dependency strength and implicit dependency between test steps are deeply analyzed by the logical dependency analysis engine to obtain the dependency relationship network; Based on dependency networks, a knowledge fusion mechanism is used to verify and complete entity relationships by combining structural evidence, semantic evidence, and statistical evidence, thereby obtaining a test case knowledge graph.

4. The method according to claim 1, characterized in that, The aforementioned method involves analyzing the entity association structure in the test case knowledge graph using a causal discovery algorithm to identify implicit dependencies, redundant test cases, and invalid test paths, thereby obtaining a causal dependency network. Specifically, this includes: For the entity association structure in the test case knowledge graph, a score learning method based on Peter-Clark algorithm constraint learning method and greedy equivalence search algorithm is adopted. An initial causal graph is constructed through conditional independence test and greedy equivalence search. Based on the initial causal graph, a first causal dependency network is obtained by eliminating spurious causal relationships through a correction framework that includes temporal obfuscation correction, selection obfuscation correction, and promiscuous obfuscation correction. For the first causal dependency network, the redundancy relationship between test cases is analyzed through a redundancy identification framework that includes structural redundancy identification, functional redundancy identification, and statistical redundancy identification to obtain the second causal dependency network. For the second causal dependency network, invalid test paths are identified through a multi-level invalid path detection framework that includes logical invalidity detection, effect invalidity detection, and practical invalidity detection, thereby obtaining the target causal dependency network.

5. The method according to claim 4, characterized in that, The entity association structure in the test case knowledge graph is addressed using a score learning method based on the Peter-Clark algorithm's constraint learning approach and a greedy equivalence search algorithm. An initial causal graph is constructed through conditional independence testing and greedy equivalence search, specifically including: Based on the entity association structure in the test case knowledge graph, each test step entity is taken as a causal node, and the relationship edges between entities are taken as initial causal edge candidates to form a basic graph model. A three-layer conditional independence testing framework is constructed using a Peter-Clark algorithm-based constrained learning method. The first layer of the framework is used to initially screen direct causal relationships using a partial correlation-based local independence test; the second layer is used to identify indirect causal relationships using a conditional mutual information-based global independence test; and the third layer is used to comprehensively determine the causal direction using a Bayesian network-based causal structure learning algorithm. By using a conditional independence testing framework, irrelevant edges are gradually removed from the basic graph model and the direction of the edges is determined to obtain a preliminary causal structure. Based on the initial causal structure, a multi-dimensional scoring function system is designed, and a two-stage greedy search strategy is implemented to find the optimal causal structure in the Markov equivalence class space and obtain the initial causal graph.

6. The method according to claim 1, characterized in that, The method based on causal dependency networks utilizes graph reasoning mechanisms to traverse uncovered entity relationship paths in the test case knowledge graph and generate supplementary test case suggestions, specifically including: Based on the test logic structure in the causal dependency network, the coverage status of existing test cases is evaluated through a path coverage analysis model according to coverage metrics to obtain coverage analysis results. The coverage metrics include node coverage, edge coverage, and path coverage. Based on the coverage analysis results, a bidirectional breadth-first search algorithm is used to simultaneously search for paths from the key cause nodes and key verification nodes of the test case knowledge graph, and an invalid path is filtered out by applying a path feasibility assessment model to obtain the entity relationship paths that are not covered in the test case knowledge graph. Based on the uncovered entity relationship paths, priority is ranked according to the dimensions of causal importance, business importance, risk importance, and innovation importance, and a comprehensive importance score is generated for each path; The uncovered entity relationship paths are sorted based on a comprehensive importance score, and specific test case suggestions are generated through a graph reasoning mechanism.

7. The method according to claim 1, characterized in that, The proposed optimization test case set, based on causal dependency networks and supplementary test case suggestions, utilizes an adaptive engine integrating reinforcement learning models to dynamically adjust analysis strategy parameters according to historical optimization data. Specifically, it includes: Based on the structural characteristics of causal dependent networks and the quality assessment results of supplementary test case suggestions, a state space is constructed, which includes network topology state, coverage state, quality state, and resource state. Based on the parameter adjustment requirements for test case optimization, an action space and reward function are designed. The action space is used to define the set of adjustable parameters for redundancy identification, causal analysis, path discovery, and generation of optimization. The reward function includes coverage reward, efficiency reward, quality reward, and stability reward. An adaptive engine integrating reinforcement learning models is constructed based on the state space, action space, and reward function. Based on the adaptive engine, historical optimization data is input, and the feature extraction network processes the test case sequence features and causal network structure features. The strategy generates network output parameter adjustment suggestions to obtain an optimized test case set.

8. The method according to claim 1, characterized in that, The method of generating input parameter mutation samples using a fuzz testing engine based on an optimized test case set to expand the test boundary specifically includes: Based on the input parameter features in the optimized test case set, a multi-level parameter analysis framework is used to identify the parameter structure and constraint relationships to obtain parameter analysis results. The multi-level parameter analysis framework includes a syntax parsing layer, a semantic understanding layer, and a context association layer. Based on the parameter analysis results, a hierarchical set of operations including a basic mutation layer, a semantic mutation layer, and a combined mutation layer is constructed through a mutation strategy library. Then, based on risk prediction, a priority model is used to assign mutation priorities to different parameters and strategies to obtain targeted mutation schemes. The system performs pre-filtering selection, mutation execution, post-validation checks, and sample optimization for targeted mutation schemes, and integrates an adaptive mutation control mechanism to dynamically adjust mutation parameters to obtain a parameter mutation sample set. Based on the parameter variation sample set, fuzz tests are run through the execution monitoring framework to capture abnormal behaviors and obtain the fuzz test execution results; Based on the results of fuzz testing, the test boundaries are expanded through boundary discovery and evaluation mechanisms.

9. The method according to claim 8, characterized in that, The process of expanding the test boundary based on fuzz test execution results through boundary discovery and evaluation mechanisms specifically includes: Based on the abnormal data in the fuzz test execution results, the direct correlation between anomalies and the variation of specific input parameters is established through basic anomaly classification, noise filtering and anomaly root cause analysis, and the effective boundary scenarios are determined. Based on effective boundary scenarios, a pattern discovery method based on clustering algorithms is used to aggregate similar scenarios into pattern categories and construct a boundary pattern knowledge base. Based on pattern knowledge in the boundary pattern knowledge base, through parameter type generalization, operation combination generalization and scenario context generalization, and by exploring complex boundary scenarios with multi-dimensional combinations, derivative test cases are generated. Based on derived test cases, the boundary expansion effect is evaluated according to coverage expansion metrics, which include spatial coverage expansion, state space coverage expansion, code path coverage expansion, and combined scenario coverage expansion. Based on the evaluation results of the boundary expansion effect, a boundary expansion scheme is generated through priority ranking and resource allocation decisions, and a test boundary expansion is performed according to the boundary expansion scheme.

10. An AI-powered intelligent optimization and verification system for test cases, characterized in that, The system specifically includes: The data conversion module is used to import test case sets through a multi-format parser and convert the test case sets into structured data using natural language processing technology. The knowledge graph module is used to establish logical dependencies between test steps based on structured data and extract entity relationships, thereby constructing a test case knowledge graph. The causal analysis module is used to analyze implicit dependencies in the entity association structure of the test case knowledge graph using causal discovery algorithms, identify redundant test cases and invalid test paths, and obtain the causal dependency network. It is recommended to add a module to generate supplementary test case suggestions by traversing the entity relationship paths not covered in the test case knowledge graph based on the causal dependency network and using the graph reasoning mechanism. The test case optimization module is used to obtain an optimized test case set by dynamically adjusting the analysis strategy parameters based on historical optimization data, using an adaptive engine that integrates a reinforcement learning model and causal dependency network and supplementary test case suggestions. The boundary expansion module is used to expand the test boundary by generating input parameter mutation samples based on the optimized test case set using the fuzz testing engine. The verification feedback module is used to transmit the optimization process data to the verification interface, obtain the manual verification feedback results from the verification interface, and feed them back to the adaptive engine for model parameter optimization.

Citation Information

Cited By

  • A test generation method and device based on function intention and hierarchical knowledge base

    CN122285533A