Test case management method, device, equipment and medium based on multi-label system

By receiving test requirement tags and calculating relevance values, the target test cases are automatically selected and executed, solving the problem of insufficient guidance of case management systems in the existing technology and improving test efficiency.

CN114281677BActive Publication Date: 2025-09-12SENSOR NETWORKS TECH BEIJING CO LTD
View PDF 3 Cites 0 Cited by

Patent Information

Application Number
CN202111430845.0
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2021-11-29
Publication Date
2025-09-12
Estimated Expiration
2041-11-29

AI Technical Summary

Technical Problem

The existing use case management system cannot provide more guidance and analysis, resulting in test users having to rely heavily on experience to screen and execute use cases, which is time-consuming and inefficient.

Method used

By receiving the test requirement tag, calculating the correlation value between the test requirement tag and the use case tag, the target test case is automatically selected and executed based on the correlation threshold.

Benefits of technology

It realizes the automatic and accurate selection of test cases during the testing process, improves testing efficiency and reduces dependence on test execution personnel.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN114281677B_ABST
    Figure CN114281677B_ABST
Patent Text Reader

Abstract

The present disclosure relates to a test case management method, apparatus, device, and medium based on a multi-tag system. The method includes: receiving a test submission request, wherein the test submission request includes a test requirement tag; performing a correlation calculation based on the test requirement tag and a test case tag corresponding to the test case, obtaining multiple correlation values; obtaining a target correlation value based on the multiple correlation values ​​and a preset correlation threshold; obtaining a target test case corresponding to the target correlation value; and executing the target test case. Thus, test case execution is determined based on the tag correlation calculation, enabling automatic and accurate test case selection during the test process and improving test efficiency.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present disclosure relates to the field of automated testing technology, and in particular to a test case management method, apparatus, device, and medium based on a multi-label system. Background Art

[0002] With the rapid development of software development, testing-related technologies are gaining increasing attention in the industry. Test cases, a crucial asset in the software testing process, serve as both a verification standard for software compliance and a crucial basis for test execution during quality activities. With the rapid growth of business, selecting the appropriate use cases from the vast number of available test cases during each regression process presents a challenge for testers.

[0003] In related technologies, use case management systems divide and manage use cases by product, project, version, and other dimensions. However, current use case management systems only maintain limited information such as the use case name, version, and steps. This lacks sufficient guidance and analysis for testers, requiring manual screening and execution of use cases. This entire process is both time-consuming and heavily reliant on the tester's experience. Summary of the Invention

[0004] In order to solve the above technical problems or at least partially solve the above technical problems, the present disclosure provides a test case management method, apparatus, device and medium based on a multi-tag system.

[0005] The present disclosure provides a test case management method based on a multi-label system, comprising:

[0006] Receive a test submission request; wherein the test submission request includes a test requirement tag;

[0007] Performing correlation calculation based on the test requirement label and the use case label corresponding to the test case to obtain multiple correlation values;

[0008] Obtaining a target correlation value based on the multiple correlation values ​​and a preset correlation threshold;

[0009] Obtain a target test case corresponding to the target relevance value, and execute the target test case.

[0010] In an optional embodiment of the present disclosure, before receiving the test submission request, the method further includes:

[0011] Get multiple test cases;

[0012] Obtaining use case information for each of the test cases;

[0013] Processing is performed based on a plurality of preset tags and the use case information to obtain a use case tag for each of the test cases.

[0014] In an optional embodiment of the present disclosure, the test case management method based on the multi-label system further includes:

[0015] The use case tags are divided according to relevance to obtain a first relevance tag set and a second relevance tag set.

[0016] In an optional embodiment of the present disclosure, the test case management method based on the multi-label system further includes:

[0017] The use case labels are divided according to a calculation method to obtain an automatic label set and a manual label set.

[0018] In an optional embodiment of the present disclosure, performing correlation calculation based on the test requirement label and the use case label corresponding to the test case to obtain multiple correlation values ​​includes:

[0019] Calculating a first correlation value between the test requirement label and the use case label corresponding to the test case;

[0020] Calculating a second correlation value between the change function corresponding to the test requirement label and the coverage function corresponding to the use case label;

[0021] The multiple correlation values ​​are obtained by performing calculation based on a preset similarity influence factor, a comprehensive level influence weight influence factor, a comprehensive level influence weight coefficient, the first correlation value, and the second correlation value.

