Analysis method for improving coverage rate of function test requirements

By establishing an inter-module parameter call matrix and a module constraint matrix, combining the test case library and use case selection network, outputting a collection of high-coverage test cases and performing parameter filling, the problems of insufficient coverage and inefficiency of traditional software are solved, and more efficient test case generation and automated testing are achieved.

CN120179564AActive Publication Date: 2025-06-20BEIJING NANTIAN SOFTWARE +1
View PDF 5 Cites 0 Cited by

Patent Information

Application Number
CN202510653120.X
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2025-05-21
Publication Date
2025-06-20
Estimated Expiration
2045-05-21

AI Technical Summary

Technical Problem

Traditional software testing relies on manual writing of test cases, making it difficult to fully cover software functional modules and their interactions, resulting in insufficient test coverage and inefficient efficiency.

Method used

By establishing an inter-module parameter call matrix and a module constraint matrix, combining the test case library and use case selection network, output a collection of high coverage test cases, and automatically fill the input parameters of the test case through the parameter fill strategy.

Benefits of technology

It improves the coverage of functional test requirements, reduces the workload of manually writing and screening test cases, and improves test execution efficiency and automation.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN120179564A_ABST
    Figure CN120179564A_ABST
Patent Text Reader

Abstract

The invention provides an analysis method for improving the coverage rate of function test requirements, and relates to the technical field of test case scheme generation, and the method comprises the steps: dividing to-be-tested target software into # imgabs0 # modules according to an executed function; establishing an inter-module parameter calling matrix # imgabs 1 # and a module constraint matrix # imgabs 2 #; obtaining a test case library, wherein objects stored in the test case library comprise a plurality of template test cases, a case calling matrix # imgabs3 # of the corresponding template test cases and serial numbers of the template test cases; based on the inter-module parameter calling matrix and the test case library, outputting a high-coverage test case set through the trained case selection network; and performing parameter filling on the high-coverage test case set according to the module constraint matrix. The method and the device have the advantage that the test case with higher coverage rate can be obtained in an easier-to-implement and efficient manner.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the technical field of test case scheme generation, and more specifically, to an analysis method for improving the coverage rate of functional test requirements. Background Art

[0002] In the field of software development, software testing is an important link to ensure that the software system meets the requirements specifications.

[0003] Traditional software testing usually relies on testers to write test cases based on experience. Since the design of test cases depends on manual experience, it is difficult to comprehensively cover all functional modules of the software and their interaction relationships, which easily leads to insufficient test coverage. It is also possible that some test cases may have limited test value for the software, or there may be a large degree of repetition between multiple test cases, resulting in a decrease in test efficiency. In some existing technologies, methods such as establishing an objective function and solving it through a neural network are selected to optimize the coverage of test cases. This technology is prone to form high-dimensional optimization problems, with complex gradient calculations during the training of the neural network, and problems such as slow convergence speed and consumption of a large amount of computing resources during the solution process. At the same time, in testing, only the testing of functional modules is often considered, ignoring the potential connections between functional modules.

[0004] Therefore, it is necessary to optimize the generation of software test cases and obtain test cases with higher coverage rates through more easily achievable and efficient methods. Summary of the Invention

[0005] The purpose of the present invention is to provide an analysis method for improving the coverage rate of functional test requirements, which can obtain test cases with higher coverage rates through more easily achievable and efficient methods.

[0006] The present invention is achieved through the following technical solutions: An analysis method for improving the coverage rate of functional test requirements, comprising the following steps: Dividing the target software to be tested into modules according to the functions to be executed; Establishing an inter-module parameter call matrix and a module constraint matrix , where the higher the element in the th row and th column of the inter-module parameter call matrix, the higher the data transmission requirement degree between the th module and the th module of the target software to be tested, and the module constraint matrix is used to describe the parameter constraint conditions of the module; Obtaining a test case library, where the objects stored in the test case library include multiple template test cases and the use case call matrix corresponding to the template test cases The number of the template test case, the element in the th row and th column of the use case call matrix is the number of data transmissions from the th module to the th module of the target under test when testing through this template test case; Based on the inter-module parameter call matrix and the test case library, output a set of high-coverage test cases through the trained use case selection network; Fill in the parameters for the high-coverage test case set according to the module constraint matrix.

