Test case management method and system

By introducing regression testing tools and log recording processing modules into the test case management method, the problem of excessive use case logs caused by traditional regression strategies is solved, and memory space optimization and management efficiency are improved.

CN118860897APending Publication Date: 2024-10-29SHANDONG YUNHAI GUOCHUANG CLOUD COMPUTING EQUIP IND INNOVATION CENT CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202411203795.6
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-08-29
Publication Date
2024-10-29

AI Technical Summary

Technical Problem

During the verification process of test cases, using traditional regression strategies will generate a large number of use case logs, occupying more memory space, resulting in waste of resources and increased maintenance costs.

Method used

A test case management method is designed, including a regression testing tool and a log recording processing module. It determines the test case files and regression strategies to be verified by parsing the mapping file, performs simulation verification, and generates processing instructions based on the verification results for real-time monitoring and processing. Use case recording supports the selection of different regression strategies and reduces the memory space occupied by logs.

Benefits of technology

It effectively reduces the amount of logs during test case verification, reduces memory space usage, improves management efficiency and use case log maintenance effects, and reduces system maintenance costs.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN118860897A_ABST
    Figure CN118860897A_ABST
Patent Text Reader

Abstract

The embodiment of the invention provides a test case management method and system.The method is applied to a regression test tool and comprises the steps that a to-be-verified test case file and a regression strategy corresponding to the test case file are determined according to an analysis result obtained by analyzing a mapping file; performing simulation verification on the test case file based on the test case file and the regression strategy to obtain a verification result; sending the verification result to the log record processing module, and obtaining a processing instruction generated by the log record processing module based on the regression strategy and the verification result; and processing the case record of the test case based on the processing instruction. By means of the method and device, the technical problem that in the verification process of the test case, a large number of case logs are generated when a traditional regression strategy is used, and a large amount of memory space is occupied is solved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The embodiments of the present application relate to the computer field, and specifically, to a test case management method and system. Background Art

[0002] In the current verification process of test cases, if the system to be verified has third-party services integrated into it and the functions of these third-party services are mature, the focus is generally on verifying the integrated third-party services of such systems, such as verifying or testing system pathways, so as to ensure the integration quality of third-party components and the overall system.

[0003] Since each third party has its own verification plan, the test cases of different third parties are relatively independent. This verification strategy has different subsystem levels and must be managed by a dedicated person. This often results in a waste of human resources and an increase in labor costs. In particular, when using the usual regression strategy to manage test cases, all test cases need to be regressed, which will generate a large number of test case logs, occupy more memory space, and affect operating efficiency. In addition, for system-level scenarios, a combination of test cases from multiple third parties is required, which has a high system maintenance cost.

[0004] It can be seen that in the related technology, during the verification process of the test case, there is a technical problem that the use of traditional regression strategies will generate a large number of test case logs and occupy a large amount of memory space.

[0005] Regarding the technical problem in related technologies, during the verification process of test cases, the use of traditional regression strategies will generate a large number of test case logs, occupying a large amount of memory space, and no effective solution has been proposed. Summary of the invention

[0006] The embodiments of the present application provide a test case management method and system to at least solve the technical problem in the related art that, during the test case verification process, the use of traditional regression strategies will generate a large number of test case logs and occupy more memory space.

[0007] According to one embodiment of the present application, a test case management method is provided, including: applied to a regression testing tool, the regression testing tool belongs to a test case management system, the test case management system includes at least the regression testing tool and a log recording processing module, including: determining a test case file to be verified and a regression strategy corresponding to the test case file according to a parsing result of parsing a mapping file; simulating and verifying the test case file based on the test case file and the regression strategy to obtain a verification result; sending the verification result to the log recording processing module, and obtaining a processing instruction generated by the log recording processing module based on the regression strategy and the verification result; and processing the case record of the test case based on the processing instruction.

[0008] In an exemplary embodiment, the test case management system also includes a scenario case library and a regression strategy library; the test case file to be verified and the regression strategy corresponding to the test case file are determined based on the parsing result of parsing the mapping file, including: parsing the mapping file provided by the target object to obtain a first file name, and obtaining a first regression strategy name corresponding to the first file name; when it is determined that the first file name exists in the scenario case library, loading the first test case file corresponding to the first file name from the scenario case library; and determining the first test case file as the test case file to be verified; when it is determined that the first regression strategy name exists in the regression strategy library, loading the first regression strategy corresponding to the first regression strategy name from the regression strategy library, and determining the first regression strategy as the regression strategy corresponding to the test case file.

[0009] In an exemplary embodiment, the test case file is simulated and verified based on the test case file and the regression strategy to obtain a verification result, including: determining an execution type of the test case file from the regression strategy, wherein the execution type includes at least one of the following: sequential execution and parallel execution; determining a test case chain in the test case file; and the test cases in the test case chain are simulated and verified based on the execution type to obtain a verification result.

[0010] In an exemplary embodiment, the execution type is sequential execution, and the simulation verification of the test cases in the test case chain based on the execution type to obtain the verification result includes: obtaining a first number of test cases in the test case chain; traversing the test cases in the test case chain; when it is determined that the second number of traversed test cases is less than or equal to the first number, performing a separate simulation verification on the current test case traversed each time to obtain a current verification result; when it is determined that the current verification result is used to indicate that the verification failed, determining a first operation type from the regression strategy, and generating a first operation instruction according to the first operation type, wherein the first operation type represents the operation type of the regression testing tool on the test case that failed the verification, and the first operation type includes at least one of the following: stopping traversing the remaining test cases in the test case chain, and continuing to traverse the remaining test cases in the test case chain; operating the current test case corresponding to the current verification result based on the first operation instruction; sending the verification result to the log recording processing module includes: when it is determined that the current verification result is used to indicate that the verification passed, sending the current verification result to the log recording processing module.

