An analysis method for improving the coverage rate of functional test requirements

By establishing the inter-module parameter call matrix and constraint matrix, selecting the network in combination with the use cases, and automatically selecting high-coverage test cases, the problem of insufficient test coverage of traditional software is solved, and more efficient and comprehensive test coverage is achieved.

CN120179564BActive Publication Date: 2025-08-05BEIJING NANTIAN SOFTWARE +1
View PDF 2 Cites 0 Cited by

Patent Information

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

AI Technical Summary

Technical Problem

Traditional software testing relies on manual experience to design test cases, resulting in insufficient coverage, and existing neural network optimization methods are complex and resource-consuming, ignoring the potential connections between functional modules.

Method used

By establishing an inter-module parameter call matrix and a module constraint matrix, selecting a network based on the trained use cases, outputting a collection of high-coverage test cases, and filling the parameters, automatically selecting high-coverage test cases to reduce manual intervention.

Benefits of technology

It improves the coverage of test cases, improves the testing efficiency and automation level, reduces the computational complexity, and enhances the generalization ability and applicability of the model.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN120179564B_ABST
    Figure CN120179564B_ABST
Patent Text Reader

Abstract

The present invention provides an analysis method for improving functional test requirement coverage, relating to the technical field of test case solution generation, comprising: dividing target software to be tested into #imgabs0# modules according to the functions executed; establishing an inter-module parameter call matrix #imgabs1# and a module constraint matrix #imgabs2#; obtaining a test case library, wherein the test case library stores objects including multiple template test cases, corresponding template test case case call matrices #imgabs3#, and template test case numbers; based on the inter-module parameter call matrix and the test case library, outputting a high-coverage test case set through a trained case selection network; and performing parameter filling on the high-coverage test case set according to the module constraint matrix. The present invention has the advantage of being able to obtain test cases with higher coverage in a more easily achievable 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 solution generation, and in particular to an analysis method for improving functional test requirement coverage. Background Art

[0002] In the field of software development, software testing is an important step in ensuring that the software system meets the required specifications.

[0003] Traditional software testing typically relies on testers writing test cases based on their experience. Because test case design relies on manual experience, it's difficult to fully cover all software functional modules and their interactions, which can easily lead to insufficient test coverage. It's also possible that some test cases may have limited testing value for the software, or that there's significant duplication between multiple test cases, resulting in reduced testing efficiency. Some existing technologies optimize test case coverage by establishing objective functions and solving them through neural networks. This technique easily creates a high-dimensional optimization problem, resulting in complex gradient calculations when training neural networks and the resulting solution can lead to slow convergence and significant consumption of computing resources. Furthermore, testing often focuses solely on testing functional modules, ignoring the potential connections between them.

[0004] Therefore, it is necessary to optimize the generation of software test cases and obtain test cases with higher coverage in a more easily implemented and efficient way. Summary of the Invention

[0005] The object of the present invention is to provide an analysis method for improving the coverage of functional test requirements, which can obtain test cases with higher coverage in a more easily achievable and efficient manner.

[0006] The present invention is achieved through the following technical solutions:

[0007] An analysis method for improving functional test requirement coverage includes the following steps:

[0008] The target software to be tested is divided into modules;

[0009] Establish inter-module parameter call matrix and the module constraint matrix , the first of the inter-module parameter call matrix Rank The higher the column element is, the higher the 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;

[0010] Get the test case library, which stores multiple template test cases and the corresponding template test case call matrix. and the template test case number, the first Rank The column element is the first column of the target to be tested when testing through the template test case. Modules to Number of data transmissions per module;

[0011] 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;

[0012] Fill parameters for the high-coverage test case collection according to the module constraint matrix.

[0013] Preferably, the method for establishing the inter-module parameter call matrix is:

[0014] 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 transmission between modules , ;

[0015] Obtain the target software to be tested based on historical big data Modules to The data transmission frequency of each module;

[0016] 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 ;

[0017] Establish the inter-module parameter call matrix : ,in Representative Matrix No. Rank Column elements, Representative Matrix No. Rank Column element.

[0018] Preferably, 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:

[0019] 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:

[0020] ;

[0021] :

[0022] 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;

[0023] 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 transmissions per module ;

[0024] Get the target software to be tested Modules to Data transmission frequency of each module The method is:

[0025]

[0026] in, The number of data transmissions corresponding to the target software under test Modules to The number of data transmissions per module.

[0027] Preferably, the first data transmission type of the target software to be tested is obtained 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:

[0028] ;

[0029] ;

[0030] in, is an intermediate parameter and e is a natural constant.

[0031] Preferably, the use case selection network includes:

[0032] An input layer, used for inputting the inter-module parameter call matrix and the test case library;

[0033] A first feature extraction layer, configured to extract features based on the inter-module parameter call matrix and the test case library to obtain first feature data;

[0034] The first output layer is used to output the number of template test cases to be selected according to the first feature data;

[0035] 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;

[0036] The second output layer is used to output the number of the template test case to be selected according to the second feature data.

[0037] Preferably, 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:

[0038] Get the first eigennorm vector :

[0039] ;

[0040] ;

[0041] 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;

[0042] Get the first coverage vector :

[0043] ;

[0044] ;

[0045] in, Representative number is The template test case is used to test the coverage of the module 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;

[0046] Obtain the first feature data :

[0047] ;

[0048] in, To find the matrix transpose, for point division;

[0049] The method for outputting the number of template test cases to be selected according to the first feature data is:

[0050] ;

[0051] 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.

[0052] Preferably, the method for obtaining the second characteristic data is:

[0053] Get the second eigennorm vector :

[0054] ;

[0055] ;

[0056] 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;

[0057] Get the second coverage vector :

[0058] ;

[0059] ;

[0060] in, Representative number is and The template test case is used to test the coverage of the module 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;

[0061] Get the second feature data :

[0062] ;

[0063] ;

[0064] in, Representative number is and The combined scoring parameter of the template test case, e is a natural constant.

[0065] Preferably, the method of outputting the number of the template test case to be selected according to the second characteristic data is:

[0066] Get the number and Probability score of the combination of template test cases :

[0067] ;

[0068] in, is the second training bias, Representative number is and The combined scoring parameters of the template test case;

[0069] All the Sort by large to small to form a priority selection sequence. The number of template test cases that need to be selected is , select the first All template test cases involved in the probability score are put into the high coverage test case set, g is an integer;

[0070] Get 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 have been called. If so, the first module in the sequence will be selected first. 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 tested in order from the first Elements are traversed to start the priority selection sequence. If the template test case involved in the current traversal 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 Then stop traversal.

[0071] Preferably, when training the use case selection network, the loss function to be minimized is for:

[0072] ;

[0073] 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 by all template test cases in the high-coverage test case set.

[0074] Preferably, the method for filling parameters for the high coverage test case collection according to the module constraint matrix is:

[0075] 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;

[0076] Read the module constraint matrix in sequence and do the following:

[0077] Get the Parameter constraints of each module, and setting 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 values are values that meet the parameter constraints and are farther from the critical values than a threshold value.

[0078] Get all calls in the high coverage test case set The template test case of the module, if the 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 in a one-to-many manner 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 allocated at least once.

[0079] The technical solution of the present invention has at least the following advantages and beneficial effects:

[0080] The present invention quantifies the data interaction requirements between modules of the software through the inter-module parameter call matrix and the use case call matrix, can consider the coverage of the data transmission path, ensure that the selected test cases can fully cover the data transmission relationship within the software, and help improve the coverage rate of test cases;

[0081] The present invention simultaneously advances module coverage and data transmission path coverage when performing subsequent use case selection, further improving functional test requirement coverage;

[0082] The present invention establishes a template test case library, automatically selects high-coverage test cases through the model, reduces the workload of manual writing and screening test cases, improves test execution efficiency, and automatically fills in the input parameters of test cases through parameter filling strategies, reduces human intervention, and improves the automation level, flexibility and diversity of testing;

[0083] When automatically selecting high-coverage test cases through the model, the present invention divides the model's decision into two parts: quantity decision and specific case combination decision. This helps to reduce the computational complexity, thereby improving the efficiency of model training and reasoning, and also improves the generalization ability of the model's decision-making.

[0084] The present invention has reasonable design, high reliability, computing efficiency and cost-effectiveness, wide applicability, and is easy to promote and implement. BRIEF DESCRIPTION OF THE DRAWINGS

[0085] Figure 1 A schematic flow chart of an analysis method for improving functional test requirement coverage provided in Example 1 of the present invention;

