Test case generation system based on multi-protocol fusion
By designing a multi-protocol fusion test case generation system, using technologies such as natural language processing, pattern matching and symbol execution, test cases for different protocols are generated, and interaction is simulated through virtualized environments, coverage is evaluated, and automated execution is achieved, the problem of multi-protocol interaction test case generation in complex software systems is solved, and the comprehensiveness and accuracy of the test is improved.
Patent Information
- Application Number
- CN202410612239.8
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-05-17
- Publication Date
- 2025-03-28
AI Technical Summary
In complex software systems or testing across multiple components/services, different components or services use different communication protocols, making it difficult to effectively interact and integrate test case generation and lack of comprehensive coverage.
A test case generation system based on multi-protocol fusion is designed, including requirements analysis module, protocol identification module, test case generation module, interactive simulation module, coverage evaluation module and automation execution module. The system generates test cases for different protocols through technologies such as natural language processing, pattern matching and symbol execution, and simulates interactions through virtualized environments, evaluates coverage, and achieves automated execution.
The system can generate comprehensive and cover test cases, improve the comprehensiveness and accuracy of tests, reduce manual intervention, improve test efficiency and accuracy, adapt to different systems and protocol needs, have flexibility and scalability, and improve system quality and reliability.
Smart Images

Figure CN119718904A_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the technical field of test cases, and in particular to a test case generation system based on multi-protocol fusion. Background Art
[0002] Test case generation is an important process in software testing, which involves automatically generating a series of test cases based on specific test conditions and objectives. These test cases are designed to cover different aspects of the software system to verify that its functions work as expected and detect potential errors or defects. Test case generation can be done manually, but usually automation tools or algorithms are used to speed up and optimize this process. Automatically generated test cases can be generated according to specific criteria and algorithms, such as coverage criteria, random testing, symbolic execution, etc. Through test case generation, the testing team can test the software system more comprehensively and find potential problems, thereby improving software quality.
[0003] Test case generation needs to consider the integration of multiple protocols, especially when it comes to complex software systems or testing across multiple components / services. In these cases, different components or services may use different communication protocols, so the generated test cases need to consider how to effectively interact and integrate between these protocols. Therefore, in the scenario of multi-protocol integration, test case generation requires the use of specific tools or frameworks to effectively simulate the communication of different protocols and generate corresponding test cases. Summary of the invention
[0004] In order to solve the above problems, the present invention provides a test case generation system based on multi-protocol fusion.
[0005] To achieve the above purpose, the technical solution adopted by the present invention is as follows:
[0006] Test case generation system based on multi-protocol fusion, including:
[0007] Requirements analysis module: used to collect specifications and functional descriptions in the requirements document, including various components, services and the interactions between them;
[0008] Protocol identification module: used to identify and extract protocol information in the system;
[0009] Test case generation module: generates test cases for different protocols based on the information provided by the requirement analysis module and the protocol type determined by the protocol identification module;
[0010] Interaction simulation module: used to simulate the interaction between different protocols;
[0011] Coverage evaluation module: used to evaluate the coverage of the generated test cases on the system;
[0012] Automated execution module: used to automatically execute the generated test cases and collect test results for analysis and reporting.
[0013] Further: the demand analysis module includes:
[0014] Use the following formula to perform natural language processing preprocessing on the requirement document, including word segmentation, part-of-speech tagging, and entity recognition, to extract key information and use case scenarios in the document:
[0015]
[0016] Among them, TF(t,d) represents the frequency of term t in document d, maxTF(w,d) represents the highest term frequency in document d, IDF(t,D) represents the inverse document frequency, and F(t,d) represents the feature value of term t in document d;
[0017] Based on the preprocessed text, keyword extraction and entity recognition techniques are used to extract key information from the requirements document, including system components, services, and functional descriptions:
[0018] TF-IDF(t,d,D)=TF(t,d)×IDF(t,D)
[0019] Where TF(t,d) represents the frequency of term t in document d, IDF(t,D) represents the inverse document frequency, and D represents the document set;
[0020] Based on the extracted key information, use syntax analysis and semantic analysis techniques to identify use case scenarios in the requirements document:
[0021]
[0022] Among them, P(w|c) represents the probability of word w appearing under category c, P(c|w) represents the probability of category c appearing when word w appears, P(w) represents the probability of word w appearing, and P(c) represents the probability of category c appearing;
[0023] Based on the identified use case scenarios, establish a use case scenario model, including user behavior, system response, and interaction process, to facilitate subsequent test case generation:
[0024]
[0025] Among them, Count(w,c) represents the number of occurrences of word w in category c, V represents the vocabulary, and α is the smoothing parameter.
[0026] Further: the protocol identification module includes:
[0027] Preprocess system documents, including word segmentation and part-of-speech tagging, for subsequent pattern matching and analysis:
[0028]
[0029] Among them, TF(t,d) represents the frequency of term t in document d, f t, represents the number of occurrences of term t in document d, ∑ i f i, represents the sum of the occurrences of all terms in document d;
[0030] Through pattern matching technology, keywords, phrases or patterns related to various communication protocols in the text are identified to determine the communication protocols involved in the system:
[0031]
[0032] Among them, A and B represent two vectors, A i and B i Represent the elements in vectors A and B respectively, and n represents the dimension of the vector;
[0033] Classify the communication protocols involved in the text based on the identified keywords, phrases or patterns:
[0034]
[0035] Among them, S represents a sample set of random variables, p i represents the probability of the i-th category in the sample set, and n represents the number of categories;
[0036] According to the classification results, various communication protocols involved in the system are extracted from the text to form a protocol list or protocol set:
[0037] TF-IDF(t,d,D)=TF(t,d)×IDF(t,D)
[0038] Among them, TF(t,d) represents the frequency of term t in document d, IDF(t,D) represents the inverse document frequency, and D represents the document set.
[0039] Further: the test case generation module includes:
[0040] By symbolically exploring the execution paths of the program's symbolic variables, test cases are generated to cover various possible execution paths and conditions:
[0041] P new =P old +α·(P best -X old )+β·(X best -Xold )+∈
[0042] Among them, P new represents the population of the next generation, P old represents the current population, P best represents the current optimal individual, X old represents the current individual, X best represents the optimal individual, α and β are learning factors, and ∈ is a random disturbance;
[0043] The system code is explored through the symbolic execution algorithm, and path constraints are generated based on the conditional statements involved in the path:
[0044] C new =C old ∪{c}
[0045] Among them, C new represents the new set of path constraints, C old represents the current path constraint set, and c represents the conditional statement in the new exploration path;
[0046] Based on symbolic execution path exploration and constraint generation, test cases are generated to cover different execution paths and conditions of the system:
[0047] TC new ={x∈D|xtisfies new}
[0048] Among them, TC new represents the newly generated test case set, D represents the domain of the input data, x represents the input data, C new Represents a new set of path constraints.
[0049] Further: the interactive simulation module includes:
[0050] Build a virtualized environment and simulate the interaction process between different protocols in the virtualized environment, including the sending and receiving of requests and responses, to simulate the communication behavior in the real system.
[0051] Further: the coverage assessment module includes:
[0052] Monitor the execution of test cases in the actual system and collect relevant information during code execution, including the number of statement executions and branch condition judgment results;
[0053] Based on the collected execution information, calculate the coverage of the test cases on the system code, including statement coverage, branch coverage, and path coverage:
[0054]
[0055] Among them, Coverage represents the code coverage, CoveredItems represents the code items covered by the test cases, and TotalItems represents the total number of code items;
[0056] The calculated coverage is fed back to the test case generation module to help optimize the generation algorithm to improve the coverage of the test cases.
[0057] Further: the automation execution module includes:
[0058] The test automation framework automatically executes the generated test cases;
[0059] According to the API of the test automation framework, write scripts to automatically execute the generated test cases and collect the execution results, including test pass / fail, error information, and execution time;
[0060] Analyze the collected test execution results and generate a test report, including test coverage, pass rate, and failure reason information, to evaluate test quality;
[0061] The generated test report is fed back to the test case generation module and coverage evaluation module to help optimize the test case generation algorithm and improve the coverage evaluation strategy.
[0062] Compared with the prior art, the present invention has the following technical advances:
[0063] The present invention can comprehensively consider the needs of the system, different communication protocols and various aspects of the system, generate test cases with comprehensive coverage, and improve the comprehensiveness and accuracy of the test. The present invention uses automation technology to automatically execute the generation, execution and result collection of test cases, reduce manual intervention, and improve test efficiency and accuracy. The present invention can adapt to the needs of different systems and different protocols, has certain flexibility and scalability, and can be customized and expanded according to the needs of specific projects. The present invention uses technical means such as symbolic execution, dynamic analysis, etc., to more accurately generate test cases and evaluate test coverage, thereby improving the accuracy and reliability of test results. The present invention can verify the stability and reliability of the system in a complex environment by simulating the interaction and abnormal situations between different protocols, thereby improving the quality and reliability of the system. The present invention can quickly perform tests and timely feedback test results by automatically executing test cases and collecting results, thereby improving the efficiency and feedback speed of the test.
[0064] In summary, the present invention has the advantages of being comprehensive, automated, flexible, accurate, reliable and efficient, and can effectively improve the quality and efficiency of system testing and reduce testing costs. BRIEF DESCRIPTION OF THE DRAWINGS
[0065] The accompanying drawings are used to provide further understanding of the present invention and constitute a part of the specification. They are used to explain the present invention together with the embodiments of the present invention and do not constitute a limitation of the present invention.
[0066] In the attached picture:
[0067] Figure 1 It is a system structure diagram of the present invention. DETAILED DESCRIPTION
[0068] The following specific embodiments may be combined with each other, and the same or similar concepts or processes may not be described in detail in some embodiments. The embodiments of the present invention will be described below in conjunction with the accompanying drawings.
[0069] like Figure 1 As shown, the present invention discloses a test case generation system based on multi-protocol fusion, comprising:
[0070] 1. Requirements analysis module: used to collect specifications and functional descriptions in the requirements document, including various components, services and the interactions between them.
[0071] 1.1 Natural Language Processing (NLP) Preprocessing:
[0072] First, the requirements document is preprocessed by natural language processing, including word segmentation, part-of-speech tagging, entity recognition, etc., to extract key information and use case scenarios in the document. In this embodiment, text preprocessing and feature extraction can be performed by using a natural language processing toolkit such as NLTK (Natural Language Toolkit) or spaCy.
[0073]
[0074] Among them, TF(t,d) represents the frequency of term t in document d, maxTF(w,d) represents the highest term frequency in document d, IDF(t,D) represents the inverse document frequency, and F(t,d) represents the feature value of term t in document d.
[0075] 1.2 Extraction of key information:
[0076] According to the preprocessed text, keyword extraction and entity recognition technology are used to extract key information from the requirement document, including system components, services, functional descriptions, etc. In this embodiment, key information can be extracted from the preprocessed text by using technologies such as TF-IDF algorithm and named entity recognition (NER).
[0077] TF-IDF(t,d,D)=TF(t,d)×IDF(t,D)
[0078] Among them, TF(t,d) represents the frequency of term t in document d, IDF(t,D) represents the inverse document frequency, and D represents the document set.
[0079] 1.3 Use Case Scenario Identification:
[0080] Based on the extracted key information, syntactic analysis and semantic analysis techniques are used to identify use case scenarios in the requirement document, including user operations, system responses, etc. In this embodiment, semantic information such as subject, predicate, and object in a sentence, as well as the relationship between user operations and system responses, can be identified by using a syntactic analyzer and a semantic role tagger.
[0081]
[0082] Among them, P(w|c) represents the probability of word w appearing under category c, P(c|w) represents the probability of category c appearing when word w appears, P(w) represents the probability of word w appearing, and P(c) represents the probability of category c appearing.
[0083] 1.4 Use Case Scenario Modeling:
[0084] According to the identified use case scenario, a use case scenario model is established, including user behavior, system response, interaction process, etc., so as to facilitate subsequent test case generation. In this embodiment, each step and interaction relationship in the use case scenario can be described by using modeling tools such as directed graphs or state transition graphs.
[0085]
[0086] Among them, Count(w,c) represents the number of occurrences of word w in category c, V represents the vocabulary, and α is the smoothing parameter.
[0087] Through the above modules, the requirement analysis module can extract key information and use case scenarios from the requirement documents, providing important input and basis for subsequent test case generation.
[0088] 2. Protocol identification module: used to identify and extract protocol information in the system.
[0089] 2.1. Text analysis preprocessing:
[0090] First, the system document is preprocessed, including word segmentation, part-of-speech tagging, etc., for subsequent pattern matching and analysis. In this embodiment, the text can be preprocessed by using natural language processing tools such as NLTK or spaCy to convert the text into a machine-understandable structure.
[0091]
[0092] Among them, TF(t,d) represents the frequency of term t in document d, f t, represents the number of occurrences of term t in document d, ∑ i f i, Represents the sum of the occurrences of all terms in document d.
[0093] 2.2 Pattern Matching:
[0094] Through pattern matching technology, keywords, phrases or patterns related to various communication protocols in the text are identified to determine the communication protocols involved in the system. In this embodiment, patterns related to communication protocols in the text can be identified by using regular expressions or rule-based pattern matching algorithms.
[0095]
[0096] Among them, A and B represent two vectors, A i and B i Represent the elements in vectors A and B respectively, and n represents the dimension of the vector.
[0097] 2.3 Protocol Classification:
[0098] According to the identified keywords, phrases or patterns, the communication protocols involved in the text are classified, including HTTP / HTTPS, RESTful API, SOAP, MQTT, etc. In this embodiment, the keywords in the text can be matched and classified with the predefined protocol categories by a rule-based classifier or a machine learning classification algorithm.
[0099]
[0100] Among them, S represents a sample set of random variables, p i represents the probability of the i-th category in the sample set, and n represents the number of categories.
[0101] 2.4. Protocol extraction:
[0102] According to the classification result, various communication protocols involved in the system are extracted from the text to form a protocol list or a protocol set. In this embodiment, the part related to the communication protocol in the text can be extracted by performing information extraction according to the classification result.
[0103] TF-IDF(t,d,D)=TF(t,d)×IDF(t,D)
[0104] Among them, TF(t,d) represents the frequency of term t in document d, IDF(t,D) represents the inverse document frequency, and D represents the document set.
[0105] Through the above modules, the protocol identification module can accurately identify the different communication protocols involved in the system and extract relevant information to provide important input for subsequent test case generation.
[0106] 3. Test case generation module: Generates test cases for different protocols based on the information provided by the requirements analysis module and the protocol type determined by the protocol identification module.
[0107] 3.1 Overview of symbolic execution algorithm:
[0108] Symbolic execution is a static analysis technique that generates test cases to cover various possible execution paths and conditions by symbolically exploring the execution paths of the symbolic variables of the program. In this embodiment, the symbolic execution of the symbolic variables of the program can be performed symbolically by using a constraint solver, and test cases can be generated based on the path constraints.
[0109] P new =P old +α·(P best -X old )+β·(X best -X old )+∈
[0110] Among them, P new represents the population of the next generation, P old represents the current population, P best represents the current optimal individual, X old represents the current individual, X best represents the optimal individual, α and β are learning factors, and ∈ is a random disturbance.
[0111] 3.2 Path Exploration and Constraint Generation:
[0112] The system code is path-explored by a symbolic execution algorithm, and path constraints are generated according to the conditional statements involved in the path. In this embodiment, the program can be symbolically executed by using a symbolic execution engine, path conditions are collected, and path constraints are solved by using a constraint solver.
[0113] C new =C old ∪{c}
[0114] Among them, C new represents the new set of path constraints, C old Represents the current set of path constraints, and c represents the conditional statement in the new exploration path.
[0115] 3.3 Test case generation:
[0116] Based on the path exploration and constraint generation of symbolic execution, test cases are generated to cover different execution paths and conditions of the system. In this embodiment, the path constraints can be solved by using a constraint solver to generate input data that meets the constraints as test cases.
[0117] TC new ={x∈D|xtisfies new}
[0118] Among them, TC new represents the newly generated test case set, D represents the domain of the input data, x represents the input data, C new Represents a new set of path constraints.
[0119] Through the above modules, the test case generation module uses symbolic execution algorithm to generate test cases for different protocols to ensure that all aspects of the system are covered.
[0120] 4. Interaction simulation module: used to simulate the interaction between different protocols.
[0121] 4.1 Virtualization environment construction:
[0122] First, a virtualization environment is built to simulate the communication and interaction of various protocols involved in the system. This environment can be a software-based virtual machine, container technology, or a hardware-based virtualization technology. In this embodiment, a virtual machine or container instance can be created by using virtualization software such as VMware, VirtualBox, Docker, etc. to build a simulation environment.
[0123] 4.2 Protocol interaction simulation:
[0124] In a virtualized environment, the interaction process between different protocols is simulated, including the sending and receiving of requests and responses, to simulate the communication behavior in a real system. In this embodiment, the network topology and communication process of different protocols can be simulated by using network simulation tools such as Mininet, GNS3, etc.
[0125] 4.3 Status monitoring and analysis:
[0126] Monitor the status of each component and service in the simulation environment, and analyze its interaction with the test case to verify the accuracy and effectiveness of the test case. In this embodiment, various indicators in the virtualized environment can be monitored and analyzed in real time by using monitoring tools such as Zabbix, Nagios, etc.
[0127] 4.4 Abnormal situation simulation:
[0128] In the simulation environment, various abnormal situations are simulated, such as network delay, packet loss, server failure, etc., to verify the stability and fault tolerance of the system under abnormal situations. In this embodiment, the abnormal situation of the network or system can be simulated by using a network simulation tool or a fault injection tool.
[0129] -Through the above modules, the interactive simulation module uses virtualization technology to simulate the interaction between different protocols, ensuring that the generated test cases can correctly simulate the behavior of the real system in the simulation environment.
[0130] 5. Coverage evaluation module: used to evaluate the coverage of the generated test cases on the system.
[0131] 5.1 Test case execution monitoring:
[0132] Monitor the execution of test cases in the actual system and collect relevant information during the code execution process, including the number of statement executions, branch condition judgment results, etc. In this embodiment, the code execution process can be monitored and relevant information can be collected while the system is running by using techniques such as code injection and hook functions.
[0133] 5.2 Coverage calculation:
[0134] Based on the collected execution information, the coverage of the test cases on the system code is calculated, including statement coverage, branch coverage, path coverage, etc. In this embodiment, the coverage index can be calculated by counting the executed statements, branches and paths in the code according to the monitored code execution.
[0135]
[0136] Among them, Coverage represents the code coverage, CoveredItems represents the code items covered by the test cases, and TotalItems represents the total number of code items.
[0137] 5.3. Coverage feedback and optimization:
[0138] The calculated coverage is fed back to the test case generation module to help optimize the generation algorithm to improve the coverage of the test case. In this embodiment, the coverage information can be interacted with the test case generation module to provide coverage reports and suggestions to help generate more comprehensive test cases.
[0139] Through the above modules, the coverage evaluation module uses dynamic analysis technology to monitor the execution of test cases and calculate the code coverage indicators to feed back to the test case generation module to help optimize the generation algorithm and improve the coverage of test cases.
[0140] 6.Automated execution module: used to automatically execute the generated test cases and collect test results for analysis and reporting.
[0141] 6.1 Test Automation Framework Selection:
[0142] Select a suitable test automation framework, such as Selenium Web Driver (for Web applications), Appium (for mobile applications), Robot Framework, etc., for automatically executing the generated test cases. In this embodiment, the test case scripts can be written by utilizing the API and functions provided by the test automation framework to achieve automated execution and result collection.
[0143] 6.2 Test case execution and result collection:
[0144] According to the API of the test automation framework, scripts are written to automatically execute the generated test cases and collect the execution results, including whether the test passed or not, error information, execution time, etc. In this embodiment, the automatic execution of test cases and result collection can be achieved by utilizing the assertion, logging and other functions provided by the test automation framework.
[0145] 6.3 Execution result analysis and reporting:
[0146] The collected test execution results are analyzed to generate a test report, including information such as test coverage, pass rate, and failure reasons, for evaluating the test quality. In this embodiment, the execution results can be analyzed and organized by using a report generation tool provided by the test automation framework or a third-party reporting tool to generate a visual test report.
[0147] 6.4. Result feedback and iterative optimization:
[0148] The generated test report is fed back to the test case generation module and the coverage evaluation module to help optimize the test case generation algorithm and improve the coverage evaluation strategy. In this embodiment, the test report can be provided to the relevant modules in the form of data or charts, and improvements and optimizations can be made by analyzing the data in the report.
[0149] Through the above modules, the automated execution module uses the test automation framework to realize the automated execution of the generated test cases, and collects the execution results for analysis and reporting, providing data support for the iterative optimization of the test process.
[0150] The requirements analysis module provides system requirements and functional descriptions, and the protocol identification module identifies the communication protocols involved in the system based on the information provided by the requirements analysis module. The requirements analysis module provides system requirements and functional descriptions, and the test case generation module generates test cases for different protocols based on the information provided by the requirements analysis module. The protocol identification module determines the communication protocols involved in the system, and the test case generation module generates corresponding test cases based on the protocol types determined by the protocol identification module. The test case generation module generates test cases for different protocols, and the interaction simulation module simulates the interaction between different protocols based on the generated test cases. The test cases generated by the test case generation module need to undergo coverage evaluation, and the coverage evaluation module performs coverage evaluation on the generated test cases to determine whether they cover all aspects of the system. The interaction simulation module executes the generated test cases and generates execution results, and the coverage evaluation module evaluates the coverage of the test cases based on the execution results. The coverage evaluation module provides test result feedback, and the automated execution module automatically executes the test cases based on the feedback provided by the coverage evaluation module.
[0151] Finally, it should be noted that the above is only a preferred embodiment of the present invention and is not intended to limit the present invention. Although the present invention has been described in detail with reference to the aforementioned embodiments, those skilled in the art can still modify the technical solutions described in the aforementioned embodiments or replace some of the technical features therein with equivalents. Any modification, equivalent replacement, improvement, etc. made within the spirit and principle of the present invention shall be included in the scope of protection of the claims of the present invention.
Claims
1. A test case generation system based on multi-protocol fusion, characterized in that: include: Requirements analysis module: used to collect specifications and functional descriptions in the requirements document, including various components, services and the interactions between them; Protocol identification module: used to identify and extract protocol information in the system; Test case generation module: generates test cases for different protocols based on the information provided by the requirement analysis module and the protocol type determined by the protocol identification module; Interaction simulation module: used to simulate the interaction between different protocols; Coverage evaluation module: used to evaluate the coverage of the generated test cases on the system; Automated execution module: used to automatically execute the generated test cases and collect test results for analysis and reporting.
2. The test case generation system based on multi-protocol fusion according to claim 1, characterized in that: The demand analysis module includes: Use the following formula to perform natural language processing preprocessing on the requirement document, including word segmentation, part-of-speech tagging, and entity recognition, to extract key information and use case scenarios in the document: Among them, TF(t,d) represents the frequency of term t in document d, maxTF(w,d) represents the highest term frequency in document d, IDF(t,D) represents the inverse document frequency, and F(t,d) represents the feature value of term t in document d; Based on the preprocessed text, keyword extraction and entity recognition techniques are used to extract key information from the requirements document, including system components, services, and functional descriptions: TF-IDF(t,d,D)=TF(t,d)×IDF(t,D) Among them, TF(t,d) represents the frequency of term t in document d, IDF(t,D) represents the inverse document frequency, and D represents the document set; Based on the extracted key information, use syntax analysis and semantic analysis techniques to identify use case scenarios in the requirements document: Among them, P(w|c) represents the probability of word w appearing under category c, P(c|w) represents the probability of category c appearing when word w appears, P(w) represents the probability of word w appearing, and P(c) represents the probability of category c appearing; Based on the identified use case scenarios, establish a use case scenario model, including user behavior, system response, and interaction process, to facilitate subsequent test case generation: Among them, Count(w,c) represents the number of occurrences of word w in category c, V represents the vocabulary, and α is the smoothing parameter.
3. The test case generation system based on multi-protocol fusion according to claim 2 is characterized in that: The protocol identification module comprises: Preprocess system documents, including word segmentation and part-of-speech tagging, for subsequent pattern matching and analysis: Among them, TF(t,d) represents the frequency of term t in document d, f t,d represents the number of occurrences of term t in document d, ∑ i f i,d represents the sum of the occurrences of all terms in document d; Through pattern matching technology, keywords, phrases or patterns related to various communication protocols in the text are identified to determine the communication protocols involved in the system: Among them, A and B represent two vectors, A i and B i Represent the elements in vectors A and B respectively, and n represents the dimension of the vector; Classify the communication protocols involved in the text based on the identified keywords, phrases or patterns: Among them, S represents a sample set of random variables, p i represents the probability of the i-th category in the sample set, and n represents the number of categories; According to the classification results, various communication protocols involved in the system are extracted from the text to form a protocol list or protocol set: TF-IDF(t,d,D)=TF(t,d)×IDF(t,D) Among them, TF(t,d) represents the frequency of term t in document d, IDF(t,D) represents the inverse document frequency, and D represents the document set.
4. The test case generation system based on multi-protocol fusion according to claim 3 is characterized in that: The test case generation module includes: By symbolically exploring the execution paths of the program's symbolic variables, test cases are generated to cover various possible execution paths and conditions: P new =P old +α·(P best -X old )+β·(X best -X old )+∈ Among them, P new represents the population of the next generation, P old represents the current population, P best represents the current optimal individual, X old represents the current individual, X best represents the optimal individual, α and β are learning factors, and ∈ is a random disturbance; The system code is explored through the symbolic execution algorithm, and path constraints are generated based on the conditional statements involved in the path: C new =C old ∪{c} Among them, C new represents the new set of path constraints, C old represents the current set of path constraints, and c represents the conditional statement in the new exploration path; Based on symbolic execution path exploration and constraint generation, test cases are generated to cover different execution paths and conditions of the system: TC new ={x∈D|x satisfies C new } Among them, TC new represents the newly generated test case set, D represents the domain of the input data, x represents the input data, C new Represents a new set of path constraints.
5. The test case generation system based on multi-protocol fusion according to claim 4 is characterized in that: The interactive simulation module comprises: Build a virtualized environment and simulate the interaction process between different protocols in the virtualized environment, including the sending and receiving of requests and responses, to simulate the communication behavior in the real system.
6. The test case generation system based on multi-protocol fusion according to claim 5 is characterized in that: The coverage evaluation module includes: Monitor the execution of test cases in the actual system and collect relevant information during code execution, including the number of statement executions and branch condition judgment results; Based on the collected execution information, calculate the coverage of the test cases on the system code, including statement coverage, branch coverage, and path coverage: Among them, Coverage represents the code coverage, CoveredItems represents the code items covered by the test cases, and TotalItems represents the total number of code items; The calculated coverage is fed back to the test case generation module to help optimize the generation algorithm to improve the coverage of the test cases.
7. The test case generation system based on multi-protocol fusion according to claim 6 is characterized in that: The automation execution module includes: The test automation framework automatically executes the generated test cases; According to the API of the test automation framework, write scripts to automatically execute the generated test cases and collect the execution results, including test pass / fail, error information, and execution time; Analyze the collected test execution results and generate a test report, including test coverage, pass rate, and failure reason information, to evaluate test quality; The generated test report is fed back to the test case generation module and coverage evaluation module to help optimize the test case generation algorithm and improve the coverage evaluation strategy.
Citation Information
Cited By
Universal verification system supporting multiple protocols and chip verification method
CN120597791A
Domestic CPU architecture virtualization application compatible method and system based on large model
CN121387758A