[0007] Preferably, the method for establishing the inter-module parameter call matrix is as follows: Analyze the function call relationship between the th module and the th module of the target software under test, and obtain the th module and the th module, the number of types of data transmissions between them , ; Based on historical big data, obtain the data transmission frequency from the th module to the th module of the target software under test; Based on the number of types of data transmissions and the data transmission frequency, obtain the degree of data transmission demand between the th module and the th module of the target software under test ; Establish the inter-module parameter call matrix : , where represents the element in the th row and th column of the matrix , represents the element in the th row and th column of the matrix .

[0008] Preferably, the method for obtaining the data transmission frequency from the th module to the th module of the target software under test based on historical big data is as follows: Obtain multiple software of the same type as the target software under test as data extraction software, and divide each data extraction software into multiple modules according to the functions performed. The data extraction software satisfies the following conditions: ; : Among them, represents the set of modules of the target software to be tested, represents the set of modules of all data extraction software, and var(.) is a function for calculating variance. represents the number of occurrences of the th module in ; is a preset empirical threshold; Analyze the operation data of the data extraction software within a period of time, and respectively extract the data transmission times of the data extraction software. The data transmission times include the data transmission times from the th module to the th module corresponding to the target software to be tested ; The method for obtaining the data transmission frequency of the th module to the th module of the target software to be tested is as follows: Among them,

[0009] Among them, the data transmission times from the th module to the th module corresponding to the target software to be tested in the data transmission times.

[0010] Preferably, based on the number of types of data transmissions and the data transmission frequency, the method for obtaining the degree of data transmission requirement between the th module and the th module of the target software to be tested is as follows: Among them, ; ; Among them, is an intermediate parameter, and e is the natural constant.

[0011] Preferably, the use case selection network includes: An input layer for inputting the inter-module parameter call matrix and the test case library; A first feature extraction layer for performing feature extraction based on the inter-module parameter call matrix and the test case library to obtain first feature data; A first output layer for outputting the number of template test cases to be selected according to the first feature data; A second feature extraction layer for performing feature extraction based on the output of the first output layer, the inter-module parameter call matrix, and the test case library to obtain second feature data; The second output layer is used to output the numbers of the template test cases to be selected according to the second feature data.

[0012] Preferably, the method for extracting the first feature data based on the inter-module parameter call matrix and the test case library is as follows: Obtain the first feature norm vector : ; ; Among them, is the feature norm of the template test case numbered , is the case call matrix of the template test case numbered , , is to calculate the two-norm of the matrix, is the total number of template test cases; Obtain the first coverage rate vector : ; ; Among them, represents the coverage rate of the module of the software under test by the template test case numbered , represents the number of calls to the module of the software under test by the template test case numbered when testing; Obtain the first feature data : ; Among them, is to calculate the matrix transpose, is point division; The method for outputting the number of template test cases to be selected according to the first feature data is as follows: ; Among them, is the number of template test cases to be selected, e is the natural constant, and are the first training weight and the first training bias respectively.

[0013] Preferably, the method for obtaining the second feature data is as follows: Obtain the second feature norm vector : ; ; Among them, is the combined feature norm of the template test cases numbered and ; is the case call matrix of the template test case numbered ; , is to find the two-norm of the matrix, is the total number of template test cases; Obtain the second coverage rate vector : ; ; Among them, represents the coverage rate of the module of the software under test by the template test cases numbered and when testing, represents the number of calls of the module of the software under test by the template test cases numbered and when testing; Obtain the second feature data : ; ; Among them, represents the combined scoring parameter of the template test cases numbered and , where e is the natural constant.