[0022] In an optional embodiment of the present disclosure, the test case management method based on the multi-label system further includes:

[0023] The comprehensive grade impact weight coefficient is calculated based on the use case grade and recommendation coefficient of the test case.

[0024] In an optional embodiment of the present disclosure, obtaining a target correlation value based on the multiple correlation values ​​and a preset correlation threshold includes:

[0025] Each of the correlation values ​​is compared with the preset correlation threshold, and the correlation value that is greater than the preset correlation threshold is obtained as the target correlation value.

[0026] The present disclosure provides a test case management device based on a multi-label system, comprising:

[0027] A request receiving module, configured to receive a test submission request; wherein the test submission request includes a test requirement tag;

[0028] A calculation and acquisition module, configured to perform correlation calculation based on the test requirement label and the use case label corresponding to the test case, and obtain multiple correlation values;

[0029] an acquisition module, configured to obtain a target correlation value based on the multiple correlation values ​​and a preset correlation threshold;

[0030] The acquisition execution module is used to obtain the target test case corresponding to the target relevance value and execute the target test case.

[0031] In an optional embodiment of the present disclosure, the apparatus further includes:

[0032] Get use case module, used to get multiple test cases;

[0033] An information acquisition module, configured to acquire use case information of each test case;

[0034] The processing and obtaining module is used to process based on a plurality of preset tags and the use case information to obtain a use case tag of each test case.

[0035] In an optional embodiment of the present disclosure, the apparatus further includes:

[0036] The first division and acquisition module is configured to divide the use case tags according to relevance, and acquire a first relevance tag set and a second relevance tag set.

[0037] In an optional embodiment of the present disclosure, the apparatus further includes:

[0038] The second division and acquisition module is configured to divide the use case labels in a calculation manner to obtain an automatic label set and a manual label set.

[0039] In an optional embodiment of the present disclosure, the calculation acquisition module is specifically configured to:

[0040] Calculating a first correlation value between the test requirement label and the use case label corresponding to the test case;

[0041] Calculating a second correlation value between the change function corresponding to the test requirement label and the coverage function corresponding to the use case label;

[0042] The multiple correlation values ​​are obtained by performing calculation based on a preset similarity influence factor, a comprehensive level influence weight influence factor, a comprehensive level influence weight coefficient, the first correlation value, and the second correlation value.

[0043] In an optional embodiment of the present disclosure, the apparatus further includes:

[0044] A coefficient calculation module is used to calculate the comprehensive grade influence weight coefficient based on the use case grade and recommendation coefficient of the test case.

[0045] In an optional embodiment of the present disclosure, the acquisition module is specifically configured to:

[0046] Each of the correlation values ​​is compared with the preset correlation threshold, and the correlation value that is greater than the preset correlation threshold is obtained as the target correlation value.

[0047] According to an embodiment of the present disclosure, an electronic device is provided, which includes: a processor; a memory for storing executable instructions of the processor; the processor is used to read the executable instructions from the memory and execute the instructions to implement the test case management method based on a multi-label system as provided in an embodiment of the present disclosure.

[0048] According to an embodiment of the present disclosure, a computer-readable storage medium is provided, wherein the storage medium stores a computer program, and the computer program is used to execute the test case management method based on a multi-label system as provided in the embodiment of the present disclosure.

[0049] The technical solution provided by the embodiments of the present disclosure has the following advantages over the prior art:

[0050] The system receives a test submission request, wherein the test submission request includes a test requirement tag, performs a correlation calculation based on the test requirement tag and a test case tag corresponding to the test case, obtains multiple correlation values, obtains a target correlation value based on the multiple correlation values ​​and a preset correlation threshold, obtains a target test case corresponding to the target correlation value, and executes the target test case. Thus, by determining the execution of the test case based on the tag correlation calculation, the system automatically and accurately selects test cases during the test process, thereby improving test efficiency. BRIEF DESCRIPTION OF THE DRAWINGS

[0051] The accompanying drawings, which are incorporated in and constitute a part of this specification, illustrate embodiments consistent with the present disclosure and, together with the description, serve to explain the principles of the present disclosure.

