A method, device and computer readable storage medium for automatically generating a test case set
By establishing a parameter association model, communication radio frequency test case sets are automatically generated, solving the problems of low generation efficiency, error susceptibility, and poor flexibility in existing technologies, and achieving efficient and accurate test case generation and rapid response.
Patent Information
- Application Number
- CN202611466327.7
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2026-09-20
- Publication Date
- 2026-11-06
AI Technical Summary
Existing communication radio frequency testing methods suffer from inefficient test case generation, are prone to errors, and lack flexibility, failing to meet the rapid iteration requirements of agile development.
By establishing a parameter association model, test case sets are automatically generated. The mapping relationship is used to automatically map high-level test requirements to low-level parameters, achieving fully automated generation and dynamic response.
It significantly improves the efficiency and accuracy of test case generation, reduces human error, enhances the flexibility and responsiveness of test plans, and lowers maintenance costs.
Smart Images

Figure CN123048415A_ABST
Abstract
Description
Technical Field
[0001] This invention relates to the field of communication radio frequency testing technology, and specifically to a method, apparatus, and computer-readable storage medium for automatically generating test case sets. Background Technology
[0002] In the radio frequency (RF) testing of modern communication systems, the generation and configuration of test cases is a fundamental and crucial task. A complete test plan often needs to cover a large number of parameter combinations to ensure the stability and reliability of product functionality.
[0003] In existing technologies, the generation of test cases, especially those involving the configuration of multi-dimensional parameters, largely relies on manual operation by testers. In radio frequency testing in the field of communications, after determining a communication frequency band to be tested, testers need to manually select the frequencies to be tested one by one from a lengthy list that may contain dozens or even hundreds of specific frequency points.
[0004] This purely manual configuration method has obvious drawbacks. First, it is inefficient. Testers need to spend a lot of time on tedious check-in operations, especially when facing multiple test tasks. This repetitive work seriously slows down the testing progress. Second, it is prone to errors. Long periods of repetitive operation can easily lead to tester fatigue or negligence, resulting in missed or incorrect selections of frequency points, which will directly affect the test coverage and the accuracy of the final results.
[0005] Furthermore, existing technologies are quite rigid in responding to changing requirements. Once testing requirements are slightly adjusted, such as changing the test frequency band or adjusting the test strategy, testers often need to discard the original configuration and start a new round of manual selection and configuration from scratch, which may even require re-initiating the internal approval process. This makes test plan maintenance costly and cannot meet the requirements of rapid test iteration in the current agile development model. Therefore, how to improve the automation, accuracy, and flexibility of test case generation is a technical problem that urgently needs to be solved in this field. Summary of the Invention
[0006] To address the technical problems of low efficiency, error-proneness, and poor flexibility in manually generating test cases in the prior art, this invention provides a method, apparatus, and computer-readable storage medium for automatically generating test case sets.
[0007] This invention provides a method for automatically generating test case sets, comprising: establishing a parameter association model, wherein the parameter association model stores: a first mapping relationship and a second mapping relationship; the first mapping relationship is used to characterize the correspondence between a test dimension and the full set of parameters under that test dimension; the second mapping relationship is used to characterize the correspondence between a test strategy and parameter filtering rules; receiving test configuration information of a target test case, wherein the test configuration information includes: a target test dimension value corresponding to the first mapping relationship, a target test strategy corresponding to the second mapping relationship, and other parameters; determining the full set of parameters corresponding to the target test dimension value based on the target test dimension value and using the first mapping relationship; obtaining the corresponding parameter filtering rules based on the target test strategy and using the second mapping relationship; and applying the parameter filtering rules to process the full set of parameters to generate a target parameter subset; and combining each parameter in the target parameter subset with the other parameters characterizing the test configuration information to generate a set of executable test cases.
[0008] In one implementation, the test dimension is a communication frequency band, and the full parameter set is the set of all frequency points corresponding to the communication frequency band. By abstracting specific business scenarios into test dimensions and a full parameter set, this method has good versatility.
[0009] Furthermore, the testing strategy is determined by preset attributes of the target test cases. In this way, users only need to select a macro-level testing strategy to indirectly specify the complex parameter filtering logic behind it, simplifying the user operation.
[0010] Optionally, when the preset attribute of the target test case is sampling testing, the parameter selection rule is: select the first, middle, and last frequency points from the full set of frequency points as the subset of target parameters. This approach can significantly reduce test execution time while ensuring basic test coverage, making it suitable for scenarios such as rapid regression testing.
[0011] Optionally, when the preset attribute of the target test case is full scan, the parameter filtering rule is: retain all frequency points in the full frequency point set, so that the target parameter subset is the same as the full parameter set. This enables comprehensive traversal testing of this test dimension, ensuring sufficient test coverage.
[0012] Furthermore, the method also includes: upon receiving changed test configuration information, automatically re-executing the steps of determining the full set of parameters, generating the target parameter subset, and generating the set of executable test cases. This approach enables test plans to respond quickly to changes in requirements, improving the flexibility and agility of testing operations.
[0013] In one specific implementation, the step of combining each parameter in the target parameter subset with other parameters representing the test configuration information specifically includes: performing a Cartesian product combination on the target parameter subset and the other parameters representing the test configuration information. In this way, all possible test case combinations can be automatically and comprehensively generated, avoiding omissions that may occur during manual combination.
[0014] Optionally, the parameter association model is a structured database, which includes a task layer, an environment layer, a parameter layer, and a constraint layer to achieve structured management and maintenance of the mapping relationship.
[0015] The present invention also provides an apparatus for automatically generating test case sets, comprising: a storage module for storing a parameter association model, the parameter association model including: a first mapping relationship for representing the correspondence between a test dimension and a full set of parameters under the test dimension, and a second mapping relationship for representing the correspondence between a test strategy and parameter filtering rules; a receiving module for receiving test configuration information of a target test case, the test configuration information including: a target test dimension value corresponding to the first mapping relationship, a target test strategy corresponding to the second mapping relationship, and other parameters; and a processing module configured to: determine the full set of parameters corresponding to the target test dimension value based on the target test dimension value and using the first mapping relationship; obtain the corresponding parameter filtering rules based on the target test strategy and using the second mapping relationship, and apply the parameter filtering rules to process the full set of parameters to generate a target parameter subset; and combine each parameter in the target parameter subset with the other parameters representing the test configuration information to generate a set of executable test cases.
[0016] The present invention also provides a computer-readable storage medium having a computer program stored thereon, wherein the program, when executed by a processor, implements the method for automatically generating test case sets as described in any of the preceding claims.
[0017] Compared with the prior art, the technical solution provided by the present invention has the following beneficial effects: First, this invention achieves fully automated test case generation by establishing a parameter association model and automatically parsing and filtering parameters based on received macro-level test configuration information. This eliminates the tedious and inefficient method of manually selecting parameters, improving test plan generation efficiency by over 80%. Furthermore, because the entire process is based on pre-defined standardized mapping relationships, it greatly mitigates the risk of human error in selecting parameters, ensuring the accuracy and coverage of the generated set of executable test cases.
[0018] Secondly, this invention offers high flexibility and maintainability. When test requirements change, such as when a user modifies the target test dimension values, the system can automatically capture the changes and re-execute the parameter matching and test case generation process, outputting a new set of executable test cases within milliseconds. This avoids tedious manual configuration and approval processes, effectively enhancing the test plan's ability to respond quickly to changes in requirements and reducing maintenance costs. Attached Figure Description
[0019] Figure 1 This is a general flowchart of a method for automatically generating test case sets, provided in an embodiment of the present invention.
[0020] Figure 2 This is a schematic diagram of a device for automatically generating test case sets, provided in an embodiment of the present invention.
[0021] Figure 3 This is a schematic diagram of the parameter association model provided in an embodiment of the present invention.
[0022] Figure 4 The following is a flowchart illustrating a method for automatically generating test case sets for communication testing scenarios, as provided in an embodiment of the present invention. Detailed Implementation
[0023] To make the objectives, technical solutions, and advantages of the present invention clearer, the technical solutions of the present invention will be described in detail below with reference to the accompanying drawings. It should be noted that, unless otherwise specified, the embodiments and features described in these embodiments can be combined with each other.
[0024] In the testing of modern, complex communication radio frequency systems, test case generation is a fundamental and crucial task. However, existing technologies often face numerous challenges when dealing with test scenarios involving multidimensional and massive amounts of parameters. For example, in communication testing, a communication frequency band typically contains dozens to hundreds of specific frequency points. Testers need to manually select the required parameters from a lengthy list. This process is not only tedious and inefficient in parameter configuration, but also highly susceptible to human error leading to incorrect or missed selections, directly impacting test coverage and accuracy. Furthermore, once test requirements change, such as changing the test frequency band, testers must repeat the entire tedious manual configuration process, resulting in high change maintenance costs and failing to meet the rapid iteration requirements of agile development.
[0025] To address the aforementioned technical problems, this invention provides a novel automated technical solution. The core idea of this solution is to eliminate reliance on manual processing of micro-level parameters. Instead, it decouples and automatically maps high-level test requirements (such as "sampling tests on a specific frequency band") with low-level execution parameters (such as a specific list of frequency points) by pre-establishing a logically clear parameter association model. In this way, the system can automatically, quickly, and accurately derive all the test cases to be executed based on the macro-level test configuration information input by the user, thereby effectively improving test efficiency and quality.
[0026] In the description of this invention, several core terms will be used. Among them, "parameter association model" refers to a pre-built data structure or database for storing mapping relationships, which forms the basis of the automation logic of this invention. "Test dimension" refers to a parameterized category that can be selected during testing; for example, in communication testing, it could be the communication frequency band, channel bandwidth, etc. "Full parameter set" is the complete set of all legal parameters under a specific test dimension, without any filtering. "Test strategy" is a macro-level strategy used to guide how to select a test subset from the full set of parameters, such as full scan, sampling test, etc. The introduction of these terms aims to abstract specific and variable testing requirements into standardized logical concepts that can be processed by computer programs, which is a prerequisite for achieving automation.
[0027] like Figure 1 As shown in the figure, an embodiment of the present invention provides a method for automatically generating test case sets, characterized by comprising the following steps: Step S101: Establish the parameter association model. This parameter association model is the data foundation of this method, and its core lies in storing two key mapping relationships. The first is the first mapping relationship, which represents the correspondence between the test dimension and the full set of parameters under that test dimension. For example, this relationship explicitly defines which specific frequency points correspond to the test dimension value "Band 1". The second is the second mapping relationship, which represents the correspondence between the test strategy and the parameter selection rules. For example, this relationship defines what specific selection actions should be performed for the test strategy "sampling test". By pre-establishing and solidifying these mapping relationships, a stable and reliable basis is provided for subsequent automated queries and logical processing, avoiding hard coding or repeated definitions each time test cases are generated, and ensuring the consistency and maintainability of the rules.
[0028] Step S102: Receive test configuration information. The system receives test configuration information from testers or upstream automation systems via a user interface or other input interface. This information contains at least the key inputs corresponding to the above mapping relationships. Specifically, it includes at least: the target test dimension value corresponding to the first mapping relationship (e.g., the user-selected "Band 3"), and the target test strategy corresponding to the second mapping relationship (e.g., the user-selected "Full Scan"). This information together constitutes the original intent for generating test cases.
[0029] Step S103: Determine the complete parameter set. In this step, the system uses the target test dimension value received in the previous step as a query index and, with the help of the first mapping relationship stored in the parameter association model, finds and determines the complete parameter set corresponding to the target test dimension value. For example, when the received target test dimension value is "Frequency Band 3", the system will automatically query the first mapping relationship and extract a list of all legal, unfiltered frequency points under "Frequency Band 3". Through this step, the system automatically expands from a macroscopic dimension to all its subordinate microscopic parameters, effectively replacing the manual search and selection process, thereby avoiding omissions or errors that may be introduced.
[0030] Step S104: Generate a subset of target parameters. This step is the core of intelligent filtering. The system first uses the second mapping relationship in the parameter association model, based on the received target testing strategy, to obtain the parameter filtering rules corresponding to that strategy. After obtaining the rules, the system immediately applies them to the full set of parameters determined in the previous step. The processing may include filtering, elimination, and sampling operations, ultimately generating a smaller, more targeted subset of target parameters. This step transforms the abstract "testing strategy" into concrete "data processing actions," allowing testers to focus only on the strategy level without worrying about the underlying complex filtering logic, significantly reducing configuration complexity.
[0031] Step S105: Generate a set of executable test cases. After obtaining the subset of target parameters, the system combines each parameter in the subset with other parameters representing the test configuration information (e.g., target communication standard, test case name, etc.). This combination operation ultimately generates a set of executable test cases, each containing all the specific parameters required for execution, which can be directly parsed and run by the downstream test execution engine. Through this step, the final automated construction from the parameter list to executable test cases is completed, achieving end-to-end automated generation.
[0032] Based on the above method, the embodiments of the present invention can be applied to specific communication testing scenarios, thus demonstrating greater practicality. Specifically, in one embodiment, the testing dimension can be a communication frequency band, and the full parameter set is the full set of frequency points corresponding to that communication frequency band. This is a very typical application in the field of communication.
[0033] like Figure 4 As shown, in the specific execution process of communication testing services, this automatic generation method manifests as follows: First, the system receives configuration information such as test cases, communication standards, and frequency bands according to the application scenario; then, it parses the target frequency band parameters; next, it calls the predefined "frequency band-frequency mapping table"; and based on this mapping table, it retrieves and extracts the full set of frequency points under the frequency band; then, it performs logical verification in combination with test case attributes (such as full scan or sampling test); based on the result of the logical verification, it performs branch processing: if the full retention condition is met, all frequencies in the set are retained; if specific sampling or filtering conditions are met, frequencies that do not meet the conditions are filtered out; finally, the filtered frequency data is assembled into a test case set and the process ends.
[0034] To effectively manage these complex mapping relationships, the parameter association model can be specifically implemented as a structured database. For example... Figure 3 As shown, the structured database of this parameter association model can include a task layer, an environment layer, a parameter layer, and a constraint layer. The task layer stores the unique identifiers of test cases and their preset attributes; the environment layer stores the correspondence between communication standards and environmental parameters such as frequency bands; the parameter layer specifically implements the aforementioned first mapping relationship, storing the mapping between "frequency bands" and the full set of frequency points; and the constraint layer specifically implements the aforementioned second mapping relationship, defining how different test case attributes (i.e., test strategies) should filter the set of frequency points. This hierarchical structure makes the model logic clear, easy to extend and maintain; for example, when adding a new frequency band, only one record needs to be added to the parameter layer.
[0035] Furthermore, the method for determining the testing strategy can be more flexible. In a preferred embodiment, the testing strategy is determined by the preset attributes of the target test case. This means that when a tester selects a "target test case," the test case itself carries its testing strategy information. For example, when the preset attribute of a target test case is defined as "full scan," the system will parse it into the corresponding testing strategy. When executing step S104, the system will find the corresponding parameter filtering rule from the second mapping relationship based on the "full scan" testing strategy. Specifically, the rule is to retain all frequency points in the full frequency point set, so that the final generated target parameter subset is the same as the full parameter set. This design binds the testing strategy to the test case itself, conforms to the tester's thinking habits, and ensures the consistency of execution for specific testing purposes.
[0036] As another common testing scenario, full scanning is not the optimal choice when rapid regression or exploratory testing is required. Therefore, in another embodiment, when the preset attribute of the target test case is "sampling test," the system employs different parameter filtering rules. A specific and highly effective parameter filtering rule can be defined as: selecting the first, middle, and last frequency points from the full set of frequency points as subsets of the target parameters. For example, if the full set of frequency points corresponding to a frequency band contains 100 frequency points, this rule will automatically select the 1st, 50th, and 100th frequency points. This design allows the system to significantly reduce the number of test cases while ensuring that the test covers key boundary values (first and last) and the central region (middle position), thereby significantly shortening the test execution time.
[0037] In step S105, which generates the final executable test cases, the specific implementation of the "combination" operation is crucial to the completeness of the generated test cases. In one embodiment, the step of combining the parameters in the target parameter subset with other parameters representing the test configuration information is specifically implemented through Cartesian product combination. For example, if the target parameter subset (target frequency point subset) generated in step S104 is {f1, f2, f3}, and the other parameters in the current test configuration information also include the "target communication standard" set {GSM, LTE}, then the system will automatically perform a Cartesian product operation on these two sets to generate 6 combinations, namely (f1, GSM), (f1, LTE), (f2, GSM), (f2, LTE), (f3, GSM), (f3, LTE), and generate 6 independent executable test cases accordingly. By using Cartesian product combination, it can be ensured that all possible combinations between all selected parameter dimensions are covered, thereby achieving automated and comprehensive generation of test cases.
[0038] A significant advantage of this invention lies in its dynamic response capability. In actual testing, changes to test plans are very common. The method of this invention provides excellent support for this. When it receives changed test configuration information, such as a user changing the target frequency band from "Frequency Band 1" to "Frequency Band 3" on the test plan interface, the system can automatically capture this change event and use it as a trigger signal to automatically re-execute the steps of determining the full set of parameters (step S103), generating the subset of target parameters (step S104), and generating the set of executable test cases (step S105). The entire process requires no manual intervention, and because it is based on in-memory model logic operations, it can achieve millisecond-level recalculation and updating of the set of executable test cases. This design effectively improves the flexibility and iteration efficiency of test plans. Statistics show that compared to traditional manual modification methods, the efficiency of test plan generation and modification can be improved by more than 80%.
[0039] To implement the above method, embodiments of the present invention also provide an apparatus for automatically generating test case sets. For example... Figure 2 As shown, the device can be a standalone test management server or a functional unit integrated into an automated test platform. The device includes a storage module, a receiving module, and a processing module.
[0040] Specifically, the storage module stores the aforementioned parameter association model. This module can consist of one or more storage media such as hard disks, solid-state drives, and memory. Its core function is to persistently or semi-persistently save the first and second mapping relationships, providing data support for the processing module. The receiving module is responsible for interacting with the outside world. It can be a network interface, an API endpoint, or a graphical user interface backend logic. It receives test configuration information input by the user or external system and passes information including target test dimension values and target test strategies to the processing module.
[0041] The processing module is the core computing unit of the device and can be implemented by a central processing unit (CPU), graphics processing unit (GPU), field-programmable gate array (FPGA), or application-specific integrated circuit (ASIC). This processing module is configured to execute the core logic of the method of this invention: First, based on the target test dimension value passed from the receiving module and utilizing a first mapping relationship in the storage module, it determines the corresponding full set of parameters; next, based on the target test strategy, it obtains parameter filtering rules using a second mapping relationship and applies these rules to process the full set of parameters to generate a target parameter subset; finally, the processing module combines this target parameter subset with other parameters in the test configuration information to generate a final set of executable test cases, and outputs them to the test execution system or saves them as a file.
[0042] In a specific application scenario, this device is used for communication testing. In this case, the test dimension stored in the device's storage module is specifically the communication frequency band, and the full parameter set is the full set of frequency points. In the test configuration information received by the receiving module, the target test strategy is determined by the preset attributes of the target test cases selected by the user (such as "full scan" or "sampling test"). Upon receiving instructions such as "frequency band 5" and "sampling test," the processing module can quickly retrieve all frequency points of frequency band 5 from the storage module, then apply sampling rules (such as the first, middle, and last three-point method), and finally generate a set of executable test cases containing these three frequency points. The entire process is fully automated, accurate, and efficient.
[0043] This invention also provides a computer-readable storage medium storing a computer program thereon. When executed by a processor, the computer program can implement the method for automatically generating test case sets as described in any of the foregoing embodiments. The computer-readable storage medium can be any non-transitory medium capable of storing program code, such as read-only memory (ROM), random access memory (RAM), portable hard drive, USB flash drive, optical disc (such as CD, DVD, etc.), or server hard drive or memory. By executing the instructions stored on the medium, the processor can complete all or part of the steps, including establishing a parameter association model, receiving test configuration, determining the full set of parameters, generating a subset of target parameters, and combining them to generate a set of executable test cases, thereby achieving the technical effects brought about by this invention.
[0044] In summary, this invention, by constructing a parameter association model and defining a set of technical processes for automated parsing and generation based on the model, successfully solves the problems of cumbersome, inefficient, error-prone, and difficult-to-maintain test case generation processes in existing technologies. This invention not only achieves fully automated generation from macro-level requirements to micro-level test cases, ensuring the accuracy of the results, but also effectively enhances the flexibility and response speed of testing work by supporting dynamic changes, possessing high industrial application value. Those skilled in the art should understand that the above description is merely a preferred embodiment of this invention and is not intended to limit the invention. Any modifications, equivalent substitutions, improvements, etc., made within the spirit and principles of this invention should be included within the scope of protection of this invention.
Claims
1. A method for automatically generating test case sets, characterized in that, include: Establish a parameter association model, which stores: a first mapping relationship and a second mapping relationship; The first mapping relationship is used to characterize the correspondence between the test dimension and the full set of parameters under that test dimension; The second mapping relationship is used to characterize the correspondence between the test strategy and the parameter selection rules; Receive test configuration information for the target test case, the test configuration information including: target test dimension value corresponding to the first mapping relationship, target test strategy corresponding to the second mapping relationship, and other parameters; Based on the target test dimension value and using the first mapping relationship, determine the full set of parameters corresponding to the target test dimension value; Based on the target testing strategy and using the second mapping relationship, the corresponding parameter filtering rules are obtained; and the parameter filtering rules are applied to process the full set of parameters to generate a subset of target parameters. Each parameter in the target parameter subset is combined with the other parameters that characterize the test configuration information to generate a set of executable test cases.
2. The method according to claim 1, characterized in that, The test dimension is the communication frequency band, and the full parameter set is the full set of frequency points corresponding to the communication frequency band.
3. The method according to claim 2, characterized in that, The testing strategy is determined by the preset attributes of the target test cases.
4. The method according to claim 3, characterized in that, When the preset attribute of the target test case is sampling test, the parameter filtering rule is: select the first, middle and last frequency points from the full set of frequency points as the target parameter subset.
5. The method according to claim 3, characterized in that, When the preset attribute of the target test case is full scan, the parameter filtering rule is: retain all frequency points in the full frequency point set, so that the target parameter subset is the same as the full parameter set.
6. The method according to claim 1, characterized in that, The method further includes: when receiving changed test configuration information, automatically re-executing the steps of determining the full set of parameters, generating the target parameter subset, and generating the set of executable test cases.
7. The method according to claim 1, characterized in that, The step of combining each parameter in the target parameter subset with other parameters representing the test configuration information specifically includes: performing a Cartesian product combination on the target parameter subset and other parameters representing the test configuration information.
8. The method according to claim 1, characterized in that, The parameter association model is a structured database, which includes a task layer, an environment layer, a parameter layer, and a constraint layer.
9. A device for automatically generating test case sets, characterized in that, include: The storage module is used to store the parameter association model, which includes: a first mapping relationship for representing the correspondence between the test dimension and the full set of parameters under the test dimension, and a second mapping relationship for representing the correspondence between the test strategy and the parameter selection rules; The receiving module is used to receive test configuration information of the target test case, the test configuration information including: the target test dimension value corresponding to the first mapping relationship, the target test strategy corresponding to the second mapping relationship, and other parameters; The processing module is configured to: determine the full set of parameters corresponding to the target test dimension value based on the target test dimension value and using the first mapping relationship; Based on the target testing strategy and using the second mapping relationship, the corresponding parameter filtering rules are obtained, and the full set of parameters is processed by applying the parameter filtering rules to generate a target parameter subset; and each parameter in the target parameter subset is combined with the other parameters that characterize the test configuration information to generate a set of executable test cases.
10. A computer-readable storage medium having a computer program stored thereon, the program, when executed by a processor, implementing the method of claim 1.