[0014] Preferably, the method for outputting the numbers of the template test cases to be selected according to the second feature data is: Obtain the probability score of the combination of the template test cases numbered and : : ; Among them, is the second training bias, represents the combined scoring parameter of the template test cases numbered and ; Sort all the obtained in descending order to form a preferred selection sequence. The number of template test cases to be selected is , and select the first Put all the template test cases involved in a probability score into the high-coverage test case set, where g is an integer; Obtain the module of the target software to be tested called by the template test case in the high-coverage test case set during testing, and determine whether all modules of the target software to be tested are called. If so, put all the template test cases involved in the probability scores from the to the into the high-coverage test case set. Otherwise, obtain the un-called modules, start traversing the priority selection sequence from the element. If the template test case involved in the currently traversed probability score will call the un-called module during testing, put the corresponding template test case into the high-coverage test case set. Stop traversing when the number of template test cases in the high-coverage test case set reaches

[0015] Preferably, when training the use case selection network, the loss function to be minimized is: ; where is the use case call matrix of the th template test case in the high-coverage test case set, is to find the two-norm of the matrix, is the total number of template test cases in the high-coverage test case set, is the number of modules of the target software to be tested called by all template test cases in the high-coverage test case set during testing.

[0016] Preferably, the method for filling parameters for the high-coverage test case set according to the module constraint matrix is: The module constraint matrix is matrix, where the th element is used to store the parameter constraint of the th module, and the matrix element corresponding to the module without parameter constraint is an empty set; Read the elements in the module constraint matrix in sequence and perform the following operations: Obtain the parameter constraint of the th module, and set multiple test values for each parameter according to the parameter constraint. The test values include critical values, values around the critical values, and safety values. The safety value is a value that meets the parameter constraint and is at a distance greater than the threshold from the critical value; Obtain all the calls to the ​For the template test cases of a module, if the number of the template test cases called for the th module is equal to the number of test values, then the test values are allocated to the template test cases one by one. If the number of the template test cases called for the th module is greater than the number of test values, then the test values are allocated to the template test cases one to many and each test value is allocated at least once. If the number of the template test cases called for the th module is less than the number of test values, then multiple tests are performed to ensure that each test value is allocated at least once.

[0017] The technical solution of the present invention has at least the following advantages and beneficial effects: The present invention quantifies the data interaction requirements between the modules of the software through the parameter call matrix and use case call matrix between modules, can consider the coverage of the data transmission path, ensures that the selected test cases can fully cover the data transmission relationship inside the software, and helps to improve the coverage rate of test cases; When selecting use cases subsequently, the present invention improves the module coverage rate and data transmission path coverage rate in advance, and further improves the coverage rate of functional test requirements; The present invention establishes a template test case library, automatically selects high-coverage test cases through a model, reduces the workload of manually writing and screening test cases, improves the test execution efficiency, and automatically fills the input parameters of test cases through a parameter filling strategy, reduces human intervention, and improves the automation degree, flexibility and diversity of testing; When automatically selecting high-coverage test cases through a model, the present invention divides the decision of the model into two parts: quantity decision and specific use case combination decision, which helps to reduce the computational complexity, thereby improving the efficiency of model training and reasoning, and also improving the generalization ability of the decision given by the model; The present invention is reasonably designed, has high reliability, computational efficiency and computing power cost performance, wide applicability, and is convenient for popularization and implementation. Brief Description of the Drawings

[0018] Figure 1 is a schematic flow chart of an analysis method for improving the coverage rate of functional test requirements provided by Embodiment 1 of the present invention; Figure 2 is a schematic structural diagram of a use case selection network provided by Embodiment 1 of the present invention. Detailed Embodiment

[0019] To make the objectives, technical solutions, and advantages of the embodiments of the present invention clearer, the technical solutions in the embodiments of the present invention will be clearly and completely described below with reference to the accompanying drawings in the embodiments of the present invention. Obviously, the described embodiments are some, but not all, of the embodiments of the present invention. Components of the embodiments of the present invention described and shown in the drawings here can be arranged and designed in various different configurations.