[0052] In order to more clearly illustrate the embodiments of the present disclosure or the technical solutions in the prior art, the following briefly introduces the drawings required for use in the embodiments or the description of the prior art. Obviously, for ordinary technicians in this field, other drawings can be obtained based on these drawings without any creative work.

[0053] Figure 1 A flowchart illustrating a test case management method based on a multi-label system according to an embodiment of the present disclosure;

[0054] Figure 2 This is a flowchart of another test case management method based on a multi-tag system provided by an embodiment of the present disclosure;

[0055] Figure 3 A schematic diagram of the structure of a test case management device based on a multi-tag system provided by an embodiment of the present disclosure;

[0056] Figure 4 It is a structural diagram of an electronic device provided by an embodiment of the present disclosure. DETAILED DESCRIPTION

[0057] In order to more clearly understand the above-mentioned objectives, features and advantages of the present disclosure, the scheme of the present disclosure will be further described below. It should be noted that the embodiments of the present disclosure and the features therein can be combined with each other in the absence of conflict.

[0058] In the following description, many specific details are set forth to facilitate a full understanding of the present disclosure, but the present disclosure may also be implemented in other ways different from those described herein; it is obvious that the embodiments in the specification are only part of the embodiments of the present disclosure, rather than all of the embodiments.

[0059] Figure 1 A flowchart of a test case management method based on a multi-label system provided in an embodiment of the present disclosure includes:

[0060] Step 101: Receive a test submission request, wherein the test submission request includes a test requirement tag.

[0061] In an embodiment of the present disclosure, a preset template may be provided, such as a test environment, contextual test information, etc., and multiple test requirement tags input by the user based on the preset template, such as execution time, stand-alone environment, etc., may be received, and a test submission request may be generated based on the multiple test requirement tags.

[0062] Step 102 : performing correlation calculation based on the test requirement tag and the use case tag corresponding to the test case to obtain multiple correlation values.

[0063] In the embodiment of the present disclosure, the pre-stored test cases generate a use case label for each test case based on multiple labels and use case information. Therefore, correlation calculation can be further performed based on the test requirement label and the use case label corresponding to the test case to obtain multiple correlation values.

[0064] In the embodiment of the present disclosure, the relevance value can be understood as the degree of relevance between the test requirement label and the use case label corresponding to the test case, that is, whether the test case meets the user requirement.

[0065] In a specific embodiment, the first correlation between the test requirement label and the use case label corresponding to the test case is calculated, the second correlation value between the change function corresponding to the test requirement label and the coverage function corresponding to the use case label is calculated, and the calculation is combined with the relevant similarity influencing factors to obtain the correlation value between the test requirement and each test case.

[0066] Step 103: Obtain a target correlation value based on the multiple correlation values ​​and a preset correlation threshold.

[0067] Step 104: Obtain a target test case corresponding to the target relevance value, and execute the target test case.

[0068] In the embodiment of the present disclosure, after obtaining multiple correlation values, the multiple correlation values ​​are respectively compared with a preset correlation threshold, and a correlation value greater than the preset correlation threshold is obtained as a target correlation value.

[0069] Furthermore, a target test case corresponding to the target relevance value is obtained, and the target test case is executed.

[0070] In summary, the test case management method based on a multi-tag system in the disclosed embodiments receives a test request, wherein the test request includes a test requirement tag, performs a correlation calculation based on the test requirement tag and the test case tag corresponding to the test case, obtains multiple correlation values, obtains a target correlation value based on the multiple correlation values ​​and a preset correlation threshold, obtains a target test case corresponding to the target correlation value, and executes the target test case. Thus, the test case execution is determined based on the tag correlation calculation, achieving automatic and accurate test case selection during the test process and improving testing efficiency.

[0071] Based on the description of the above embodiment, in order to more clearly describe the test case management method based on the multi-label system proposed in the embodiment of the present disclosure, the following Figure 2 Provide detailed explanation.

[0072] Figure 2 A flowchart illustrating another test case management method based on a multi-label system provided in an embodiment of the present disclosure includes:

[0073] Step 201: Acquire multiple test cases, acquire use case information of each test case, perform processing based on multiple preset tags and the use case information, and acquire a use case tag of each test case.