[0011] In an exemplary embodiment, after sending the verification result to the log recording processing module, the method also includes: determining the processing instructions generated by the log recording processing module based on the regression strategy and the verification result in the following manner: when it is determined that the current verification result is used to indicate that the verification failed, determining a second operation type from the regression strategy, and generating a current processing instruction corresponding to the current test case based on the second operation type; wherein the second operation type represents the operation type of the log recording processing module on the test case that has passed the verification, and the second operation type includes at least one of the following: retaining the test case that has passed the verification in the storage disk, and deleting the test case that has passed the verification in the storage disk.

[0012] In an exemplary embodiment, the execution type is parallel execution, and the simulation verification of the test cases in the test case chain based on the execution type to obtain the verification results includes: simulating and verifying all the test cases in the test case chain in a parallel manner to obtain the verification results of all the test cases; when it is determined that all the test cases have not been executed, polling the execution results of all the test cases to obtain the polling results; when it is determined that the polling results include a failed verification result that failed the verification, determining a fourth operation type from the regression strategy, and generating a second operation instruction according to the fourth operation type, wherein the fourth operation type represents the operation type of the regression testing tool on the test case chain that failed the verification, and the fourth operation type includes at least one of the following: stopping the simulation verification of all the test cases in the test case chain, and continuing to simulate and verify all the test cases in the test case chain in a parallel manner; operating the test case chain based on the second operation instruction.

[0013] In an exemplary embodiment, sending the verification result to the log recording processing module includes: when it is determined that the polling result does not include a failed verification result of a failed verification, if it is determined that all the test cases have been executed, sending the polling result to the log recording processing module; when it is determined that the polling result does not include a failed verification result of a failed verification, if it is determined that all the test cases have not been executed, continuing to poll the execution results of all the test cases.

[0014] According to another embodiment of the present application, a test case management system is provided, including: a regression testing tool and a log record processing module, wherein the regression testing tool is at least used to implement the steps in any one of the above method embodiments.

[0015] According to another embodiment of the present application, a computer-readable storage medium is provided, in which a computer program is stored, wherein the computer program is configured to execute the steps of any of the above method embodiments when run.

[0016] According to another embodiment of the present application, an electronic device is provided, including a memory and a processor, wherein the memory stores a computer program, and the processor is configured to run the computer program to execute the steps in any one of the above method embodiments.

[0017] According to another embodiment of the present application, a computer program product is provided, including a computer program, and when the computer program is executed by a processor, the steps in any of the above method embodiments are implemented.

[0018] Through the present application, a test case management system including at least the regression testing tool and the log recording processing module is designed, and the regression testing tool is used to determine the test case file to be verified and the regression strategy corresponding to the test case file according to the parsing result of parsing the mapping file; the test case file is simulated and verified based on the test case file and the regression strategy to obtain the verification result; the verification result is sent to the log recording processing module, and the processing instruction generated by the log recording processing module based on the regression strategy and the verification result is obtained; the use case record of the test case is processed based on the processing instruction. Therefore, the regression testing tool supports flexible selection of different regression strategies, and the regression processing module is used to realize real-time monitoring of the verification results of the regression testing tool, so as to facilitate the maintenance of the use case record of the test case according to the real-time interaction between the two and the configuration of the regression strategy, thereby adjusting the space occupied by the use case record on the disk, which can solve the technical problem that a large number of use case logs will be generated and more memory space will be occupied when using the traditional regression strategy in the verification process of the test case, reduce the logs during the test case verification, and then reduce the memory space occupied by the logs, improve the management efficiency of the test case in the verification process, and also improve the maintenance effect of the use case log of the test case. BRIEF DESCRIPTION OF THE DRAWINGS

[0019] Figure 1 It is a hardware structure block diagram of a server device of a test case management method according to an embodiment of the present application;

[0020] Figure 2 is a flow chart of a test case management method according to an embodiment of the present application;

[0021] Figure 3 is a schematic diagram of the working principle of a test case management system according to an embodiment of the present application;

[0022] Figure 4 is a schematic diagram of a workflow of a simulation submission module according to an embodiment of the present application;

[0023] Figure 5 is a schematic diagram of a workflow of a log processing module according to an embodiment of the present application;

[0024] Figure 6 is a structural diagram of a test case management system according to an embodiment of the present application;

[0025] Figure 7 It is a schematic diagram of the structure of an optional electronic device according to an embodiment of the present application. DETAILED DESCRIPTION

[0026] The embodiments of the present application will be described in detail below with reference to the accompanying drawings and in combination with the embodiments.

[0027] It should be noted that the terms "first", "second", etc. in the specification and claims of this application and the above-mentioned drawings are used to distinguish similar objects, and are not necessarily used to describe a specific order or sequence.

[0028] The method embodiments provided in the embodiments of the present application can be executed in a server device or a similar computing device. Taking running on a server device as an example, Figure 1 1 is a hardware structure block diagram of a server device of a test case management method according to an embodiment of the present application. Figure 1 As shown, the server device may include one or more ( Figure 1 Only one is shown in the figure) a processor 102 (the processor 102 may include but is not limited to a processing device such as a microprocessor MCU or a programmable logic device FPGA) and a memory 104 for storing data, wherein the server device may also include a transmission device 106 and an input / output device 108 for communication functions. It can be understood by those skilled in the art that Figure 1 The structure shown is only for illustration and does not limit the structure of the above server device. Figure 1 More or fewer components as shown, or with Figure 1 Different configurations shown.

[0029] The memory 104 can be used to store computer programs, for example, software programs and modules of application software, such as the computer program corresponding to the test case management method in the embodiment of the present application. The processor 102 executes various functional applications and data processing by running the computer program stored in the memory 104, that is, to implement the above method. The memory 104 may include a high-speed random access memory, and may also include a non-volatile memory, such as one or more magnetic storage devices, flash memory, or other non-volatile solid-state memory. In some instances, the memory 104 may further include a memory remotely arranged relative to the processor 102, and these remote memories may be connected to the server 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.