[0020] Embodiment 1 This embodiment provides an analysis method for improving the coverage rate of functional test requirements. Refer to Figure 1 , which includes the following steps: Divide the target software to be tested into modules according to the functions to be executed; Establish an inter-module parameter call matrix and an inter-module constraint matrix . The higher the element in the th row and th column of the inter-module parameter call matrix, the higher the degree of data transmission requirement between the rd module and the th module of the target software to be tested. The inter-module constraint matrix is used to describe the parameter constraint conditions of the modules; Obtain a test case library. The objects stored in the test case library include multiple template test cases, the use case call matrix corresponding to the template test cases and the numbers of the template test cases. The element in the th row and th column of the use case call matrix is the number of data transmissions between the rd module and the th module of the target to be tested when testing through this template test case; Based on the inter-module parameter call matrix and the test case library, output a high-coverage test case set through a trained use case selection network; Fill in the parameters of the high-coverage test case set according to the inter-module constraint matrix.

[0021] In this embodiment, first, according to the different functions executed by the software, the target software to be tested is split into N modules, so as to more accurately analyze the data interaction relationships between the modules. By establishing a parameter call matrix between the modules to quantify the data transmission requirements between the modules, the data transmission requirements of each template test case can be described through the case call matrix established for each template test case. Then, based on these two matrices, a set of high-coverage test cases can be output through the trained case selection network. The case selection network can extract the coverage rate of the modules and the coverage rate characteristics of the data input paths in the logical flow of the template test cases based on these two matrices. Compared with the traditional situation of only considering whether the software function test is complete, it has stronger comprehensiveness and coverage, covering both the surface module functions of the software and the potential logical connections between the modules, greatly improving the test coverage rate and reliability. Finally, the template test cases in the set of high-coverage test cases are filled with parameters through the module constraint matrix reflecting parameter constraints to achieve a more comprehensive test. This embodiment can systematically improve the test coverage rate, reduce manual intervention, and improve the test efficiency and intelligent level.

[0022] It should be particularly noted that when obtaining the test case library, methods such as K-Means can be relied on to cluster the test cases, and the template test cases that can represent different test scenarios are separately selected for storage to reduce calculation and storage redundancy. High-coverage and low-cost template test cases can also be preferentially selected. Specifically, when establishing, a batch of basic cases can be selected based on historical test data as the initial test case library, and then optimized later. For example, analyze the newly added test data and determine whether to add it based on whether it contributes to the test coverage rate. When some cases in the test case library fail to provide new coverage value in the tests of multiple versions, they can be removed to reduce storage and calculation costs.

[0023] In this embodiment, the method for establishing the parameter call matrix between the modules is as follows: Parse the function call relationship between the th module and the th module of the target software to be tested, and obtain the number of types of data transmission between the th module and the th module , ; Based on historical big data, obtain the data transmission frequency between the th module and the th module of the target software to be tested; Based on the number of types of data transmission and the data transmission frequency, obtain the degree of data transmission requirements between the th module and the th module of the target software to be tested ; Establish the parameter call matrix between the modules : , where represents the element in the th row and th column of the matrix . represents the element in the th row and th column of the matrix .

[0024] Furthermore, the method for obtaining the data transmission frequency of the th module to the th module of the software to be tested based on historical big data is as follows: Obtain multiple software of the same type as the software to be tested as data extraction software, and divide each data extraction software into multiple modules according to the functions performed. The data extraction software meets the following conditions: ; : where represents the set of modules of the software to be tested, represents the set of modules of all data extraction software, var(.) is the function for calculating variance, represents the number of occurrences of the th module in , is a preset empirical threshold; Analyze the operation data of the data extraction software within a period of time, and respectively extract the data transmission times of the data extraction software. The data transmission times include the data transmission times of the th module to the th module corresponding to the software to be tested ; The method for obtaining the data transmission frequency of the th module to the th module of the software to be tested is as follows: :

[0025] where the data transmission times of the th module to the th module corresponding to the software to be tested.

[0026] On this basis, the method for obtaining the data transmission requirement degree between the th module and the th module of the target software to be tested based on the number of types of data transmission and the frequency of data transmission is as follows: : ; ; where is an intermediate parameter, and e is the natural constant.

[0027] In the above solution, the element size in the inter-module parameter call matrix is jointly determined by the number of types of data transmission and the frequency of data transmission. The larger the number of types of data transmission and the higher the frequency of data transmission between the th module and the th module, the larger the value of the element in the th row and