[0074] In the embodiments of the present disclosure, use case information refers to one or more of the following: project name, use case name, creation time, maintenance user, component / module / service, version, use case test function completion, use case level, comprehensive level, coverage function, coverage path, applicable environment, execution duration, execution time, execution success rate, number of problems found, whether it is automated, etc.

[0075] In an embodiment of the present disclosure, the preset multiple tags include one or more of a basic tag, a product tag, a level tag, a code tag, an environment tag, an execution tag, and other tags.

[0076] In an embodiment of the present disclosure, processing is performed based on preset multiple tags and use case information to obtain use case tags for each test case. For example, use case tags include basic tags: project name, use case name, creation time, maintenance user, etc.; product tags: component / module / service, version, completion of use case test function, etc.; level tags: use case level (such as P0, P1, P2), comprehensive level (such as L1, L2, L3), etc.; code tags: covered functions, covered paths, etc.; environment tags: applicable environment, etc.; execution tags: execution duration, execution time, execution success rate, number of problems found, etc., and other tags: whether it is automated, etc.

[0077] Among them, applicable environments include stand-alone environments, small cluster environments (such as the smallest cluster consisting of three stand-alone machines), standard cluster environments (consisting of six stand-alone machines, with metadata and data nodes separated), and mixed environments (for big data components).

[0078] Step 202: Divide the use case tags according to relevance to obtain a first relevance tag set and a second relevance tag set.

[0079] In an embodiment of the present disclosure, when obtaining the use case label of each test case, the use case label can be divided according to relevance to obtain a first relevance label set and a second relevance label set. That is to say, the impact of the use case label on the test is further distinguished. For example, the use case labels are divided into two categories according to the strength of the relationship. The first relevance label set is a weak relevance label set: such as version, module, environment, etc.; the second relevance label set is a strong relevance label set: such as code function, etc.

[0080] Among them, the first relevance tag set can be understood as being relatively simple to obtain, and has a relatively low weight in subsequent similarity calculations. The second relevance tag set can be understood as being obtained with the assistance of syntax tree analysis, link analysis, and other means, and has a relatively high weight in subsequent similarity calculations.

[0081] Step 203 : Divide the use case labels according to the calculation method to obtain an automatic label set and a manual label set.

[0082] In the disclosed embodiment, when obtaining the use case label of each test case, the use case label can be divided according to the calculation method to obtain an automatic label set and a manual label set, such as a manual label set: basic labels, product labels, etc.; an automatic label set: such as level labels, etc. The automatic labels will be updated regularly according to the use case level and operation status.

[0083] Among them, manual label sets generally do not need to be modified and are relatively stable after labeling; automatic label sets are generally obtained dynamically and updated regularly. Therefore, the automatic label sets are compared before and after each update to avoid large deviations in the final calculation results due to abnormal discrepancies.

[0084] Step 204 : Receive a test requirement tag, calculate a first correlation value between the test requirement tag and a use case tag corresponding to the test case, and calculate a second correlation value between a change function corresponding to the test requirement tag and a coverage function corresponding to the use case tag.

[0085] Step 205 , performing calculation based on the preset similarity influence factor, the comprehensive level influence weight influence factor, the comprehensive level influence weight coefficient, the first correlation value and the second correlation value to obtain a plurality of correlation values.

[0086] In the disclosed embodiment, the comprehensive grade influence weight coefficient is calculated based on the test case grade and the recommendation coefficient. The second correlation value is greater than the first correlation value, and a larger correlation value indicates a stronger correlation strength, while a smaller correlation value indicates a weaker correlation strength.

[0087] Specifically, during the test analysis, the information related to the test submitted this time is also entered in the form of tags, such as providing a preset template as described above, such as the test environment, contextual test information, etc., receiving multiple test requirement tags entered by the user based on the preset template, and generating a test submission request based on the multiple test requirement tags.

[0088] In an embodiment of the present disclosure, the test requirement label may include the component / module / service to which it belongs, the version to which it belongs, the affected component / module / service, the changed function, the line of code, etc.

[0089] In the embodiment of the present disclosure, the test cases that need to be executed this time are automatically recommended based on the test requirements of the submitted test request and the relevance of the test cases.