[0030] The transmission device 106 is used to receive or send data via a network. The specific example of the above network may include a wireless network provided by a communication provider of the server device. In one example, the transmission device 106 includes a network adapter (Network Interface Controller, referred to as NIC), which can be connected to other network devices through a base station so as to communicate with the Internet. In one example, the transmission device 106 can be a radio frequency (RF) module, which is used to communicate with the Internet wirelessly.

[0031] Next, some technical terms of this application are explained:

[0032] SoC: System on Chip, chip-level system, system on chip.

[0033] Design Under Test (DUT): Design under test.

[0034] Subsys:Sub-System, subsystem.

[0035] Vplan: Verification plan.

[0036] In this embodiment, a test case management method is provided. Figure 2 is a flow chart of a test case management method according to an embodiment of the present application, such as Figure 2 As shown, the process includes the following steps:

[0037] Step S202, determining the test case file to be verified and the regression strategy corresponding to the test case file according to the parsing result of parsing the mapping file;

[0038] Step S204, performing simulation verification on the test case file based on the test case file and the regression strategy to obtain a verification result;

[0039] Step S206, sending the verification result to the log record processing module, and obtaining a processing instruction generated by the log record processing module based on the regression strategy and the verification result;

[0040] Step S208: Process the test case record of the test case based on the processing instruction.

[0041] Through the above steps, a test case management system including at least the regression test tool and the log record processing module is designed, and the regression test tool is used to determine the test case file to be verified and the regression strategy corresponding to the test case file according to the parsing result of parsing the mapping file; the test case file is simulated and verified based on the test case file and the regression strategy to obtain the verification result; the verification result is sent to the log record processing module, and the processing instruction generated by the log record processing module based on the regression strategy and the verification result is obtained; the use case record of the test case is processed based on the processing instruction. Therefore, the regression test tool supports flexible selection of different regression strategies, and the regression processing module is used to realize real-time monitoring of the verification results of the regression test tool, which is convenient for maintaining the use case record of the test case according to the real-time interaction between the two and the configuration of the regression strategy, thereby adjusting the space occupied by the use case record on the disk, which can solve the technical problem that a large number of use case logs will be generated and more memory space will be occupied when using the traditional regression strategy in the verification process of the test case, reduce the logs during the test case verification, and then reduce the memory space occupied by the logs, improve the management efficiency of the test case in the verification process, and also improve the maintenance effect of the use case log of the test case.

[0042] Optionally, the execution subject of the above steps may be a server, terminal, etc. to which the regression testing tool belongs, but is not limited thereto.

[0043] The execution order of step S202 and step S204 is fixed, that is, step S202 is executed first, and then step S204 is executed.

[0044] In an exemplary embodiment, the test case management system also includes a scenario case library and a regression strategy library; the technical solution for determining the test case file to be verified and the regression strategy corresponding to the test case file according to the parsing result of parsing the mapping file in step S202 specifically includes: parsing the mapping file provided by the target object to obtain a first file name, and obtaining a first regression strategy name corresponding to the first file name; when it is determined that the first file name exists in the scenario case library, loading the first test case file corresponding to the first file name from the scenario case library; and determining the first test case file as the test case file to be verified; when it is determined that the first regression strategy name exists in the regression strategy library, loading the first regression strategy corresponding to the first regression strategy name from the regression strategy library, and determining the first regression strategy as the regression strategy corresponding to the test case file.

