Communication test case extraction method based on machine learning algorithm
Through the communication test case extraction method based on machine learning algorithm, the problems of inefficiency, incomplete coverage and lack of flexibility in traditional methods are solved, and efficient, flexible and extensive coverage are achieved to generate test cases, suitable for complex communication systems.
Patent Information
- Application Number
- CN202411650396.4
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-11-19
- Publication Date
- 2025-03-18
AI Technical Summary
The traditional communication test case extraction method relies on manual experience, is inefficient, has incomplete coverage, and lacks flexibility, making it difficult to quickly adapt to changes in communication systems.
The communication test case extraction method based on machine learning algorithms is adopted, including modeling the communication system, using efficient test case generation algorithms, cooperating with HIL network cabinet application and verification, and establishing a test case library to improve the quality and effectiveness of test cases.
It improves the efficiency of the extraction of test cases, reduces manual intervention, reduces test costs, enhances the coverage and flexibility of test cases, and adapts to different types of communication systems and complex communication scenarios.
Smart Images

Figure CN119645841A_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the technical field of test cases, and in particular to a communication test case extraction method based on a machine learning algorithm. Background Art
[0002] As a branch of artificial intelligence, machine learning enables computers to learn from data and automatically extract patterns and knowledge. The role of machine learning in big data analysis: improved data processing speed, improved data accuracy, and improved automation. Machine learning algorithms include linear regression, logistic regression, decision trees, random forests, support vector machines, etc. A test case refers to a description of a test task for a specific software product, reflecting the test plan, method, technique, and strategy. Its content includes test objectives, test environment, input data, test steps, expected results, test scripts, etc., and finally forms a document. Simply put, a test case is a set of test inputs, execution conditions, and expected results compiled for a special goal, which is used to verify whether a specific software requirement is met.
[0003] At present, in communication testing, traditional test case extraction methods mainly rely on manual experience for design, and have the following problems: low efficiency: manual design of test cases is time-consuming and labor-intensive, and it is difficult to cover all possible communication scenarios and situations; incomplete coverage: due to human cognitive limitations, some key test scenarios are easily missed, resulting in insufficient testing; lack of flexibility: when the communication system changes, manually designed test cases are difficult to quickly adapt to new situations, and a lot of re-design work needs to be done. Therefore, there is an urgent need for a communication test case extraction method based on machine learning algorithms. Summary of the invention
[0004] The purpose of the present invention is to provide a communication test case extraction method based on a machine learning algorithm in order to solve the problems that the current traditional test case extraction method mainly relies on manual experience for design, is inefficient, has incomplete coverage and lacks flexibility.
[0005] To achieve the above object, the present invention provides the following technical solution: a communication test case extraction method based on a machine learning algorithm, comprising the following steps: Step 1: Model the communication system: including the modeling of the communication protocols, equipment architecture, test processes, etc. of major OEMs; Step 2: Efficient test case generation algorithm: Use specific algorithms and techniques to automatically generate the initial test case set; Step 3: Cooperate with HIL network cabinet application and verification: Apply and verify in actual communication tests, conduct data mining on historical test data and operation logs of communication tests, find out frequently occurring problem modes and failure scenarios, and generate new test cases based on them to improve the quality and effectiveness of test cases; Step 4: Establish a test case library: Manage and maintain the generated test cases to facilitate subsequent test execution and reuse.
[0006] Preferably, the step 1 further includes the following steps: S1. Determine the modeling goal: The purpose of modeling is to fully and accurately reflect the characteristics and behaviors of the communication system, so as to provide a basis for subsequent test case generation and optimization; S2. Collect relevant information: Collect information on communication protocols, equipment architecture, test processes, etc. from major OEMs as a basis for modeling; S3. Analyze the communication system structure: Have a deep understanding of the components of the communication system, including hardware devices, software modules, communication links, etc., and their interrelationships; S4. Define model elements: Based on the collected information, define the elements in the model, such as communication nodes, communication links, data packets, protocol parameters, etc.; S5. Establish model relationships: determine the relationships between model elements, such as connection relationships, data transmission relationships, control relationships, etc., to reflect the actual operation of the communication system; S6. Describe communication behavior: Use appropriate mathematical or logical expressions to describe the behavior of the communication system; S7. Verify model accuracy: Verify the accuracy and reliability of the model by comparing it with the operating data of the actual communication system, and make necessary adjustments and optimizations to the model.
[0007] Preferably, the description of communication behavior, including data transmission process, protocol interaction, error handling, etc., can use a state machine model to describe the state transition of the communication system, and use probability distribution to describe the transmission delay of the data packet, etc.
[0008] Preferably, the accuracy of the verification model can use indicators such as root mean square error (RMSE) to measure the difference between the predicted value and the actual value of the model.
[0009] Preferably, in step 2, random generation, rule-based generation and other methods are used to generate an initial test case set. Rule-based generation can generate test cases that meet specific conditions according to the specifications and requirements of the communication protocol. When generating test cases, it is necessary to consider various parameters and states of the communication system to ensure the coverage of the test cases.
[0010] Preferably, in step three, the initial test case set is optimized and screened using a machine learning algorithm, and applied and verified in actual communication tests in conjunction with the HIL network cabinet. In the scenario of communication test case extraction, an association rule mining algorithm can be used to analyze historical test data and operation logs of communication tests. Through this algorithm, the association between communication errors and specific system parameters can be discovered.
[0011] Preferably, the association rule mining algorithm comprises the following steps: S1. Data preparation: Collect and organize relevant historical test data and operation logs to ensure the accuracy and completeness of the data; S2. Frequent item set mining: find out the itemsets that appear frequently in the data and use Apriori algorithm to mine frequent itemsets; S3, association rule generation: Generate association rules based on frequent item sets to describe the association relationship between variables; S4, rule evaluation and screening: Evaluate the generated association rules and screen out meaningful rules based on certain standards.
[0012] Preferably, in step 4, a database management system is used to store test cases, and an index and query mechanism is established to facilitate rapid retrieval and reuse of test cases.
[0013] Compared with the prior art, the present invention has the following beneficial effects: The present invention adopts advanced modeling technology, efficient test case generation algorithm, HIL network cabinet application and verification, and test case library management method, which can improve the efficiency of test case extraction, reduce manual intervention, reduce testing costs, enhance the coverage of test cases, improve the quality and reliability of communication testing, adapt to different types of communication systems and complex communication scenarios, have strong versatility and flexibility, facilitate the management and reuse of test cases, and improve the utilization rate of test resources. BRIEF DESCRIPTION OF THE DRAWINGS
[0014] Figure 1 It is a schematic diagram of the method flow of the present invention. DETAILED DESCRIPTION
[0015] The following will be combined with the drawings in the embodiments of the present invention to clearly and completely describe the technical solutions in the embodiments of the present invention. Obviously, the described embodiments are only part of the embodiments of the present invention, not all of the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by ordinary technicians in this field without creative work are within the scope of protection of the present invention.
[0016] See also Figure 1, a communication test case extraction method based on machine learning algorithm, comprising the following steps: Step 1: Model the communication system: including the modeling of the communication protocols, equipment architecture, test processes, etc. of major OEMs; Step 2: Efficient test case generation algorithm: Use specific algorithms and techniques to automatically generate the initial test case set; Step 3: Cooperate with HIL network cabinet application and verification: Apply and verify in actual communication tests, conduct data mining on historical test data and operation logs of communication tests, find out frequently occurring problem modes and failure scenarios, and generate new test cases based on them to improve the quality and effectiveness of test cases; Step 4: Establish a test case library: Manage and maintain the generated test cases to facilitate subsequent test execution and reuse.
[0017] Example 1 As a preferred embodiment of the present invention: Step 1 also includes the following steps: S1. Determine the modeling goal: The purpose of modeling is to fully and accurately reflect the characteristics and behaviors of the communication system, so as to provide a basis for subsequent test case generation and optimization; S2. Collect relevant information: Collect information on communication protocols, equipment architecture, test processes, etc. from major OEMs as a basis for modeling; S3. Analyze the communication system structure: Have a deep understanding of the components of the communication system, including hardware devices, software modules, communication links, etc., and their interrelationships; S4. Define model elements: Based on the collected information, define the elements in the model, such as communication nodes, communication links, data packets, protocol parameters, etc.; S5. Establish model relationships: determine the relationships between model elements, such as connection relationships, data transmission relationships, control relationships, etc., to reflect the actual operation of the communication system; S6. Describe communication behavior: Use appropriate mathematical or logical expressions to describe the behavior of the communication system; S7. Verify model accuracy: Verify the accuracy and reliability of the model by comparing it with the operating data of the actual communication system, and make necessary adjustments and optimizations to the model; First, determine the modeling goal. The purpose of modeling is to fully and accurately reflect the characteristics and behaviors of the communication system in order to provide a basis for the subsequent test case generation and optimization. Collect information on communication protocols, equipment architecture, test processes, etc. of major OEMs as the basis for modeling. Deeply understand the components of the communication system, including hardware devices, software modules, communication links, etc., and the relationship between them. Based on the collected information, define the elements in the model, such as communication nodes, communication links, data packets, protocol parameters, etc. Then, determine the relationship between model elements, such as connection relationships, data transmission relationships, control relationships, etc., to reflect the actual operation of the communication system. Finally, use appropriate mathematical or logical expressions to describe the behavior of the communication system, and verify the accuracy and reliability of the model by comparing it with the operating data of the actual communication system. Make necessary adjustments and optimizations to the model to verify the accuracy of the model. Indicators such as root mean square error (RMSE) can be used to measure the difference between the predicted value and the actual value of the model. The communication behavior predicted by the model can be compared with the operating data of the actual communication system, and the RMSE can be calculated to evaluate the accuracy of the model.
[0018] Example 2 As a preferred embodiment of the present invention: describing communication behavior, including data transmission process, protocol interaction, error handling, etc., a state machine model can be used to describe the state transition of the communication system, and probability distribution can be used to describe the transmission delay of the data packet, etc.; Use appropriate mathematical or logical expressions to describe the behavior of the communication system, including data transmission process, protocol interaction, error handling, etc. Data transmission refers to the process of transmitting data from the data source to the data terminal through one or more data links in accordance with certain procedures. State machine is the abbreviation of finite state automaton, which is a mathematical model abstracted from the operating rules of real things. It is used for state transition of communication system and uses probability distribution to describe the transmission delay of data packets.
[0019] Example 3 As a preferred embodiment of the present invention: to verify the accuracy of the model, an indicator such as the root mean square error (RMSE) can be used to measure the difference between the predicted value and the actual value of the model; By comparing the model with the actual communication system operation data, the accuracy and reliability of the model can be verified, and the model can be adjusted and optimized as necessary. Indicators such as the root mean square error (RMSE) can be used to measure the difference between the model's predicted value and the actual value. The communication behavior predicted by the model can be compared with the actual communication system operation data, and the RMSE can be calculated to evaluate the accuracy of the model.
[0020] Example 4 As a preferred embodiment of the present invention: in step 2, the initial test case set is generated by using random generation, rule-based generation and other methods. The rule-based generation can generate test cases that meet specific conditions according to the specifications and requirements of the communication protocol. When generating test cases, various parameters and states of the communication system need to be considered to ensure the coverage of the test cases; The test cases generated randomly and based on rules need to comply with the communication protocol and meet specific requirements, while taking into account the parameters and status of the communication system to ensure the coverage of the generated test cases.
[0021] Example 5 As a preferred embodiment of the present invention: in step 3, the initial test case set is optimized and screened using a machine learning algorithm, and applied and verified in actual communication tests in conjunction with the HIL network cabinet. In the scenario of communication test case extraction, an association rule mining algorithm can be used to analyze historical test data and operation logs of communication tests. Through this algorithm, the association between communication errors and specific system parameters can be found; HIL network cabinet is an advanced simulation system, which is mainly used to test and verify the performance and functions of various systems, so as to test and verify the test cases. The association rule mining algorithm is a method for discovering interesting relationships between item sets in large data sets. It analyzes the item sets in the transaction database and finds the rules whose support and confidence meet the user-set thresholds.
[0022] Example 6 As a preferred embodiment of the present invention: the association rule mining algorithm comprises the following steps: S1. Data preparation: Collect and organize relevant historical test data and operation logs to ensure the accuracy and completeness of the data; S2. Frequent item set mining: find out the itemsets that appear frequently in the data and use Apriori algorithm to mine frequent itemsets; S3, association rule generation: Generate association rules based on frequent item sets to describe the association relationship between variables; S4, rule evaluation and screening: Evaluate the generated association rules and screen out meaningful rules according to certain standards; The association rule mining algorithm is a method for discovering interesting relationships between item sets in large data sets. It analyzes the item sets in the transaction database to find rules whose support and confidence meet the user-set thresholds. The Apriori algorithm is one of the most classic algorithms in association rule mining. It uses an iterative method of layer-by-layer search to find frequent item sets in the database through connection and pruning steps, and then generates association rules that meet the minimum support and minimum confidence. The generated association rules can be evaluated by the standards of support, confidence and lift.
[0023] Example 7 As a preferred embodiment of the present invention: In step 4, a database management system is used to store test cases, and an index and query mechanism is established to facilitate rapid retrieval and reuse of test cases; A database management system is a large-scale software that manipulates and manages databases. It is used to establish, use and maintain databases. It is referred to as DBMS. It manages and controls the database in a unified manner to ensure the security and integrity of the database. Using a database management system to store test cases can effectively save test cases and can classify and store them according to their relevant parameters and attributes for subsequent management and reuse.
[0024] It will be apparent to those skilled in the art that the invention is not limited to the details of the exemplary embodiments described above and that the invention can be implemented in other specific forms without departing from the spirit or essential features of the invention. Therefore, the embodiments should be considered in all respects as exemplary and non-restrictive, and the scope of the invention is defined by the appended claims rather than the foregoing description, and it is intended that all variations within the meaning and range of equivalents of the claims be included in the invention. Any reference numeral in a claim should not be considered as limiting the claim to which it relates.
Claims
1. A communication test case extraction method based on machine learning algorithm, characterized in that: The following steps are involved: Step 1: Model the communication system: including the modeling of the communication protocols, equipment architecture, test processes, etc. of major OEMs; Step 2: Efficient test case generation algorithm: Use specific algorithms and techniques to automatically generate the initial test case set; Step 3: Cooperate with HIL network cabinet application and verification: Apply and verify in actual communication tests, conduct data mining on historical test data and operation logs of communication tests, find out frequently occurring problem modes and failure scenarios, and generate new test cases based on them to improve the quality and effectiveness of test cases; Step 4: Establish a test case library: Manage and maintain the generated test cases to facilitate subsequent test execution and reuse.
2. The method for extracting communication test cases based on a machine learning algorithm according to claim 1, characterized in that: The step 1 also includes the following steps: S1. Determine the modeling goal: The purpose of modeling is to fully and accurately reflect the characteristics and behaviors of the communication system, so as to provide a basis for subsequent test case generation and optimization; S2. Collect relevant information: Collect information on communication protocols, equipment architecture, test processes, etc. from major OEMs as a basis for modeling; S3. Analyze the communication system structure: Have a deep understanding of the components of the communication system, including hardware devices, software modules, communication links, etc., and their interrelationships; S4. Define model elements: Based on the collected information, define the elements in the model, such as communication nodes, communication links, data packets, protocol parameters, etc.; S5. Establish model relationships: determine the relationships between model elements, such as connection relationships, data transmission relationships, control relationships, etc., to reflect the actual operation of the communication system; S6. Describe communication behavior: Use appropriate mathematical or logical expressions to describe the behavior of the communication system; S7. Verify model accuracy: Verify the accuracy and reliability of the model by comparing it with the operating data of the actual communication system, and make necessary adjustments and optimizations to the model.
3. The method for extracting communication test cases based on a machine learning algorithm according to claim 2, characterized in that: The description of communication behavior, including data transmission process, protocol interaction, error handling, etc., can use a state machine model to describe the state transition of the communication system, and use probability distribution to describe the transmission delay of the data packet, etc.
4. The method for extracting communication test cases based on a machine learning algorithm according to claim 2, characterized in that: The accuracy of the validation model can be measured using indicators such as the root mean square error (RMSE) to measure the difference between the model's predicted value and the actual value.
5. The method for extracting communication test cases based on a machine learning algorithm according to claim 1, characterized in that: In the step 2, random generation, rule-based generation and other methods are used to generate an initial test case set. Rule-based generation can generate test cases that meet specific conditions according to the specifications and requirements of the communication protocol. When generating test cases, it is necessary to consider various parameters and states of the communication system to ensure the coverage of the test cases.
6. The method for extracting communication test cases based on a machine learning algorithm according to claim 1, characterized in that: In step three, the initial test case set is optimized and screened using a machine learning algorithm, and is applied and verified in actual communication tests in conjunction with the HIL network cabinet. In the scenario of communication test case extraction, the association rule mining algorithm can be used to analyze historical test data and operation logs of communication tests. Through this algorithm, the association between communication errors and specific system parameters can be discovered.
7. The method for extracting communication test cases based on a machine learning algorithm according to claim 6, characterized in that: The association rule mining algorithm comprises the following steps: S1. Data preparation: Collect and organize relevant historical test data and operation logs to ensure the accuracy and completeness of the data; S2. Frequent item set mining: find out the itemsets that appear frequently in the data and use Apriori algorithm to mine frequent itemsets; S3, association rule generation: Generate association rules based on frequent item sets to describe the association relationship between variables; S4, rule evaluation and screening: Evaluate the generated association rules and screen out meaningful rules based on certain standards.
8. The method for extracting communication test cases based on a machine learning algorithm according to claim 1, characterized in that: In the step 4, a database management system is used to store test cases, and an index and query mechanism is established to facilitate rapid retrieval and reuse of test cases.