[0090] Specifically, the correlation calculation formula is: Sim = δ*Sw(A, B)+(1-δ)*Ss(A, B)+ωL; where δ is the preset similarity influencing factor, Sw is the first correlation value, which is obtained by calculating the overall label of the test requirement label and the test case label, that is, Calculate the similarity between the test case label set A and the test requirement label set B, J () is the Jaccard similarity coefficient. Ss is the second correlation value, which can be calculated by calculating the changed functions / lines of the test requirement and the covered functions / lines of the test case in the same way as Sw. The changed functions / lines refer to the functions / lines modified between the current test request and the last test request, and the covered functions refer to the code paths executed by the test case. The second correlation value has a greater weight than the first correlation value.

[0091] Among them, ω is the comprehensive level impact weight influence factor, L is the comprehensive level impact weight coefficient, L = εP + (1-ε)R; among them, ε is the coefficient factor, which can be set according to actual application needs, P is the level coefficient, and L is calculated according to the use case level (P0, P1, P2, etc.); R is the recommended coefficient, which can be obtained through the operation failure rate and the number of automatically discovered problems. For example, the automated problem discovery rate - the failure rate caused by non-vulnerabilities = R, among which the automated problem discovery rate = the number of problems discovered by the automated test case / the total number of problems discovered by the automated test case; the failure rate caused by non-vulnerabilities = the number of failures caused by non-vulnerabilities / the number of runs.

[0092] Step 206 : Compare each correlation value with a preset correlation threshold, obtain a correlation value greater than the preset correlation threshold as a target correlation value, obtain a target test case corresponding to the target correlation value, and execute the target test case.

[0093] In the embodiment of the present disclosure, after obtaining multiple correlation values, the multiple correlation values ​​are respectively compared with a preset correlation threshold, and a correlation value greater than the preset correlation threshold is obtained as a target correlation value.

[0094] Furthermore, a target test case corresponding to the target relevance value is obtained, and the target test case is executed.

[0095] In summary, the test case management method based on a multi-label system disclosed in the present invention obtains multiple test cases, obtains use case information of each test case, processes based on preset multiple labels and use case information, obtains use case labels of each test case, divides use case labels according to relevance, obtains a first relevance label set and a second relevance label set, divides use case labels according to a calculation method, obtains an automatic label set and a manual label set, receives a test requirement label, calculates a first relevance value between the test requirement label and the use case label corresponding to the test case, calculates a second relevance value between the change function corresponding to the test requirement label and the coverage function corresponding to the use case label, calculates based on a preset similarity influence factor, a comprehensive level influence weight influence factor, a comprehensive level influence weight coefficient, the first relevance value and the second relevance value, obtains multiple relevance values, compares each relevance value with a preset relevance threshold, obtains a relevance value greater than the preset relevance threshold as a target relevance value, obtains a target test case corresponding to the target relevance value, and executes the target test case. As a result, suitable test cases can be automatically recommended during each test, and executable cases can be accurately screened during the test, improving regression efficiency and reducing dependence on test executors. The entire process of test screening, execution, and analysis is automated, which is more effective for scenario testing of massive use case libraries.

[0096] Corresponding to the aforementioned test case management method based on a multi-tag system, the embodiment of the present disclosure provides a test case management device based on a multi-tag system. Figure 3 This is a schematic diagram of the structure of a test case management device based on a multi-tag system provided by an embodiment of the present disclosure. The device can be implemented by software and / or hardware and can generally be integrated into an electronic device, such as Figure 3 As shown, the test case management device 300 based on the multi-tag system includes the following modules:

[0097] The request receiving module 301 is configured to receive a test submission request, wherein the test submission request includes a test requirement tag.

[0098] The calculation and acquisition module 302 is used to perform correlation calculation based on the test requirement label and the use case label corresponding to the test case to obtain multiple correlation values.

[0099] The acquisition module 303 is configured to obtain a target correlation value based on multiple correlation values ​​and a preset correlation threshold.

[0100] The acquisition and execution module 304 is used to acquire the target test case corresponding to the target relevance value and execute the target test case.

[0101] In some embodiments, the apparatus further comprises:

[0102] Get use case module, used to get multiple test cases;

[0103] An information acquisition module, configured to acquire use case information of each test case;

[0104] The processing and obtaining module is used to process based on a plurality of preset tags and the use case information to obtain a use case tag of each test case.

[0105] In some embodiments, the apparatus further comprises:

[0106] The first division and acquisition module is configured to divide the use case tags according to relevance, and acquire a first relevance tag set and a second relevance tag set.