[0045] Optional, such as Figure 3 As shown, the scenario use case library (i.e. Figure 3The caseChain (test case chain) file is stored in the scenario library, which is a collection of scenarios and is created and maintained by the user according to the verification scenario;

[0046] Figure 3 In the regression strategy library, regStrategy (regression strategy) files are stored, which are regression strategies for specified caseChains and are created and maintained by users according to regression requirements.

[0047] The mapping file is a file that represents the correspondence between the regStrategy file and the caseChain file. It is created by the user. The mapping file needs to be imported into the regression test tool when used.

[0048] In an alternative embodiment, in combination Figure 3 An exemplary test case management process is provided: First, the user sorts out the verification requirements of the test cases for the corresponding scenarios for the system scenarios that need regression verification, creates a mapping file based on the verification requirements, generates a Case chain for the corresponding scenarios, and generates a Case chain file (caseChain.file).

[0049] Among them, Case chain includes: 1, case name; 2, random number (randTime).

[0050] For different regression requirements, users can formulate different regression strategies based on Case chain, where a corresponding regression strategy configuration file (regrStrategy.file) is generated for the regression strategy of each Case chain. At the same time, a mapping file (mapping.file) is generated based on the association between Case chain and regrStrategy.

[0051] The mapping file includes caseChain specifying the test case chain to be regressed (for example, represented as "caseChain_N") and regStrategy specifying the regression strategy to be adopted (correspondingly represented as regStrategy_N).

[0052] Next, the mapping file is imported into the regression testing tool and the log processing module (ie, the above-mentioned log recording processing module).

[0053] Use the regression test tool to parse the mapping file, and load the caseChain file and regStrategy file specified by the corresponding mapping file into the scenario case library and regression strategy library. Similarly, use the log processing module to load the corresponding regStrategy file into the regression strategy library.

[0054] Use the regression testing tool to parse the caseChain file and the regStrategy file to obtain the case name contained in the caseChain and the regression strategy for this caseChain contained in the regStrategy.

[0055] Use the regression test tool to submit the simulation and perform regression. During the regression process, the regression test tool interacts with the log processing module. The interactive information is the simulation information of fail or pass. The log processing module will process the log of the simulated test case differently (delete or retain) according to the case simulation information and the regression strategy.

[0056] Among them, input interfaces of case Chain.file, regrStrategy.file, and mapping.file are reserved in the regression testing tool, so that the regression testing tool can parse the above files based on these input interfaces to implement the corresponding regression process.

[0057] This embodiment uses Case chain to make the user's scene management more efficient and provide users with flexible regression strategies, so that users can choose different strategies according to different verification stages to find the optimal solution for efficiency, server resources and debugging.

[0058] In an exemplary embodiment, further, for the test case file described in step S204, simulation verification is performed on the test case file based on the test case file and the regression strategy to obtain a verification result, the following steps are specifically included: determining an execution type of the test case file from the regression strategy, wherein the execution type includes at least one of the following: sequential execution, parallel execution; determining a test case chain in the test case file; and simulating and verifying the test cases in the test case chain based on the execution type to obtain a verification result.

[0059] Optionally, for the above test case chain, it may include the use case name and regression number for the scenario verification to be regressed. The use case name may be, for example, "caseName: case0, case1, case2, ..., caseN", and the corresponding regression number may be, for example, "randTime: 5, 1, 3, ..., 2".

[0060] Each case chain of this embodiment corresponds to a system scenario, and each case chain contains multiple cases. Case chain supports serial and parallel execution, and can be mapped with system scenarios to achieve convenient management and maintenance.

[0061] Among them, the regression strategy supports the serial execution idea embodied by sequential execution, and also supports the execution idea of ​​parallel execution. This facilitates users to make flexible choices based on specific needs, achieve flexible trade-offs in efficiency and memory usage, and thus balance verification requirements and resource utilization. For example, when server resources are tight, users can choose serial mode to save server resources; when verification nodes are tight, users can choose parallel mode to improve the efficiency of simulation verification. Specifically, if the test case in the Casechain fails to pass the verification, the verification process can be terminated, or the remaining test cases can be continued to be executed. In this way, by real-time monitoring of whether the test case passes the verification, it has the flexible choice of immediately terminating the regression or continuing to execute the complete Casechain, which is convenient for balancing server resources and regression efficiency.

[0062] In an exemplary embodiment, the execution type is sequential execution, and the process of simulating and verifying the test cases in the test case chain based on the execution type to obtain the verification result includes: obtaining a first number of test cases in the test case chain; traversing the test cases in the test case chain; when it is determined that the second number of traversed test cases is less than or equal to the first number, performing a separate simulation verification on the current test case traversed each time to obtain a current verification result; when it is determined that the current verification result is used to indicate that the verification failed, determining a first operation type from the regression strategy, and generating a first operation instruction according to the first operation type, wherein the first operation type represents the operation type of the regression testing tool on the test case that failed the verification, and the first operation type includes at least one of the following: stopping traversing the remaining test cases in the test case chain, and continuing to traverse the remaining test cases in the test case chain; operating the current test case corresponding to the current verification result based on the first operation instruction; sending the verification result to the log recording processing module includes: when it is determined that the current verification result is used to indicate that the verification passed, sending the current verification result to the log recording processing module.

[0063] Optionally, a current processing instruction corresponding to the current test case is generated based on the second operation type, including: when it is determined that the second operation type is to retain the verified test case in the storage disk, if it is determined that the current resource utilization is less than the preset resource utilization, then the current processing instruction for retaining the verified test case is generated; if it is determined that the current resource utilization is equal to or greater than the preset resource utilization, then the current processing instruction for retaining the verified test case is not generated; when it is determined that the second operation type is to delete the verified test case in the storage disk, then the current processing instruction for retaining the verified test case is generated.

[0064] Optionally, in response to determining that the current verification result is used to indicate that the verification failed, a third operation type is determined from the regression strategy, and a current processing instruction corresponding to the current test case is generated based on the third operation type; wherein the third operation type represents the operation type of the log recording processing module on the test case that failed the verification, and the third operation type includes at least one of the following: retaining the test case that failed the verification in the storage disk, and deleting the test case that failed the verification in the storage disk.

[0065] The current processing instruction corresponding to the current test case is generated based on the third operation type, including: when it is determined that the third operation type is to retain the test case that fails the verification in the storage disk, if it is determined that the current resource utilization is less than the preset resource utilization, then the current processing instruction for retaining the test case that fails the verification is generated; if it is determined that the current resource utilization is equal to or greater than the preset resource utilization, then the current processing instruction for retaining the test case that fails the verification is not generated; when it is determined that the third operation type is to delete the test case that fails the verification in the storage disk, then the current processing instruction for retaining the test case that fails the verification is generated.

[0066] Optionally, the above regression strategy may include, for example, execute type (indicating execution type), kill condition (indicating a first operation type), pass log process (indicating a second operation type), and fail log process (indicating a third operation type).

[0067] Among them, execute type indicates whether caseChain is executed sequentially or in parallel. Execute type includes sequential (corresponding to sequential execution) and parallel (corresponding to parallel execution). Figure 4As shown, the characteristic of sequential execution is that case0 to casen are simulated sequentially, and case2 can be simulated only after case0 passes, until casen.

[0068] The kill condition means that when the case verification result is fail, the regression test tool can choose to stop the unfinished test cases in the caseChain or continue to simulate all test cases. The kill condition includes immediate (corresponding to stop the unfinished test cases in the caseChain) and ignore (corresponding to continue to simulate all test cases).

[0069] Among them, fail log process means the log processing module for failed case (corresponding to the test case that failed verification), and fail log process can include retain and delete. Retain means taking the action of retaining the log (corresponding to retaining the test case that failed verification in the storage disk), and delete means taking the action of deleting the log (corresponding to deleting the test case that failed verification in the storage disk).

[0070] Among them, pass log process means the log processing module for passed case (corresponding to the test case that has passed the verification), and pass log process can include retain and delete. Retain means taking the action of retaining the log (corresponding to retaining the test case that has not passed the verification in the storage disk), and delete means taking the action of deleting the log (corresponding to deleting the test case that has passed the verification in the storage disk).

[0071] In an exemplary embodiment, after the verification result is sent to the log recording processing module, further, the processing instructions generated by the log recording processing module based on the regression strategy and the verification result can be determined in the following manner: when it is determined that the current verification result is used to indicate that the verification has not passed, a second operation type is determined from the regression strategy, and a current processing instruction corresponding to the current test case is generated based on the second operation type; wherein the second operation type represents the operation type of the log recording processing module on the test case that has passed the verification, and the second operation type includes at least one of the following: retaining the test case that has passed the verification in the storage disk, and deleting the test case that has passed the verification in the storage disk.

[0072] It can be seen that the above-mentioned log record processing module is used to process the records of test cases. Specifically, for test cases that fail to pass verification, the test cases that fail to pass verification and the case records of the test cases that fail to pass verification are retained in the storage disk. For test cases that pass verification, the test cases that pass verification and the case records of the test cases that pass verification are retained in the storage disk.

[0073] For the above-mentioned log record processing module, it can maintain the record files in the disk in real time according to the verification results of the interaction with the simulation submission module (corresponding to the regression test tool) combined with the regression strategy. In this way, automatic processing of use case records can be achieved, which can solve the problem of excessive memory usage caused by a large number of regressions and balance the disk usage and debugging efficiency.

[0074] In an exemplary embodiment, the execution type is parallel execution, and the implementation process of simulating and verifying the test cases in the test case chain based on the execution type to obtain the verification results includes: simulating and verifying all the test cases in the test case chain in a parallel manner to obtain the verification results of all the test cases; when it is determined that all the test cases have not been executed, polling the execution results of all the test cases to obtain the polling results; when it is determined that the polling results include a failed verification result that failed the verification, determining a fourth operation type from the regression strategy, and generating a second operation instruction according to the fourth operation type, wherein the fourth operation type represents the operation type of the regression testing tool on the test case chain that failed the verification, and the fourth operation type includes at least one of the following: stopping the simulation verification of all the test cases in the test case chain, and continuing to simulate and verify all the test cases in the test case chain in a parallel manner; operating the test case chain based on the second operation instruction.

[0075] In an exemplary embodiment, a solution for implementing the verification result to the log recording processing module is proposed, which specifically includes: when it is determined that the polling result does not include a failed verification result of a failed verification, if it is determined that all the test cases have been executed, the polling result is sent to the log recording processing module; when it is determined that the polling result does not include a failed verification result of a failed verification, if it is determined that all the test cases have not been executed, the execution results of all the test cases continue to be polled.

[0076] Further, in one embodiment, in combination Figure 4 The process shown is Figure 3 The workflow of the simulation submission module is described in detail, including:

[0077] Step 1: Determine the execution type. If it is sequential, execute steps 2-10. If it is parallel, execute steps 11-16.

[0078] Step 2: Submit and simulate case 0.

[0079] Step 3: Determine whether the verification result of case0 is passed. If yes, go to step 4; otherwise, go to step 5.

[0080] Step 4: Submit and simulate case 1.

[0081] Step 5: determine whether to end the simulation verification test case chain. If yes, execute step 10, otherwise execute step 7.

[0082] Step 6: Determine whether the verification result of case 1 is passed. If yes, go to step 7; otherwise, go to step 3.

[0083] Step 7: Submit and simulate case 2.

[0084] Step 8: Repeat the above steps until case n is simulated and verified.

[0085] Step 9, determine whether the verification result of casen is passed. If yes, go to step 16, otherwise go to step 10.

[0086] Step 10, determine that the test case chain verification result is failed.

[0087] Step 11, submit all test cases.

[0088] Step 12, perform simulation verification of all test cases in parallel.

[0089] Step 13, continuously polling to determine whether there are any test cases that have not passed the verification results of all test cases. If yes, then execute step 14, otherwise execute step 15.

[0090] Step 14, determine whether the simulation verification test case chain is finished. If yes, execute step 10, otherwise execute step 15. Step 15, continuously poll to determine whether all test cases have been executed.

[0091] Step 16, determine that the test case chain verification result is passed.

[0092] Through the above steps, this application proposes the concept of a test case chain, which is mapped to the system scenario through the test case chain. Each system scenario has a separately maintained caseChain file to manage "messy" cases, save maintenance costs, and facilitate batch regression for scenarios. The simulation submission module supports serial or parallel execution strategies, that is, when server resources are tight, users can choose serial mode to save server resources; when verification nodes are tight, users can choose parallel mode to improve simulation efficiency. At the same time, the simulation submission module is also used to support two strategies for terminating regression. Specifically, for test cases that fail verification, the regression process of the test case chain can be terminated immediately, or the remaining test cases of the test case chain can be regressed, which is convenient for users to use according to specific verification requirements and server resource combinations.

[0093] Exemplarily, the following pseudo code is further provided to implement the logic of the simulation submission module.

[0094]

[0095]

[0096] Further, in one embodiment, in combination Figure 5 The process shown is Figure 3 The workflow of the log processing module is described in detail, including:

[0097] Step 1: continuously poll to determine whether the test cases in the test case chain have been executed and whether the corresponding information queue is empty. If so, the polling ends, otherwise, step 2 is executed.

[0098] Step 2, execute case_info=case_info_queue.pop().

[0099] Step 3: Determine the specific meaning of case-info.state. If it is pass, go to step 4; if it is fail, go to step 6.

[0100] Step 4: Determine the specific meaning of pass_log_process. If it is delete, execute step 5; if it is retain, execute step 1.

[0101] Step 5, delete the test case record of the corresponding test case.

[0102] Step 6: Determine the specific meaning of fail_log_process. If it is delete, execute step 5; if it is retain, execute step 1.

[0103] The log processing module proposed based on the above steps can retain or delete the test case records of the test case in real time according to the simulation results. For example, when the disk memory is tight, all the test case records can be deleted, and only the test cases in the test case chain are concerned whether they have passed the verification. When the disk memory is sufficient, the unverified test cases can be retained, and the test case records of the verified test cases can be deleted to facilitate later debugging. It can be seen that the log processing module can delete / retain the simulation log according to the case information and regStrategy file of the simulation submission module interaction, which can not only adjust the memory capacity occupied by the test case records of the test case in real time, but also improve the efficiency of later debugging.

[0104] Among them, the case information of the interaction between the simulation submission module and the log processing module can be pushed into the queue of the log processing module (case_info_queue).

[0105] Exemplarily, the following pseudo code is further provided to implement the logic of the log processing module.

[0106]

[0107]

[0108] Furthermore, in one embodiment, based on the mapping file in the above embodiment, higher-level management can be performed to support "connection management" from low-level systems to high-level systems.

[0109] The low-level subsystem 0_mapping.file is represented by the following code, for example.

[0110] ″ / / subsys0 scenarios

[0111] scenarioName: mapping0_0, mapping0_1, mapping0_2, ..., mapping0_N″.

[0112] For the low-level subsystem 1_mapping.file, for example, it is represented by the following code.

[0113] ″ / / subsys1 scenarios

[0114] scenarioName: mapping1_0, mapping1_1, mapping1_2, ..., mapping1_N″.

[0115] For the high-level system High_level_mapping.file, for example, it is represented by the following code.

[0116] ″ / / High levelscenarios

[0117] scenarioName: subsys0_mapping, subsys1_mapping, ..., subsysN_mapping".

[0118] Through the description of the above implementation methods, those skilled in the art can clearly understand that the method according to the above embodiment can be implemented by means of software plus a necessary general hardware platform, and of course by hardware, but in many cases the former is a better implementation method. Based on this understanding, the technical solution of the present application, or the part that contributes to the prior art, can be embodied in the form of a software product, which is stored in a storage medium (such as ROM / RAM, magnetic disk, optical disk), and includes a number of instructions for a terminal device (which can be a mobile phone, computer, server, or network device, etc.) to execute the methods described in each embodiment of the present application.

[0119] In this embodiment, a test case management system is also provided, which is used to implement the above-mentioned embodiments and preferred implementation modes, and the descriptions that have been made will not be repeated. As used below, the term "module" can implement a combination of software and / or hardware of a predetermined function. Although the system described in the following embodiments is preferably implemented in software, the implementation of hardware, or a combination of software and hardware, is also possible and conceivable.

[0120] Figure 6 is a schematic diagram of the structure of a test case management system according to an embodiment of the present application, such as Figure 6 As shown, the system includes a regression testing tool 62 and a logging processing module 64 .

[0121] Among them, the regression testing tool is at least used to determine the test case file to be verified and the regression strategy corresponding to the test case file according to the parsing result of parsing the mapping file; simulate and verify the test case file based on the test case file and the regression strategy to obtain a verification result; send the verification result to the log record processing module, and obtain the processing instructions generated by the log record processing module based on the regression strategy and the verification result; process the case record of the test case based on the processing instruction.

[0122] Through the above system, a management system for test cases including at least the regression test tool and the log record processing module is designed, and the regression test tool is used to determine the test case file to be verified and the regression strategy corresponding to the test case file according to the parsing result of parsing the mapping file; the test case file is simulated and verified based on the test case file and the regression strategy to obtain the verification result; the verification result is sent to the log record processing module, and the processing instruction generated by the log record processing module based on the regression strategy and the verification result is obtained; the use case record of the test case is processed based on the processing instruction. Therefore, the regression test tool supports flexible selection of different regression strategies, and the regression processing module is used to realize real-time monitoring of the verification results of the regression test tool, which is convenient for maintaining the use case record of the test case according to the real-time interaction between the two and the configuration of the regression strategy, thereby adjusting the space occupied by the use case record on the disk, which can solve the technical problem that a large number of use case logs will be generated and more memory space will be occupied when using traditional regression strategies in the verification process of the test case, reduce the logs during the test case verification, and then reduce the memory space occupied by the logs, improve the management efficiency of the test case in the verification process, and also improve the maintenance effect of the use case log of the test case.

[0123] In an exemplary embodiment, the regression testing tool is also used to: parse the mapping file provided by the target object to obtain a first file name, and obtain a first regression strategy name corresponding to the first file name; when it is determined that the first file name exists in the scenario case library, load the first test case file corresponding to the first file name from the scenario case library; and determine the first test case file as the test case file to be verified; when it is determined that the first regression strategy name exists in the regression strategy library, load the first regression strategy corresponding to the first regression strategy name from the regression strategy library, and determine the first regression strategy as the regression strategy corresponding to the test case file.

[0124] In an exemplary embodiment, the regression testing tool is also used to: determine the execution type of the test case file from the regression strategy, wherein the execution type includes at least one of the following: sequential execution, parallel execution; determine the test case chain in the test case file; and simulate and verify the test cases in the test case chain based on the execution type to obtain a verification result.

[0125] In an exemplary embodiment, the execution type is sequential execution, and the regression testing tool is also used to: obtain a first number of test cases in the test case chain; traverse the test cases in the test case chain; when it is determined that the second number of traversed test cases is less than or equal to the first number, perform a separate simulation verification on the current test case traversed each time to obtain a current verification result; when it is determined that the current verification result is used to indicate that the verification failed, determine a first operation type from the regression strategy, and generate a first operation instruction according to the first operation type, wherein the first operation type represents the operation type of the regression testing tool on the test case that failed the verification, and the first operation type includes at least one of the following: stop traversing the other test cases remaining in the test case chain, and continue traversing the other test cases remaining in the test case chain; operate the current test case corresponding to the current verification result based on the first operation instruction; sending the verification result to the log recording processing module includes: when it is determined that the current verification result is used to indicate that the verification passed, send the current verification result to the log recording processing module.

[0126] In an exemplary embodiment, the regression testing tool is also used to: after sending the verification result to the log recording processing module, determine the processing instructions generated by the log recording processing module based on the regression strategy and the verification result in the following manner: when it is determined that the current verification result is used to indicate that the verification failed, determine a second operation type from the regression strategy, and generate a current processing instruction corresponding to the current test case based on the second operation type; wherein the second operation type represents the operation type of the log recording processing module on the test case that has passed the verification, and the second operation type includes at least one of the following: retaining the test case that has passed the verification in the storage disk, and deleting the test case that has passed the verification in the storage disk.

[0127] In an exemplary embodiment, the execution type is parallel execution, and the regression testing tool is further used to: simulate and verify all test cases in the test case chain in a parallel manner to obtain verification results of all test cases; when it is determined that all test cases have not been executed, poll the execution results of all test cases to obtain polling results; when it is determined that the polling results include failed verification results that did not pass the verification, determine a fourth operation type from the regression strategy, and generate a second operation instruction according to the fourth operation type, wherein the fourth operation type represents the operation type of the regression testing tool on the test case chain that failed the verification, and the fourth operation type includes at least one of the following: stop simulating and verifying all test cases in the test case chain, and continue to simulate and verify all test cases in the test case chain in a parallel manner; operate the test case chain based on the second operation instruction.

[0128] In an exemplary embodiment, the regression testing tool is also used to: when it is determined that the polling result does not include a failed verification result of a failed verification, if it is determined that all the test cases have been executed, send the polling result to the log recording processing module; when it is determined that the polling result does not include a failed verification result of a failed verification, if it is determined that all the test cases have not been executed, continue to poll the execution results of all the test cases.

[0129] It should be noted that the above modules can be implemented by software or hardware. For the latter, it can be implemented in the following ways, but not limited to: the above modules are all located in the same processor; or the above modules are located in different processors in any combination.

[0130] An embodiment of the present application further provides a computer-readable storage medium, in which a computer program is stored, wherein the computer program is configured to execute the steps of any of the above method embodiments when running.

[0131] Optionally, in this embodiment, the computer program may be configured to perform the following steps by means of the computer program:

[0132] S1, determining a test case file to be verified and a regression strategy corresponding to the test case file according to a parsing result of parsing a mapping file;

[0133] S2, performing simulation verification on the test case file based on the test case file and the regression strategy to obtain a verification result;

[0134] S3, sending the verification result to the log record processing module, and obtaining a processing instruction generated by the log record processing module based on the regression strategy and the verification result;

[0135] S4, processing the use case record of the test case based on the processing instruction.

[0136] In an exemplary embodiment, the computer-readable storage medium may include, but is not limited to, various media that can store computer programs, such as a USB flash drive, a read-only memory (ROM), a random access memory (RAM), a mobile hard disk, a magnetic disk or an optical disk.

[0137] An embodiment of the present application further provides an electronic device, including a memory and a processor, wherein a computer program is stored in the memory, and the processor is configured to run the computer program to execute the steps in any one of the above method embodiments.

[0138] In an exemplary embodiment, the electronic device may further include a transmission device and an input / output device, wherein the transmission device is connected to the processor, and the input / output device is connected to the processor.

[0139] In an exemplary embodiment, the computer-readable storage medium may include, but is not limited to, various media that can store computer programs, such as a USB flash drive, a read-only memory (ROM), a random access memory (RAM), a mobile hard disk, a magnetic disk or an optical disk.

[0140] The embodiment of the present application also provides an electronic device, such as Figure 7 As shown, the electronic device includes a memory 702 and a processor 704. The memory 702 stores a computer program, and the processor 704 is configured to execute the steps in any of the above method embodiments through the computer program.

[0141] Optionally, in this embodiment, the processor 704 may be configured to perform the following steps through a computer program:

[0142] S1, determining a test case file to be verified and a regression strategy corresponding to the test case file according to a parsing result of parsing a mapping file;

[0143] S2, performing simulation verification on the test case file based on the test case file and the regression strategy to obtain a verification result;

[0144] S3, sending the verification result to the log record processing module, and obtaining a processing instruction generated by the log record processing module based on the regression strategy and the verification result;

[0145] S4, processing the use case record of the test case based on the processing instruction.

[0146] Alternatively, a person skilled in the art may understand that: Figure 7 The structure shown is for illustration only. Figure 7 The structure of the electronic device is not limited. For example, the electronic device may also include Figure 7 More or fewer components (such as network interfaces, etc.) as shown in, or with Figure 7 Different configurations shown.

[0147] Among them, the memory 702 can be used to store software programs and modules, such as the program instructions / modules corresponding to the test case management method and system in the embodiment of the present application. The processor 704 executes various functional applications and data processing by running the software programs and modules stored in the memory 702, that is, realizing the above-mentioned test case management method. The memory 702 may include a high-speed random access memory, and may also include a non-volatile memory, such as one or more magnetic storage devices, flash memory, or other non-volatile solid-state memory. In some instances, the memory 702 may further include a memory remotely located relative to the processor 704, and these remote memories may be connected to the terminal via a network. Examples of the above-mentioned networks include, but are not limited to, the Internet, corporate intranets, local area networks, mobile communication networks, and combinations thereof. Among them, the memory 702 can be specifically, but not limited to, used to store information such as distributed storage system configuration files. As an example, such as Figure 7 As shown, the memory 702 may include but is not limited to all modules in the test case management system. In addition, it may also include but is not limited to other module units in the test case management system, which will not be repeated in this example.

[0148] Optionally, the transmission device 706 is used to receive or send data via a network. Specific examples of the network may include wired networks and wireless networks. In one example, the transmission device 706 includes a network adapter (Network Interface Controller, NIC), which can be connected to other network devices and routers via a network cable so as to communicate with the Internet or a local area network. In one example, the transmission device 706 is a radio frequency (RF) module, which is used to communicate with the Internet wirelessly.

[0149] In addition, the electronic device further includes: a display 708; and a connection bus 710, which is used to connect various module components in the electronic device.

[0150] An embodiment of the present application further provides a computer program product, which includes a computer program. When the computer program is executed by a processor, the steps in any one of the above method embodiments are implemented.

[0151] An embodiment of the present application further provides another computer program product, including a non-volatile computer-readable storage medium, wherein the non-volatile computer-readable storage medium stores a computer program, and when the computer program is executed by a processor, the steps in any of the above method embodiments are implemented.

[0152] An embodiment of the present application also provides a computer program, which includes computer instructions, which are stored in a computer-readable storage medium; a processor of a computer device reads the computer instructions from the computer-readable storage medium, and the processor executes the computer instructions, so that the computer device performs the steps in any one of the above method embodiments.

[0153] For specific examples in this embodiment, reference may be made to the examples described in the above embodiments and exemplary implementation modes, and this embodiment will not be described in detail herein.

[0154] Obviously, those skilled in the art should understand that the above modules or steps of the present application can be implemented by a general computing device, they can be concentrated on a single computing device, or distributed on a network composed of multiple computing devices, they can be implemented by a program code executable by a computing device, so that they can be stored in a storage device and executed by the computing device, and in some cases, the steps shown or described can be executed in a different order from that herein, or they can be made into individual integrated circuit modules, or multiple modules or steps therein can be made into a single integrated circuit module for implementation. Thus, the present application is not limited to any specific combination of hardware and software.

[0155] The above description is only the preferred embodiment of the present application and is not intended to limit the present application. For those skilled in the art, the present application may have various modifications and variations. Any modification, equivalent replacement, improvement, etc. made within the principles of the present application shall be included in the protection scope of the present application.

Claims

1. A test case management method, It is characterized in that Applied to a regression testing tool, the regression testing tool belongs to a test case management system, the test case management system includes at least the regression testing tool and a log record processing module, including: Determine the test case file to be verified and the regression strategy corresponding to the test case file according to the parsing result of parsing the mapping file; Performing simulation verification on the test case file based on the test case file and the regression strategy to obtain a verification result; Sending the verification result to the log record processing module, and obtaining a processing instruction generated by the log record processing module based on the regression strategy and the verification result; The use case record of the test case is processed based on the processing instruction.

2. The method according to claim 1, It is characterized in that The test case management system also includes a scenario case library and a regression strategy library; The step of determining the test case file to be verified and the regression strategy corresponding to the test case file according to the parsing result of parsing the mapping file includes: Parsing the mapping file provided by the target object to obtain a first file name, and obtaining a first regression strategy name corresponding to the first file name; In the case where it is determined that the first file name exists in the scenario case library, loading a first test case file corresponding to the first file name from the scenario case library; and determining the first test case file as the test case file to be verified; When it is determined that the first regression strategy name exists in the regression strategy library, a first regression strategy corresponding to the first regression strategy name is loaded from the regression strategy library, and the first regression strategy is determined as the regression strategy corresponding to the test case file.

3. The method according to claim 1, It is characterized in that The step of performing simulation verification on the test case file based on the test case file and the regression strategy to obtain a verification result includes: Determining an execution type of the test case file from the regression strategy, wherein the execution type includes at least one of the following: sequential execution and parallel execution; Determining a test case chain in the test case file; The test cases in the test case chain are simulated and verified based on the execution type to obtain verification results.

4. The method according to claim 3, It is characterized in that The execution type is sequential execution, and the test cases in the test case chain are simulated and verified based on the execution type to obtain verification results, including: Obtaining a first number of test cases in the test case chain; Traversing the test cases in the test case chain; When it is determined that the second number of the traversed test cases is less than or equal to the first number, performing a separate simulation verification on the current test case traversed each time to obtain a current verification result; In the case where it is determined that the current verification result is used to indicate that the verification has not passed, a first operation type is determined from the regression strategy, and a first operation instruction is generated according to the first operation type, wherein the first operation type represents the operation type of the regression testing tool on the test case that has not passed the verification, and the first operation type includes at least one of the following: stopping traversing other test cases remaining in the test case chain, and continuing to traverse other test cases remaining in the test case chain; Performing an operation on a current test case corresponding to the current verification result based on the first operation instruction; The sending the verification result to the log record processing module includes: when it is determined that the current verification result is used to indicate that the verification is passed, sending the current verification result to the log record processing module.

5. The method according to claim 4, It is characterized in that After sending the verification result to the log record processing module, the method further includes: The processing instructions generated by the log record processing module based on the regression strategy and the verification result are determined in the following manner: In a case where it is determined that the current verification result is used to indicate that the verification has not passed, determining a second operation type from the regression strategy, and generating a current processing instruction corresponding to the current test case based on the second operation type; Among them, the second operation type represents the operation type of the log recording processing module on the verified test case, and the second operation type includes at least one of the following: retaining the verified test case in the storage disk, and deleting the verified test case in the storage disk.

6. The method according to claim 3, It is characterized in that The execution type is parallel execution, and the test cases in the test case chain are simulated and verified based on the execution type to obtain verification results, including: Performing simulation verification on all test cases in the test case chain in parallel to obtain verification results of all test cases; When it is determined that all the test cases have not been executed, polling the execution results of all the test cases to obtain polling results; In the case where it is determined that the polling result includes a failed verification result that has not passed the verification, a fourth operation type is determined from the regression strategy, and a second operation instruction is generated according to the fourth operation type, wherein the fourth operation type represents the operation type of the regression testing tool for the test case chain that has not passed the verification, and the fourth operation type includes at least one of the following: stopping simulation verification of all test cases in the test case chain, and continuing to simulate verification of all test cases in the test case chain in parallel; The test case chain is operated based on the second operation instruction.

7. The method according to claim 6, It is characterized in that The step of sending the verification result to the log record processing module comprises: In the case where it is determined that the polling result does not include a failed verification result, if it is determined that all the test cases have been executed, the polling result is sent to the log record processing module; In the case where it is determined that the polling result does not include a failed verification result, if it is determined that all the test cases have not been completely executed, the execution results of all the test cases continue to be polled.

8. A test case management system, It is characterized in that include: Regression testing tools and logging processing modules; Wherein, the regression testing tool is at least used to implement the steps of the method described in any one of claims 1 to 7.

9. A computer-readable storage medium, It is characterized in that The computer-readable storage medium stores a computer program, wherein the computer program implements the steps of the method described in any one of claims 1 to 7 when executed by a processor.

10. An electronic device comprising a memory, a processor, and a computer program stored in the memory and executable on the processor, It is characterized in that When the processor executes the computer program, the steps of the method described in any one of claims 1 to 7 are implemented.