[0086] Figure 2 A schematic diagram of the structure of the use case selection network provided in Example 1 of the present invention. DETAILED DESCRIPTION

[0087] To make the objectives, technical solutions, and advantages of the embodiments of the present invention more clear, the technical solutions of the embodiments of the present invention will be clearly and completely described below in conjunction with the accompanying drawings of 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. Generally, the components of the embodiments of the present invention described and shown in the drawings herein can be arranged and designed in various different configurations.

[0088] Example 1

[0089] This embodiment provides an analysis method for improving the coverage of functional test requirements. Figure 1 , including the following steps:

[0090] The target software to be tested is divided into modules;

[0091] Establish inter-module parameter call matrix and the module constraint matrix , the first Rank The higher the column element is, the higher the 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;

[0092] Get the test case library, which stores multiple template test cases and the corresponding template test case call matrix. and the template test case number, the first Rank The column element is the first column of the target to be tested when testing through the template test case. Modules to Number of data transmissions per module;

[0093] 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;

[0094] Fill parameters for the high-coverage test case collection according to the module constraint matrix.

[0095] This embodiment first splits the target software under test into N modules based on the different functions performed by the software, allowing for more accurate analysis of the data interactions between modules. Data transmission requirements between modules are quantified by establishing an inter-module parameter call matrix. The data transmission requirements of each template test case are described by establishing a use case call matrix for each template test case. Based on these two matrices, a trained use case selection network is then used to output a high-coverage test case set. The use case selection network then extracts module coverage and data path coverage characteristics within the template test case's logical flow based on these two matrices. Compared to traditional approaches that solely consider the completeness of software functional testing, this approach offers greater comprehensive consideration and coverage, covering both the surface module functions and the underlying logical connections between modules, significantly improving test coverage and reliability. Finally, a module constraint matrix reflecting parameter constraints is used to populate parameters for the template test cases in the high-coverage test case set, achieving more comprehensive testing. This embodiment can systematically improve test coverage, reduce manual intervention, and enhance testing efficiency and intelligence.

[0096] It is worth noting that when obtaining a test case library, you can rely on methods such as K-Means to cluster test cases, select template test cases that can represent different test scenarios for storage, reduce computing and storage redundancy, and give priority to high-coverage, low-cost template test cases. Specifically, when establishing it, you can select a batch of basic test cases based on historical test data as the initial test case library, and then optimize it. For example, analyze the newly added test data to determine whether it contributes to the test coverage rate to decide whether to add it. When certain test cases in the test case library fail to provide new coverage value in multiple versions of the test, they can be removed to reduce storage and computing costs.

[0097] In this embodiment, the method for establishing the inter-module parameter call matrix is:

[0098] 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 transmission between modules , ;

[0099] Obtain the target software to be tested based on historical big data Modules to The data transmission frequency of each module;

[0100] 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 ;

[0101] Establish the inter-module parameter call matrix : ,in Representative Matrix No. Rank Column elements, Representative Matrix No. Rank Column element.

[0102] Furthermore, 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:

[0103] 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:

[0104] ;

[0105] :

[0106] in, A collection of modules representing the target software to be tested, Represents the collection 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;

[0107] 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 transmissions per module ;

[0108] Get the target software to be tested Modules to Data transmission frequency of each module The method is:

[0109]

[0110] in, The number of data transmissions corresponding to the target software under test Modules to The number of data transmissions per module.

[0111] On this basis, the first data transmission type of the target software to be tested is obtained 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:

[0112] ;

[0113] ;

[0114] in, is an intermediate parameter and e is a natural constant.

[0115] In the above scheme, the inter-module parameter call matrix The element size in is determined by the number of data transmission types and the frequency of data transmission. The more the number of data transmission types and the greater the frequency of data transmission between the i-th module and the j-th module, the larger the inter-module parameter call matrix will be. Considering only the frequency of data transmission may lead to excessive weights for some high-frequency but low-complexity calls, while considering only the type of data may ignore some key high-frequency interactions. Combining the number of data transmission types and the frequency of data transmission can more comprehensively characterize the intensity of the interaction between modules, making the inter-module parameter call matrix More realistically reflects the data flow relationship within the software. Inter-module parameter call matrix As a matrix used for subsequent feature extraction, if the data transmission requirement between two modules is high, it means that the data transmission between the two modules is critical. If the test case fails to cover this path, it may lead to a test blind spot. Therefore, this matrix can provide simple and intuitive feedback on data characteristics, facilitating more reliable feature extraction for subsequent models.