[0107] In some embodiments, the apparatus further comprises:

[0108] The second division and acquisition module is configured to divide the use case labels in a calculation manner to obtain an automatic label set and a manual label set.

[0109] In some embodiments, the calculation and acquisition module 302 is specifically configured to:

[0110] Calculating a first correlation value between the test requirement label and the use case label corresponding to the test case;

[0111] Calculating a second correlation value between the change function corresponding to the test requirement label and the coverage function corresponding to the use case label;

[0112] The multiple correlation values ​​are obtained by performing calculation based on a preset similarity influence factor, a comprehensive level influence weight influence factor, a comprehensive level influence weight coefficient, the first correlation value, and the second correlation value.

[0113] In some embodiments, the apparatus further comprises:

[0114] A coefficient calculation module is used to calculate the comprehensive grade influence weight coefficient based on the use case grade and recommendation coefficient of the test case.

[0115] In some embodiments, the acquisition module 303 is specifically configured to:

[0116] Each of the correlation values ​​is compared with the preset correlation threshold, and the correlation value that is greater than the preset correlation threshold is obtained as the target correlation value.

[0117] In summary, the test case management device based on a multi-tag system in the disclosed embodiment receives a test request, wherein the test request includes a test requirement tag, performs a correlation calculation based on the test requirement tag and the test case tag corresponding to the test case, obtains multiple correlation values, obtains a target correlation value based on the multiple correlation values ​​and a preset correlation threshold, obtains a target test case corresponding to the target correlation value, and executes the target test case. Thus, the test case execution is determined based on the tag correlation calculation, achieving automatic and accurate test case selection during the test process and improving testing efficiency.

[0118] The test case management device based on a multi-tag system provided by an embodiment of the present invention can execute the test case management method based on a multi-tag system provided by any embodiment of the present invention, and has the corresponding functional modules and beneficial effects of the execution method.

[0119] Figure 4 Schematic diagram of the structure of an electronic device provided by an embodiment of the present disclosure. Figure 4 As shown, the electronic device includes a processor 410, a memory 420, an input device 430, and an output device 440; the number of processors 410 in the electronic device can be one or more. Figure 4 In the figure, a processor 410 is used as an example; the processor 410, memory 420, input device 430 and output device 440 in the electronic device can be connected via a bus or other means. Figure 4 The bus connection is taken as an example.

[0120] Memory 420, as a computer-readable storage medium, can be used to store software programs, computer-executable programs, and modules, such as program instructions / modules corresponding to the test case management method based on a multi-tag system in the embodiments of the present invention. Processor 410 executes the software programs, instructions, and modules stored in memory 420 to execute various functional applications and data processing of the electronic device, thereby implementing the test case management method based on a multi-tag system provided by the embodiments of the present invention.

[0121] The memory 420 may mainly include a program storage area and a data storage area, wherein the program storage area may store an operating system and applications required for at least one function; the data storage area may store data created based on the use of the terminal, etc. In addition, the memory 420 may include a high-speed random access memory and may also include a non-volatile memory, such as at least one disk storage device, a flash memory device, or other non-volatile solid-state storage device. In some instances, the memory 420 may further include a memory remotely located relative to the processor 410, and these remote memories may be connected to the electronic device via a network. Examples of the above-mentioned network include, but are not limited to, the Internet, an intranet, a local area network, a mobile communication network, and combinations thereof.

[0122] The input device 430 may be used to receive input digital or character information and generate key signal input related to user settings and function control of the electronic device, and may include a keyboard, a mouse, etc. The output device 440 may include a display device such as a display screen.

[0123] The embodiment of the present disclosure further provides a storage medium containing computer-executable instructions, which, when executed by a computer processor, are used to implement the test case management method based on a multi-label system provided by the embodiment of the present invention.

[0124] Of course, the storage medium containing computer-executable instructions provided in an embodiment of the present invention is not limited to the method operations described above, and can also execute related operations in the test case management method based on a multi-label system provided in any embodiment of the present invention.