[0028] th column of the inter-module parameter call matrix. Considering only the data transmission frequency may lead to too high weights for some high-frequency but low-complexity calls, while considering only the data types may ignore some key high-frequency interactions. Combining the number of data transmission types and the data transmission frequency can more comprehensively characterize the strength of the interaction between modules, making the inter-module parameter call matrix more truly reflect the data flow relationship inside the software. The inter-module parameter call matrix is used as a matrix for subsequent feature extraction. If the data transmission requirement degree value between two modules is relatively high, it means that the data transmission between these two modules is relatively critical. If the test case fails to cover this path, it may lead to test blind spots. Therefore, through this matrix, the data characteristics can be simply and intuitively reflected, facilitating more reliable feature extraction by the subsequent model. Specifically, when obtaining the data transmission frequency from the th module to the th module of the target software to be tested based on historical big data, by introducing historical big data and extracting data from multiple software of the same type as the target software to be tested, it helps to improve the reliability of the statistical data, avoid the limitations of the data of a single software, and also uses variance constraint conditions to ensure that the module distribution of the selected software is similar to that of the target software to be tested, thereby improving the accuracy of the data transmission frequency statistics. can reflect the ratio of the number of data transmission times from the th module to the th module to the total number of data transmission times between all modules. Finally, is normalized, and combined with the number of types of data transmission The degree of data transfer requirement between the th module and the th module The discrimination brought by the value after enhanced normalization through the exponential function can be used. value.

[0029] In the following steps, refer to Figure 2 , the use case selection network includes: An input layer for inputting the parameter call matrix between modules and the test case library; A first feature extraction layer for performing feature extraction based on the parameter call matrix between modules and the test case library to obtain first feature data; A first output layer for outputting the number of template test cases to be selected according to the first feature data; A second feature extraction layer for performing feature extraction based on the output of the first output layer, the parameter call matrix between modules and the test case library to obtain second feature data; A second output layer for outputting the numbers of the template test cases to be selected according to the second feature data.

[0030] In this embodiment, the decision-making of the model is mainly divided into two parts: quantity decision-making (selecting how many template test cases) and specific use case combination decision-making (selecting specific use case combinations from the test case library). Because if the model directly searches for the optimal solution among all possible use case combinations, the search space will increase exponentially with the number of test cases, resulting in excessive consumption of computing resources and slow training convergence. This embodiment optimizes the operation consumption and improves the computing efficiency.

[0031] As a preferred solution, the method for performing feature extraction based on the parameter call matrix between modules and the test case library to obtain the first feature data is: Obtain the first feature norm vector : ; ; where is the feature norm of the template test case numbered , is the use case call matrix of the template test case numbered , , is to find the two-norm of the matrix, is the total number of template test cases; Obtain the first coverage rate vector : ; ; Among them, represents that the template test case numbered is used to test the coverage rate of the module of the software under test for the target software during testing, represents that the template test case numbered is used to test the number of calls to the module of the software under test for the target software during testing; Obtain the first feature data : ; Among them, is to find the matrix transpose, is point division; The method for outputting the number of template test cases to be selected according to the first feature data is: ; Among them, is the number of template test cases to be selected, e is the natural constant, and are the first training weight and the first training bias respectively.

[0032] The first feature norm vector helps to calculate the difference degree between the data transfer matrix between modules of the software under test and the case call matrix of the template test case, and facilitates quantifying the adaptation degree of the test case to the data transfer path of the target software. The first feature data then integrates the adaptation degree in terms of the data transfer path and the coverage rate of the module, the smaller the value of the better the data transfer coverage, while the larger the value of the better the module coverage. The larger the numerical value of the first feature data and combined indicates that the overall coverage rate of the software under test in the test case library is better. Therefore, the number of template test cases required can be reduced, that is,