[0116] Specifically, in the first step of obtaining the target software to be tested based on historical big data Modules to When measuring the data transmission frequency of each module, 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 statistical data and avoid the limitations of single software data. Variance constraints are also used 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 data transmission frequency statistics. Can reflect the Modules to The ratio of the number of data transmissions between modules to the total number of data transmissions between all modules. Perform normalization and combine modules and The number of types of data transmission between modules Get the first modules and The degree of data transmission demand between modules ,use The normalized The differentiation brought by value.

[0117] In the next steps, see Figure 2 , the use case selection network includes:

[0118] An input layer, used for inputting the inter-module parameter call matrix and the test case library;

[0119] A first feature extraction layer, configured to extract features based on the inter-module parameter call matrix and the test case library to obtain first feature data;

[0120] The first output layer is used to output the number of template test cases to be selected according to the first feature data;

[0121] 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;

[0122] The second output layer is used to output the number of the template test case to be selected according to the second feature data.

[0123] This embodiment primarily divides the model's decision-making into two parts: quantity decision-making (selecting the number of template test cases) and specific case combination decision-making (selecting a specific case combination from the test case library). This is because if the model were to simply search for the optimal solution among all possible case combinations, the search space would grow exponentially with the number of test cases, resulting in excessive computing resource consumption and slow training convergence. This embodiment optimizes computational resources and improves computational efficiency.

[0124] As a preferred solution, a method for extracting features based on the inter-module parameter call matrix and the test case library to obtain the first feature data is:

[0125] Get the first eigennorm vector :

[0126] ;

[0127] ;

[0128] 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;

[0129] Get the first coverage vector :

[0130] ;

[0131] ;

[0132] in, Representative number is The template test case is used to test the coverage of the module 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;

[0133] Obtain the first feature data :

[0134] ;

[0135] in, To find the matrix transpose, for point division;

[0136] The method for outputting the number of template test cases to be selected according to the first feature data is:

[0137] ;

[0138] 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.

[0139] The first feature norm vector helps to calculate the difference between the inter-module data transmission matrix of the software to be tested and the use case call matrix of the template test case, which facilitates the quantification of the degree of adaptation of the test case to the data transmission path of the target software. It combines the adaptability of the data transmission path and the coverage of the module. The smaller the value, the better the data transmission coverage. The larger the value, the better the module coverage. The first characteristic data of the combination of the two The larger the value of , the better the overall coverage of the software to be tested in the test case library, so the number of template test cases required can be reduced. The value of is smaller. Through training, the first training weight and the first training bias can be obtained to obtain more accurate and The relationship between them.

[0140] On the other hand, the method for obtaining the second feature data is:

[0141] Get the second eigennorm vector :

[0142] ;

[0143] ;

[0144] 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;

[0145] Get the second coverage vector :

[0146] ;

[0147] ;

[0148] in, Representative number is and The template test case is used to test the coverage of the module 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;

[0149] Get the second feature data :

[0150] ;

[0151] ;

[0152] in, Representative number is and The combined scoring parameter of the template test case, e is a natural constant.

[0153] Furthermore, the method of outputting the number of the template test case to be selected according to the second characteristic data is:

[0154] Get the number and Probability score of the combination of template test cases :

[0155] ;

[0156] in, is the second training bias, Representative number is and The combined scoring parameters of the template test case;

[0157] All the Sort by large to small to form a priority selection sequence. The number of template test cases that need to be selected is , select the first All template test cases involved in the probability score are put into the high coverage test case set, g is an integer;

[0158] Get 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 have been called. If so, the first module in the sequence will be selected first. 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 tested in order from the first Elements are traversed to start the priority selection sequence. If the template test case involved in the current traversal 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 Then stop traversal.

[0159] This embodiment, when obtaining the template test cases to be selected and extracting features, performs feature extraction based on the test case combination formed by every two template test cases. It can utilize the combination of different template test cases to improve the feature capture capability of the combination coverage of the software module to be tested. Reflects the coverage of data transmission by the test case combination, It reflects the coverage of the module by the test case combination. The smaller the corresponding value is, the The larger the corresponding value is, the better the coverage of this combination is, and the higher the probability score will be. Probability score Normalization calculation is performed to make its value better reflect the global characteristics, and the model output can be optimized by adjusting the second training bias.