[0125] Through the above description of the implementation methods, those skilled in the art can clearly understand that the present invention can be implemented with the help of software and necessary general-purpose hardware, and of course it can also be implemented by hardware, but in many cases the former is a better implementation method. Based on this understanding, the technical solution of the present invention is essentially or the part that contributes to the prior art can be embodied in the form of a software product, and the computer software product can be stored in a computer-readable storage medium, such as a computer floppy disk, read-only memory (ROM), random access memory (RAM), flash memory (FLASH), hard disk or optical disk, etc., including a number of instructions for enabling a computer device (which can be a personal computer, server, or network device, etc.) to execute the methods described in each embodiment of the present invention.

[0126] It is worth noting that in the embodiment of the above-mentioned search device, the various units and modules included are only divided according to functional logic, but are not limited to the above-mentioned division, as long as the corresponding functions can be achieved; in addition, the specific names of the functional units are only for the convenience of distinguishing each other, and are not used to limit the scope of protection of the present invention.

[0127] It should be noted that, in this document, relational terms such as "first" and "second" are used only to distinguish one entity or operation from another entity or operation, and do not necessarily require or imply any actual relationship or order between these entities or operations. Moreover, the terms "comprises," "comprising," or any other variations thereof are intended to cover non-exclusive inclusion, so that a process, method, article, or device comprising a series of elements includes not only those elements, but also other elements not explicitly listed, or elements inherent to such process, method, article, or device. In the absence of further limitations, an element defined by the phrase "comprising a ..." does not exclude the presence of other identical elements in the process, method, article, or device comprising the element.

[0128] The foregoing description is intended only to provide specific embodiments of the present disclosure, intended to enable those skilled in the art to understand and implement the present disclosure. Various modifications to these embodiments will be readily apparent to those skilled in the art, and the general principles defined herein may be implemented in other embodiments without departing from the spirit or scope of the present disclosure. Therefore, the present disclosure is not intended to be limited to the embodiments described herein, but rather to be construed in the broadest manner consistent with the principles and novel features disclosed herein.

Claims

1. A test case management method based on a multi-label system, characterized in that: include: Receive a test submission request input by a user based on a preset template; wherein the test submission request includes a test requirement tag; A correlation calculation is performed based on the test requirement label and the use case label corresponding to the test case to obtain multiple correlation values; wherein, the correlation calculation is performed based on the test requirement label and the use case label corresponding to the test case to obtain multiple correlation values, including: calculating a first correlation value between the test requirement label and the use case label corresponding to the test case; calculating a second correlation value between the change function corresponding to the test requirement label and the coverage function corresponding to the use case label; performing calculations based on a preset similarity influencing factor, a comprehensive grade influencing weight influencing factor, a comprehensive grade influencing weight coefficient, the first correlation value, and the second correlation value to obtain the multiple correlation values; wherein, the first correlation value is obtained by calculating the overall label of the test requirement label and the use case label of the test case, and the second correlation value is obtained by calculating the change function or row of the test requirement and the coverage function or row of the test case; wherein, the comprehensive grade influencing weight coefficient is calculated based on the use case grade and recommendation coefficient of the test case; The correlation calculation formula is Sim=δ*Sw(A,B)+(1-δ)*Ss(A,B)+ωL; wherein δ is the preset similarity influencing factor, Sw is the first correlation value, and is obtained by calculating the overall label of the test requirement label and the use case label of the test case. Calculate the similarity between the test case label set A and the test requirement label set B of the test case, where J() is the Jaccard similarity coefficient; Ss is a second correlation value, which is calculated by using the change function or row of the test requirement and the coverage function or row of the test case, and the calculation method is the same as that of calculating Sw, wherein the change function or row refers to the function or row that is modified by comparing the current submitted test request with the last submitted test request, and the coverage function refers to the code path executed by the test case. The weight of the second correlation value is greater than that of the first correlation value; Wherein, ω is the comprehensive level impact weight influence factor, L is the comprehensive level impact weight coefficient, L = εP + (1-ε)R; wherein ε is the coefficient factor, P is the level coefficient, and L is calculated according to the use case level; R is the recommendation coefficient, which is obtained by the run failure rate and calculated by the number of problems, and the problem discovery rate - the failure rate caused by non-vulnerabilities = R, wherein the problem discovery rate = the number of problems discovered in the test case divided by the total number of problems discovered; the failure rate caused by non-vulnerabilities = the number of failures caused by non-vulnerabilities divided by the number of runs; Obtaining a target correlation value based on the multiple correlation values ​​and a preset correlation threshold; Obtain a target test case corresponding to the target relevance value, and execute the target test case.