[0033] On the other hand, the method for obtaining the second feature data is: Obtain the second feature norm vector : ; ; Among them, is numbered and Combined feature norm of the template test cases is the use case call matrix of the template test cases numbered ; , is to calculate the two-norm of the matrix, is the total number of template test cases; Obtain the second coverage rate vector : ; ; wherein, represents the coverage rate of the module of the software under test by the template test cases numbered and when used for testing, represents the number of calls of the module of the software under test by the template test cases numbered and when used for testing; Obtain the second feature data : ; ; wherein, represents the combined scoring parameter of the template test cases numbered and , and e is the natural constant.

[0034] Furthermore, the method for outputting the numbers of the template test cases to be selected according to the second feature data is as follows: Obtain the probability score of the combination of the template test cases numbered and : : ; wherein, is the second training bias, represents the combined scoring parameter of the template test cases numbered and ; Sort all the obtained in descending order to form a preferred selection sequence. The number of template test cases to be selected is . Select the first probability scores involved in the preferred selection sequence and put all the template test cases into the high-coverage test case set, where g is an integer; Obtain the module of the target software under test that is called when the template test cases in the high-coverage test case set are used for testing, and determine whether all modules of the target software under test are called. If so, put all the template test cases involved in the probability scores from the to the into the high-coverage test case set. Otherwise, obtain the un-called modules, and start traversing the priority selection sequence from the th element in order. If the template test case involved in the currently traversed probability score will call the un-called module during testing, put the corresponding template test case into the high-coverage test case set. When the number of template test cases in the high-coverage test case set reaches then stop traversing.

[0035] In this embodiment, when obtaining the template test cases to be selected and extracting features, feature extraction is performed based on the test case combinations formed by every two template test cases, which can utilize the combinations of different template test cases to improve the feature capture ability of the combined coverage rate of the software modules under test. The second feature norm vector reflects the coverage of data transmission by the test case combination, while reflects the coverage of the module by the test case combination. For a group of test case combinations, the smaller the corresponding value in and the larger the corresponding value in , the better the coverage of this combination, and thus a higher probability score will be obtained. The probability score

[0036] has been normalized so that its value can better reflect the global features, and the model output can be optimized by adjusting the second training bias. And only selecting all the template test cases involved in the probability scores after outputting the probability scores provides a certain tolerance for the coverage comprehensiveness of the module, that is, the coverage rate can be strengthened by traversing subsequently. As a preferred solution,

[0037] When training the test case selection network, the loss function to be minimized is: ; where is the use case call matrix of the th template test case in the high-coverage test case set, is to find the second norm of the matrix, is the total number of template test cases in the high-coverage test case set, It is the number of modules of the target software under test called by all template test cases in the high-coverage test case set during the test.

[0038] It can be seen that the optimization goal is to improve the module coverage rate and the test data transmission path coverage rate of the test.

[0039] Finally, the method for filling parameters for the high-coverage test case set according to the module constraint matrix is as follows: The module constraint matrix is a matrix, where the th element is used to store the parameter constraints of the th module, and the matrix elements corresponding to the modules without parameter constraints are empty sets; Read the elements in the module constraint matrix sequentially and perform the following operations: Obtain the parameter constraints of the th module, and set multiple test values for each parameter according to the parameter constraints. The test values include critical values, values around the critical values, and safety values. The safety value is a value that conforms to the parameter constraints and is at a distance greater than the threshold from the critical value; Obtain all the template test cases that call the th module in the high-coverage test case set. If the number of the template test cases that call the th module is equal to the number of test values, then perform a one-to-one assignment of the test values to the template test cases. If the number of the template test cases that call the th module is greater than the number of test values, then perform a one-to-many assignment of the test values to the template test cases and ensure that each test value is assigned at least once. If the number of the template test cases that call the th module is less than the number of test values, then ensure that each test value is assigned at least once through multiple tests.

[0040] Through the parameter filling scheme designed above, it is ensured that all constrained parameters can be fully covered during the test, and the comprehensiveness of the test is improved by setting critical values, values around the critical values, and safety values. Among them, the critical value is used for extreme condition testing to check the boundary behavior of the system; the values around the critical value are used to discover abnormal situations when approaching the boundary, and their values can exceed the constraint range or be within the constraint range; the safety value is responsible for verifying the normal working range.