[0160] After outputting the probability score, only the first All the template test cases involved in the probability score provide a certain degree of tolerance for the module in terms of comprehensive coverage, which means that the coverage can be enhanced by traversal later. The value of can be 2.

[0161] The loss function to be minimized when training the use case selection network for:

[0162] ;

[0163] 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 by all template test cases in the high-coverage test case set.

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

[0165] Finally, the method for filling parameters for the high coverage test case collection according to the module constraint matrix is:

[0166] 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;

[0167] Read the module constraint matrix in sequence and do the following:

[0168] Get the Parameter constraints of each module, and setting 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 values are values that meet the parameter constraints and are farther from the critical values than a threshold value.

[0169] Get all calls in the high coverage test case set The template test case of the module, if the 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 in a one-to-many manner 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 allocated at least once.

[0170] The parameter filling scheme designed above ensures that all constrained parameters are fully covered during the test process. The comprehensiveness of the test is enhanced by setting critical values, values around critical values, and safety values. Critical values are used for extreme condition testing to verify system boundary behavior; values around critical values are used to detect anomalies near the boundary, and their values can be within or outside the constraint range. Safety values are responsible for verifying the normal operating range.

[0171] When allocating:

[0172] Number of test cases = number of test values: One-to-one allocation ensures that each test value is accurately tested.

[0173] Number of test cases > number of test values: One-to-many allocation ensures that all test values are used at least once, improving anomaly detection capabilities.

[0174] Number of test cases < number of test values: Perform multiple rounds of testing and ensure that all test values are executed at least once to avoid missing key test points.

[0175] In summary, this embodiment provides an efficient, flexible, and comprehensive test case generation solution that can improve test coverage while reducing computational burden.

[0176] The above are merely preferred embodiments of the present invention and are not intended to limit the present invention. Those skilled in the art will readily appreciate that various modifications and variations of the present invention are possible. Any modifications, equivalent substitutions, or improvements made within the spirit and principles of the present invention shall be included within the scope of protection 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; Establish inter-module parameter call matrix and the module constraint matrix , the first Rank The higher the column element is, the higher the 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 multiple template test cases and the corresponding template test case call matrix. and the template test case number, the first Rank The column element is the first column 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 the high-coverage test case collection according to the module constraint matrix; 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 transmission 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. Rank Column elements, Representative Matrix No. Rank Column element.

2. The method for analyzing functional test requirements to improve coverage according to claim 1, 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 collection 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 transmissions per module ; Get the target software to be tested Modules to Data transmission frequency of each 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.

3. The method for analyzing functional test requirements to improve coverage according to claim 2, 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.

4. The method for analyzing functional test requirements to improve 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, configured to extract features based on the inter-module parameter call matrix and the test case library to obtain first feature data; The first output layer is used to output 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 feature data.

5. The method for analyzing functional test requirements to improve coverage according to claim 4, characterized in that: The method for obtaining the first feature data by performing feature extraction based on the inter-module parameter call matrix and the test case library 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 module 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 feature 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.

6. The analysis method for improving functional test requirement coverage according to claim 4, 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 module 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.

7. The analysis method for improving functional test requirement coverage according to claim 6, 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 Sort by large to small to form a priority selection sequence. The number of template test cases that need to be selected is , select the first All template test cases involved in the probability score are put into the high coverage test case set, g is an integer; Get 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 have been called. If so, the first module in the sequence will be selected first. 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 tested in order from the first Elements are traversed to start the priority selection sequence. If the template test case involved in the current traversal 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 Then stop traversal.

8. The analysis method for improving functional test requirement coverage according to claim 4, 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 by all template test cases in the high-coverage test case set.

9. 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 sequence and do the following: Get the Parameter constraints of each module, and setting 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 values are values that meet the parameter constraints and are farther from the critical values than a threshold value. Get all calls in the high coverage test case set The template test case of the module, if the 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 in a one-to-many manner 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 allocated at least once.

Citation Information

Patent Citations

  • Method and system for optimizing software test case

    CN103810104A

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

    CN119003375A