2. The test case management method based on a multi-label system according to claim 1, characterized in that: Before receiving the test submission request, the method further includes: Get multiple test cases; Obtaining use case information for each of the test cases; Processing is performed based on a plurality of preset tags and the use case information to obtain a use case tag for each of the test cases.

3. The test case management method based on a multi-label system according to claim 2, characterized in that: Also includes: The use case tags are divided according to relevance to obtain a first relevance tag set and a second relevance tag set.

4. The test case management method based on a multi-label system according to claim 2, characterized in that: Also includes: The use case labels are divided according to a calculation method to obtain an automatic label set and a manual label set.

5. The test case management method based on a multi-label system according to claim 1, characterized in that: The obtaining of a target correlation value based on the multiple correlation values ​​and a preset correlation threshold comprises: Each of the correlation values ​​is compared with the preset correlation threshold, and the correlation value that is greater than the preset correlation threshold is obtained as the target correlation value.

6. A test case management device based on a multi-label system, characterized in that: include: A request receiving module, configured to receive a test submission request input by a user based on a preset template; wherein the test submission request includes a test requirement tag; A calculation and acquisition module, configured to perform correlation calculation based on the test requirement label and the use case label corresponding to the test case, and obtain multiple correlation values; wherein the calculation and acquisition module is specifically configured to: calculate a first correlation value between the test requirement label and the use case label corresponding to the test case; calculate a second correlation value between the change function corresponding to the test requirement label and the coverage function corresponding to the use case label; perform calculations based on a preset similarity influence factor, a comprehensive grade influence weight influence factor, a comprehensive grade influence weight coefficient, the first correlation value, and the second correlation value to obtain the multiple correlation values; wherein the first correlation value is obtained by calculating the overall label of the test requirement label and the use case label of the test case, and the second correlation value is obtained by calculating the change function or row of the test requirement and the coverage function or row of the test case; wherein the comprehensive grade influence weight coefficient is calculated based on the use case grade and recommendation coefficient of the test case; The correlation calculation formula is Sim=δ*Sw(A,B)+(1-δ)*Ss(A,B)+ωL; wherein δ is the preset similarity influencing factor, Sw is the first correlation value, and is obtained by calculating the overall label of the test requirement label and the use case label of the test case. Calculate the similarity between the test case label set A and the test requirement label set B of the test case, where J() is the Jaccard similarity coefficient; Ss is a second correlation value, which is calculated by using the change function or row of the test requirement and the coverage function or row of the test case, and the calculation method is the same as that of calculating Sw, wherein the change function or row refers to the function or row that is modified by comparing the current submitted test request with the last submitted test request, and the coverage function refers to the code path executed by the test case. The weight of the second correlation value is greater than that of the first correlation value; Wherein, ω is the comprehensive level impact weight influence factor, L is the comprehensive level impact weight coefficient, L = εP + (1-ε)R; wherein ε is the coefficient factor, P is the level coefficient, and L is calculated according to the use case level; R is the recommendation coefficient, which is obtained by the run failure rate and calculated by the number of problems, and the problem discovery rate - the failure rate caused by non-vulnerabilities = R, wherein the problem discovery rate = the number of problems discovered in the test case divided by the total number of problems discovered; the failure rate caused by non-vulnerabilities = the number of failures caused by non-vulnerabilities divided by the number of runs; an acquisition module, configured to obtain a target correlation value based on the multiple correlation values ​​and a preset correlation threshold; The acquisition execution module is used to obtain the target test case corresponding to the target relevance value and execute the target test case.

7. An electronic device, characterized in that: The electronic device comprises: processor; a memory for storing instructions executable by the processor; The processor is configured to read the executable instructions from the memory and execute the instructions to implement the test case management method based on a multi-tag system as described in any one of claims 1 to 5.

8. A computer-readable storage medium, characterized in that The storage medium stores a computer program, and the computer program is used to execute the test case management method based on the multi-tag system described in any one of claims 1 to 5.

Citation Information

Patent Citations

  • Test case searching method and device, equipment and storage medium

    CN112100359A

  • Method and system for generating test scheme

    CN112685324A

  • Test case reusing system and method based on demand item extraction

    CN113687826A