[0041] When performing the assignment: Number of test cases = Number of test values: One-to-one assignment to ensure that each test value is accurately tested.

[0042] The number of test cases > the number of test values: one-to-many allocation, ensuring that all test values are used at least once to improve the anomaly detection ability.

[0043] The number of test cases < the number of test values: multiple rounds of testing, and ensure that all test values are executed at least once to avoid missing key test points.

[0044] In summary, this embodiment provides an efficient, flexible, and comprehensive test case generation scheme, which can improve the test coverage while reducing the computational burden.

[0045] The above are only the preferred embodiments of the present invention and are not intended to limit the present invention. For those skilled in the art, the present invention can have various changes and modifications. Any modification, equivalent replacement, improvement, etc. made within the spirit and principle of the present invention shall be included in the protection scope of the present invention.

Claims

1. An analysis method for improving functional test requirement coverage, characterized in that: The following steps are involved: The target software to be tested is divided into modules; Establishing inter-module parameter call matrix and the module constraint matrix , the first Line The higher the column element, the higher the number of Modules to The higher the degree of data transmission requirement between modules, the module constraint matrix is ​​used to describe the parameter constraints of the modules; Get the test case library, which stores objects including multiple template test cases and the case call matrix of the corresponding template test cases and the template test case number, the number of the test case call matrix Line The column elements are the first elements of the target to be tested when testing through the template test case. Modules to Number of data transmissions per module; Based on the inter-module parameter call matrix and test case library, the trained test case selection network outputs a high-coverage test case set; Fill parameters for a collection of high-coverage test cases based on the module constraint matrix.

2. The method for analyzing the functional test requirements according to claim 1, characterized in that: The method for establishing the inter-module parameter call matrix is: Analyze the target software to be tested modules and The function call relationship between modules is obtained. modules and The number of types of data transfer between modules , ; Obtain the first Modules to The data transmission frequency of each module; The first step of obtaining the target software to be tested based on the number of the data transmission types and the data transmission frequency modules and The degree of data transmission demand between modules ; Establish the inter-module parameter call matrix : ,in Representative Matrix No. Line Column elements, Representative Matrix No. Line Column elements.

3. The method for analyzing the functional test requirements according to claim 2, characterized in that: The method of obtaining the target software to be tested based on historical big data Modules to The method for changing the data transmission frequency of each module is as follows: Obtain multiple software of the same type as the target software to be tested as data extraction software, and divide each data extraction software into multiple modules according to the functions performed. The data extraction software meets the following conditions: ; : in, A collection of modules representing the target software to be tested, represents the set of modules of all data extraction software, var(.) is the function for finding variance, represent Middle Modules in The number of occurrences in is the preset experience threshold; Analyze the running data of the data extraction software in a time period, and extract the data transmission times of the data extraction software respectively, the data transmission times include the first Modules to Number of data transfers per module ; Get the target software to be tested Modules to Data transmission frequency per module The method is: in, The number of data transmissions corresponding to the target software under test Modules to The number of data transmissions per module.

4. The analysis method for improving functional test requirement coverage according to claim 3, characterized in that: The first step of obtaining the target software to be tested based on the number of the data transmission types and the data transmission frequency modules and The degree of data transmission demand between modules The method is: ; ; in, is an intermediate parameter and e is a natural constant.

5. The analysis method for improving functional test requirement coverage according to claim 1, characterized in that: The use case selection network includes: An input layer, used for inputting the inter-module parameter call matrix and the test case library; A first feature extraction layer, used for performing feature extraction based on the inter-module parameter call matrix and the test case library to obtain first feature data; A first output layer, used for outputting the number of template test cases to be selected according to the first feature data; A second feature extraction layer is used to extract features based on the output of the first output layer, the inter-module parameter call matrix and the test case library to obtain second feature data; The second output layer is used to output the number of the template test case to be selected according to the second characteristic data.

6. The analysis method for improving functional test requirement coverage according to claim 5, characterized in that: The method for extracting features based on the inter-module parameter call matrix and the test case library to obtain the first feature data is: Get the first eigennorm vector : ; ; in, For the number The characteristic norm of the template test case, For the number The use case call matrix of the template test case , To find the bi-norm of a matrix, is the total number of template test cases; Get the first coverage vector : ; ; in, Representative number is The template test case is used to test the coverage of the modules of the target software to be tested. Representative number is The number of calls to the module of the target software to be tested when the template test case is used for testing; Obtain the first characteristic data : ; in, To find the matrix transpose, for point division; The method for outputting the number of template test cases to be selected according to the first feature data is: ; in, is the number of template test cases that need to be selected, e is a natural constant, and are the first training weight and the first training bias respectively.

7. The analysis method for improving functional test requirement coverage according to claim 5, characterized in that: The method for obtaining the second characteristic data is: Get the second eigennorm vector : ; ; in, For the number and The combined feature norm of the template test case, For the number The use case call matrix of the template test case , To find the bi-norm of a matrix, is the total number of template test cases; Get the second coverage vector : ; ; in, Representative number is and The template test case is used to test the coverage of the modules of the target software to be tested. Representative number is and The number of calls to the module of the target software to be tested when the template test case is used for testing; Get the second feature data : ; ; in, Representative number is and The combined scoring parameter of the template test case, e is a natural constant.

8. The analysis method for improving functional test requirement coverage according to claim 7, characterized in that: The method for outputting the number of the template test case to be selected according to the second characteristic data is: Get the number and Probability score of the combination of template test cases : ; in, is the second training bias, Representative number is and The combined scoring parameters of the template test case; All the acquired Sort by size to form a priority selection sequence. The number of template test cases that need to be selected is , select the first one in the priority sequence All template test cases involved in the probability score are put into the high coverage test case set, and g is an integer; Obtain the template test case in the high coverage test case set for the module of the target software to be tested called during the test, and determine whether all modules of the target software to be tested are called. If so, the first module in the sequence is preferentially selected. To All template test cases involved in the probability score are put into the high coverage test case set, otherwise the uncalled modules are obtained and the test cases are elements to start traversing the priority selection sequence. If the template test case involved in the currently traversed probability score will call an uncalled module in the test, the corresponding template test case will be put into the high coverage test case set. When the number of template test cases in the high coverage test case set reaches Stop traversal.

9. The analysis method for improving functional test requirement coverage according to claim 5, characterized in that: The loss function to be minimized when training the network selected for the use case for: ; in, The first in the high coverage test case set The use case call matrix of the template test case, To find the bi-norm of a matrix, is the total number of template test cases in the high coverage test case set, The number of modules of the target software to be tested that are called during testing by all template test cases in the high-coverage test case set.

10. The analysis method for improving functional test requirement coverage according to claim 1, characterized in that: The method for filling parameters for a collection of high-coverage test cases according to the module constraint matrix is: The module constraint matrix for Matrix, where The element is used to store the The parameter constraints of each module. The matrix elements corresponding to the modules without parameter constraints are empty sets. Read the module constraint matrix in turn and do the following: Get the Parameter constraints of each module, and multiple test values ​​are set for each parameter according to the parameter constraints, wherein the test values ​​include critical values, values ​​around the critical values, and safety values, and the safety values ​​are values ​​that meet the parameter constraints and are greater than a threshold value from the critical value; Get all calls in the high coverage test case set The template test case of the module, if the first If the number of template test cases in a module is equal to the number of test values, the test values ​​are assigned to the template test cases one-to-one. If the number of template test cases in a module is greater than the number of test values, the test values ​​are assigned to the template test cases one-to-many and each test value is assigned at least once. If the number of template test cases for a module is less than the number of test values, multiple tests are performed to ensure that each test value is assigned at least once.

Citation Information

Patent Citations

  • Method and system for optimizing software test case

    CN103810104A

  • Case execution method and device, electronic equipment and computer readable storage medium

    CN114168472A

  • Software operation test analysis method and system

    CN118503115A

  • Software testing method, system and device based on AIGC model

    CN119003375A

  • Chip test case generation method and apparatus, and storage medium

    WO2023125821A1