CN115658402A - Test case management method and device, electronic equipment and readable storage medium - Google Patents

Test case management method and device, electronic equipment and readable storage medium Download PDF

Info

Publication number
CN115658402A
CN115658402A CN202211293639.4A CN202211293639A CN115658402A CN 115658402 A CN115658402 A CN 115658402A CN 202211293639 A CN202211293639 A CN 202211293639A CN 115658402 A CN115658402 A CN 115658402A
Authority
CN
China
Prior art keywords
test
case
time
theoretical
test time
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Pending
Application number
CN202211293639.4A
Other languages
Chinese (zh)
Inventor
徐丹
路明
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Suzhou Inspur Intelligent Technology Co Ltd
Original Assignee
Suzhou Inspur Intelligent Technology Co Ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Suzhou Inspur Intelligent Technology Co Ltd filed Critical Suzhou Inspur Intelligent Technology Co Ltd
Priority to CN202211293639.4A priority Critical patent/CN115658402A/en
Publication of CN115658402A publication Critical patent/CN115658402A/en
Pending legal-status Critical Current

Links

Images

Landscapes

  • Management, Administration, Business Operations System, And Electronic Commerce (AREA)

Abstract

The embodiment of the invention provides a test case management method, which comprises the following steps: acquiring actual test time of a first test case based on execution data of the first test case in a shared case library; optimizing the theoretical test time of the first test case according to the actual test time to obtain the optimized theoretical test time; updating the theoretical test time of a second test case in the project case library according to the optimized theoretical test time; the project case library comprises test cases quoted from the shared case library, and the second test case is a test case corresponding to the first test case in the project case library. Therefore, the test cases of a plurality of projects can be conveniently managed based on the shared case library and the project case library, the theoretical test time is optimized according to the actual test time, the error between the theoretical test time and the actual test time can be reduced, and the reference value of the theoretical test time is improved.

Description

Test case management method and device, electronic equipment and readable storage medium
Technical Field
The invention belongs to the technical field of computers, and particularly relates to a test case management method, a test case management device, electronic equipment and a readable storage medium.
Background
In the server testing process, the test case is the basis of the test, and generally includes a test target, a test environment, input data, a test step, an expected result, a test script, and the like. An engineer tests the configuration, power consumption, performance and the like of the server through the test case to find the system defects of the server, so that the aim of optimizing the server is fulfilled. Therefore, maintenance management of test cases and data analysis of test cases are very important in server testing.
In the prior art, a test design engineer designs a test case according to requirements of a test project, executes the test project on a server based on the test case of the project, and performs maintenance and update on the test case according to a test result. The theoretical test time of the test case is an important parameter of the test case and is also a basis for an engineer to make a test plan. However, at present, the maintenance of a single project test case is usually based on the personal experience of an engineer, so that the technical problems that the error between the theoretical test time and the actual test time of the set test case is large, and the reference value of the theoretical test time is low exist.
Disclosure of Invention
The invention provides a test case management method, a test case management device, electronic equipment and a readable storage medium, which are used for solving the problems of large error and low reference value of set test case theoretical test time.
In order to solve the technical problem, the invention is realized as follows:
in a first aspect, the present invention provides a test case management method, where the method includes:
acquiring actual test time of a first test case based on execution data of the first test case in a shared case library;
optimizing the theoretical test time of the first test case according to the actual test time to obtain the optimized theoretical test time;
updating the theoretical test time of a second test case in the project case library according to the optimized theoretical test time; the project case library comprises test cases quoted from the shared case library, and the second test case is a test case corresponding to the first test case in the project case library.
Optionally, the optimizing the theoretical test time of the first test case according to the actual test time to obtain the optimized theoretical test time includes:
calculating the latest average test time of the test case according to the actual test time and the historical average test time of the first test case;
determining a target difference value according to the difference value between the latest average test time and the theoretical test time of the first test case;
and under the condition that the target difference is larger than a preset difference threshold, optimizing the theoretical test time according to the latest average test time to obtain the optimized theoretical test time.
Optionally, after acquiring the actual test time of the first test case based on the execution data of the first test case in the shared case library, the method further includes:
acquiring the execution times of a first test case based on the execution data of the first test case in a sharing case library;
and when the target difference is greater than a preset difference threshold, optimizing the theoretical test time according to the latest average test time to obtain the optimized theoretical test time, including:
optimizing the theoretical test time according to the latest average test time under the condition that the target difference is greater than a preset difference threshold and the execution times are greater than a preset time threshold so as to obtain the optimized theoretical test time;
after the optimizing the theoretical test time according to the latest average test time to obtain the optimized theoretical test time, the method further includes:
and updating the preset times threshold according to the execution times so that the preset times threshold is larger than the execution times.
Optionally, the updating the theoretical test time of the second test case in the project case library according to the optimized theoretical test time includes:
determining a test case with the case identification identical to that of the first test case in the project case library as a second test case;
and updating the theoretical test time defined in the second test case according to the optimized theoretical test time to obtain the second test case with the updated theoretical test time.
Optionally, any one of the project case libraries includes a test case referenced from the shared case library and one or more dedicated test cases of the project case library, where before acquiring an actual test time of the first test case based on execution data of the first test case in the shared case library, the method further includes:
executing a test task according to each test case in each project case library to obtain the execution data of each test case; wherein the execution data includes an actual test time;
and optimizing the theoretical test time of the special test case according to the actual test time of the special test case to obtain the special test case with the optimized theoretical test time.
Optionally, after the theoretical test time of the special test case is optimized according to the actual test time of the special test case to obtain the special test case with the optimized theoretical test time, the method further includes:
determining the special test case with the optimized theoretical test time in the project case library as a third test case;
and under the condition that the third test case meets the preset sharing requirement, sending the third test case to the sharing case library so that other project case libraries can quote the third test case from the sharing case library.
Optionally, after the theoretical test time of the second test case in the project case library is updated according to the optimized theoretical test time, the method further includes:
determining a test case to be archived in the shared case library according to a preset archiving requirement, and archiving the test case to be archived to a historical case library;
and determining the test cases with the same case identifiers as those of the test cases to be filed in the project case library as the test cases to be deleted, and deleting the test cases to be deleted in each project case library.
In a second aspect, the present invention provides a test case management apparatus, including:
the first acquisition module is used for acquiring the actual test time of a first test case based on the execution data of the first test case in the shared case library;
the first optimization module is used for optimizing the theoretical test time of the first test case according to the actual test time so as to obtain the optimized theoretical test time;
the first updating module is used for updating the theoretical test time of the second test case in the project case library according to the optimized theoretical test time; the project case library comprises test cases quoted from the shared case library, and the second test case is a test case corresponding to the first test case in the project case library.
Optionally, the first optimization module is specifically configured to:
calculating the latest average test time of the test case according to the actual test time and the historical average test time of the first test case;
determining a target difference value according to the difference value between the latest average test time and the theoretical test time of the first test case;
and under the condition that the target difference is larger than a preset difference threshold, optimizing the theoretical test time according to the latest average test time to obtain the optimized theoretical test time.
Optionally, the apparatus further comprises:
the second obtaining module is used for obtaining the execution times of the first test case based on the execution data of the first test case in the shared case library after the first obtaining module obtains the actual test time of the first test case based on the execution data of the first test case in the shared case library;
optionally, the first optimization module is further specifically configured to: optimizing the theoretical test time according to the latest average test time under the condition that the target difference is greater than a preset difference threshold and the execution times are greater than a preset time threshold so as to obtain the optimized theoretical test time;
optionally, the apparatus further comprises:
and the second updating module is used for optimizing the theoretical test time according to the latest average test time by the first optimizing module so as to update the preset time threshold according to the execution times after the optimized theoretical test time is obtained, so that the preset time threshold is larger than the execution times.
Optionally, the test case includes a case identifier, and the update module is specifically configured to:
determining a test case with the case identification identical to that of the first test case in the project case library as a second test case;
and updating the theoretical test time defined in the second test case according to the optimized theoretical test time to obtain the second test case with the updated theoretical test time.
Optionally, any one of the project case libraries includes test cases referenced from the shared case library and one or more dedicated test cases of the project case library, and the apparatus further includes:
the execution module is used for acquiring the execution data of the first test case in the shared case library by the first acquisition module, and executing the test task according to each test case in each project case library before the actual test time of the first test case so as to acquire the execution data of each test case; wherein the execution data comprises an actual test time;
and the second optimization module is used for optimizing the theoretical test time of the special test case according to the actual test time of the special test case so as to obtain the special test case with the optimized theoretical test time.
Optionally, the apparatus further comprises:
the determining module is used for optimizing the theoretical test time of the special test case by the second optimizing module according to the actual test time of the special test case to obtain the special test case with the optimized theoretical test time, and then determining the special test case with the optimized theoretical test time in the project case library as a third test case;
and the sharing module is used for sending the third test case to the shared case library under the condition that the third test case meets the preset sharing requirement so as to enable other project case libraries to quote the third test case from the shared case library.
Optionally, the apparatus further comprises:
the archiving module is used for determining the test case to be archived in the shared use case library according to a preset archiving requirement after the first updating module updates the theoretical testing time of the second test case in the project use case library according to the optimized theoretical testing time, and archiving the test case to be archived to the historical use case library;
and the deleting module is used for determining the test cases with the case identifications same as those of the test cases to be archived in the project case library as the test cases to be deleted and deleting the test cases to be deleted in each project case library.
In a third aspect, the present invention provides an electronic device comprising: the test case management system comprises a processor, a memory and a computer program which is stored on the memory and can run on the processor, wherein the processor realizes the test case management method when executing the program.
In a fourth aspect, the present invention provides a readable storage medium, wherein when instructions in the storage medium are executed by a processor of an electronic device, the electronic device is enabled to execute the test case management method.
In the embodiment of the invention, the actual test time of a first test case is obtained through the execution data based on the first test case in a shared case library; optimizing the theoretical test time of the first test case according to the actual test time to obtain the optimized theoretical test time; updating the theoretical test time of a second test case in the project case library according to the optimized theoretical test time; the project case library comprises test cases quoted from the shared case library, and the second test case is a test case corresponding to the first test case in the project case library. Therefore, the theoretical test time is optimized according to the actual test time of the test cases in the shared case library, the error between the set theoretical test time and the actual test time can be reduced, and the reference value of the theoretical test time is improved.
Meanwhile, compared with the method that an engineer sets theoretical test time for the test cases of a single project in the prior art, the method can conveniently and intensively manage the test cases of a plurality of projects based on the shared case library and the project case library, can reduce the time and labor cost for the engineer to design and maintain the test cases to a certain extent, and can also improve the test efficiency of the test projects, the management quality of the test cases and the information safety of test data. Furthermore, the theoretical test time of the corresponding test case in the project case library is synchronously updated according to the test case with the updated theoretical test time in the shared case library, so that the project test can be more reasonably performed on the server according to the test case in the project case library, and the continuous update and the perfection of the test case in each test project of a product line are facilitated.
Drawings
In order to more clearly illustrate the embodiments of the present invention or the technical solutions in the prior art, the drawings used in the description of the embodiments or the prior art will be briefly described below, and it is obvious that the drawings in the following description are some embodiments of the present invention, and those skilled in the art can also obtain other drawings according to the drawings without creative efforts.
FIG. 1 is a flowchart illustrating steps of a test case management method according to an embodiment of the present invention;
FIG. 2 is a flowchart illustrating steps of another test case management method according to an embodiment of the present invention;
FIG. 3 is a schematic diagram of a test case management architecture provided by an embodiment of the present invention;
FIG. 4 is a schematic diagram of a theoretical test time optimization process of a test case provided by an embodiment of the present invention;
fig. 5 is a structural diagram of a test case management apparatus according to an embodiment of the present invention;
fig. 6 is a block diagram of an electronic device according to an embodiment of the present invention.
Detailed Description
The technical solutions in the embodiments of the present invention will be clearly and completely described below with reference to the drawings in the embodiments of the present invention, and it is obvious that the described embodiments are some, not all, embodiments of the present invention. All other embodiments, which can be derived by a person skilled in the art from the embodiments given herein without making any creative effort, shall fall within the protection scope of the present invention.
Fig. 1 is a flowchart of steps of a test case management method according to an embodiment of the present invention, and as shown in fig. 1, the method may include:
step 101, acquiring actual test time of a first test case based on execution data of the first test case in a shared case library.
In the embodiment of the present invention, the test cases of each test item of the product line may be managed by establishing a shared case library, and the shared case library of the embodiment of the present invention may also be referred to as a baseline case library, which is not limited in this respect. The first test case may be a test case for a plurality of test items, where the test case may include pre-fabricated conditions, test inputs, execution steps, expected results, and the like. In the embodiment of the invention, after the test item carries out product test according to the test case, the execution data of the test case is generated. The execution data of the test cases in the shared example library is collected into the shared example library in real time for storage, so that an engineer can perform test data analysis on the dimension of the test cases based on the shared example library. The execution data includes an actual test result, an actual test time, an accumulated test frequency, and the like of the test case.
In the embodiment of the invention, the actual test time can be extracted from the execution data of the first test case stored in the shared case library. The actual test time refers to the time length from the start of a test case to the completion of the test. The key field of the extracted execution data is matched with the preset test time field, and the time value related to the matched key field is extracted as the actual test time. Of course, other methods may be used to obtain the actual test time, which is only illustrated here, and the embodiment of the present invention is not limited thereto.
And 102, optimizing the theoretical test time of the first test case according to the actual test time to obtain the optimized theoretical test time.
In the embodiment of the invention, a test design engineer estimates the theoretically required execution time of the test case when designing the test case as the theoretical test time of the test case. The theoretical test time is used as the basis for man-hour distribution when a test plan is made. The theoretical test time comprises theoretical manual test time and theoretical automatic test time, and the theoretical manual test time and the theoretical automatic test time are respectively used for manual test projects or automatic test projects.
In the embodiment of the invention, the theoretical test time can be optimized according to the actual test time of the first test case. The optimized theoretical test time can be obtained according to a preset time optimization algorithm. The time optimization algorithm includes calculating an optimized value of theoretical test time based on historical actual test time of the test case stored in the shared case library, and further determining the optimized theoretical test time according to the optimized value, which is only an example, and is not limited in this embodiment of the present invention.
103, updating the theoretical test time of a second test case in the project case library according to the optimized theoretical test time; the project case library comprises test cases quoted from the shared case library, and the second test case is a test case corresponding to the first test case in the project case library.
In the embodiment of the invention, the first test case in the shared case library can be used for testing a plurality of test items, and the test items manage the test cases of the test items through the case library for the items. The second test case is a test case that the project case library refers to from the shared case library. The second test case can confirm the corresponding first test case in the sharing case library through the unique identifier.
In the embodiment of the invention, after the first test case in the shared case library is optimized to the theoretical test time, the updating of the theoretical test time of the second test case corresponding to the first test case in the project case library is automatically triggered. The theoretical test time of the second test case may be modified to the optimized theoretical test time according to the optimized theoretical test time of the first test case, so that the second test case in the project case library is kept synchronous with the first test case in the sharing case library.
In the embodiment of the invention, the actual test time of a first test case is obtained through executing data based on the first test case in a shared case library; optimizing the theoretical test time of the first test case according to the actual test time to obtain the optimized theoretical test time; updating the theoretical test time of a second test case in the project case library according to the optimized theoretical test time; the project case library comprises test cases quoted from the shared case library, and the second test case is a test case corresponding to the first test case in the project case library. Therefore, compared with the method that an engineer sets theoretical test time for the test case of a single project in the prior art, the test cases of a plurality of projects can be conveniently managed in a centralized manner based on the shared case library and the project case library, the time and labor cost for the engineer to design and maintain the test cases can be reduced to a certain extent, and the test efficiency of the test projects, the management quality of the test cases and the information safety of test data can be improved. The theoretical test time is optimized according to the actual test time of the test cases in the sharing case library, so that the error between the set theoretical test time and the actual test time can be reduced, and the reference value of the theoretical test time is improved. Furthermore, the theoretical test time of the corresponding test case in the project case library is synchronously updated according to the test case with the updated theoretical test time in the shared case library, so that the project test can be more reasonably performed on the server according to the test case in the project case library, and the continuous update and the perfection of the test case in each test project of a product line are facilitated.
Fig. 2 is a flowchart of steps of another test case management method provided in an embodiment of the present invention, and as shown in fig. 2, the method may include:
step 201, obtaining the actual test time of the first test case based on the execution data of the first test case in the shared case library.
Specifically, the implementation manner of this step may refer to the foregoing related description, and is not described herein again.
Step 202, calculating the latest average test time of the test case according to the actual test time and the historical average test time of the first test case.
In the embodiment of the invention, after the actual test time of the first test case is obtained, the latest average test time can be calculated based on the historical average test time of the first test case stored in the sharing case library. After the execution data of the test case in the project case library is collected into the sharing case library, the average test time of the test case can be calculated according to the actual test time in the execution data and the accumulated execution times of the test case, and the average test time is stored in the sharing case library as the historical average test time.
In the embodiment of the invention, the historical total test time of the test case can be calculated according to the historical average test time and the historical accumulated execution times, and then the latest average test time can be calculated according to the historical total test time and the latest accumulated execution times. Of course, other methods may also be used to calculate the latest average test time, which is only an example and is not limited in this respect.
And 203, determining a target difference value according to the difference value between the latest average test time and the theoretical test time of the first test case.
In the embodiment of the invention, the difference between the latest average test time and the theoretical test time of the first test case can be made, and the difference between the latest average test time and the theoretical test time is taken as the target difference. Wherein the target difference is used to characterize the actual error of the latest average test time and the theoretical test time. Of course, a target difference coefficient may also be preset, and the target difference may be determined according to the preset target difference coefficient and the difference between the latest average test time and the theoretical test time. The embodiments of the present invention are not limited thereto, and the examples are only illustrative.
And 204, optimizing the theoretical test time according to the latest average test time under the condition that the target difference is larger than a preset difference threshold value so as to obtain the optimized theoretical test time.
In the embodiment of the invention, the preset difference threshold is used for representing the maximum error value of the acceptable latest average test time and theoretical test time. After the target difference is determined, the target difference may be compared with a preset difference threshold, and when the target difference is greater than the preset difference threshold, that is, the target exceeds the maximum error value, the theoretical test time is optimized according to the latest average test time to obtain the optimized theoretical test time.
In the embodiment of the invention, the theoretical test time can be modified into the latest average test time according to the latest average test time, so that the theoretical test time is optimized to be the latest average test time. Of course, a time optimization coefficient may also be preset, and the optimized theoretical test time is determined according to the preset time optimization coefficient and the latest average test time, which is only illustrated here by way of example, and the embodiment of the present invention is not limited thereto.
Step 205, updating the theoretical test time of the second test case in the project case library according to the optimized theoretical test time; the project case library comprises test cases quoted from the shared case library, and the second test case is a test case corresponding to the first test case in the project case library.
Specifically, the implementation manner of this step may refer to the foregoing related description, and is not described herein again.
In the embodiment of the invention, the actual test time of the first test case is obtained through the execution data based on the first test case in the shared case library. Calculating the latest average test time of the test case according to the actual test time and the historical average test time of the first test case; determining a target difference value according to the difference value between the latest average test time and the theoretical test time of the first test case; and under the condition that the target difference is larger than a preset difference threshold, optimizing the theoretical test time according to the latest average test time to obtain the optimized theoretical test time. Updating the theoretical test time of a second test case in the project case library according to the optimized theoretical test time; the project case library comprises test cases quoted from the shared case library, and the second test case is a test case corresponding to the first test case in the project case library. Therefore, compared with the method that engineers set theoretical test time for the test cases of a single project in the prior art, the method can conveniently manage the test cases of a plurality of projects based on the shared case library and the project case library.
And calculating the latest average test time according to the actual test time of the test cases in the sharing case library, determining a target difference value according to the latest average test time and the theoretical test time, and optimizing the theoretical test time according to the latest average test time under the condition that the target difference value is greater than a preset difference value threshold value so as to obtain the optimized theoretical test time. Therefore, based on the preset difference threshold value, the rationality and the optimization efficiency of the theoretical test time optimization can be improved, the error between the set theoretical test time and the actual test time can be reduced by optimizing the theoretical test time, and the reference value of the theoretical test time is improved. Furthermore, according to the test cases with the updated theoretical test time in the shared case library, the theoretical test time of the corresponding test cases in the project case library is synchronously updated, so that the project test can be more reasonably performed on the server according to the test cases in the project case library.
Optionally, after step 201, the method further includes:
step 301, obtaining the execution times of the first test case based on the execution data of the first test case in the shared case library.
In the embodiment of the invention, the execution times can be the accumulated test times of the tested items of the test cases after the test tasks are executed. The number of times of execution of the first test case may be extracted from the execution data of the first test case stored in the shared use case library. The key field of the extracted execution data is matched with the preset execution times field, and the times value related to the matched key field is extracted as the real execution times. Of course, other methods may also be used to obtain the execution times, which are only illustrated here, and the embodiment of the present invention is not limited thereto.
Optionally, step 204 may include the steps of:
2041, optimizing the theoretical test time according to the latest average test time under the condition that the target difference is greater than a preset difference threshold and the execution times are greater than a preset time threshold, so as to obtain the optimized theoretical test time.
In the embodiment of the invention, the preset number threshold is used for representing the minimum value of the sample capacity of the required execution number. The target difference value and the preset difference threshold value can be compared, the execution times and the preset time threshold value are respectively compared, and under the condition that the target difference value is larger than the preset difference threshold value and the execution times are larger than the preset time threshold value, the theoretical test time is optimized according to the latest average test time so as to obtain the optimized theoretical test time.
In the embodiment of the invention, the theoretical test time can be modified into the latest average test time according to the latest average test time, so that the theoretical test time is optimized to be the latest average test time. Of course, a time optimization coefficient may also be preset, and the optimized theoretical test time is determined according to the preset time optimization coefficient and the latest average test time, which are only described by way of example, and the embodiment of the present invention is not limited thereto.
Optionally, after step 2041, the method further includes:
step 302, updating the preset times threshold according to the execution times, so that the preset times threshold is larger than the execution times.
In the embodiment of the invention, after the theoretical test time is optimized under the condition that the execution times are greater than the preset time threshold, the preset time threshold of the test case needs to be updated, so that the preset time threshold is greater than the execution times of the current test case. The preset number threshold may be set to be N times of the execution number, or the preset threshold increase value may be set, and the preset number threshold is updated according to the threshold increase value and the execution number, which is only an example, and the embodiment of the present invention is not limited to this.
In the embodiment of the invention, the execution times of a first test case are obtained through executing data of the first test case in a sharing case library; optimizing the theoretical test time according to the latest average test time under the condition that the target difference is greater than a preset difference threshold and the execution times are greater than a preset time threshold so as to obtain the optimized theoretical test time; and updating the preset time threshold according to the execution times, so that the preset time threshold is larger than the execution times. Therefore, based on the preset frequency threshold value, the sample capacity of the execution frequency of the test case can be improved, and the optimization result of the theoretical test time is more accurate. Furthermore, the preset time threshold of the test case is updated according to the execution times, so that the preset time threshold can be flexibly adjusted, and the rationality and efficiency of optimization of theoretical test time are improved.
Optionally, the test case includes a case identifier, and step 205 may include the following steps:
and step 2051, determining the test case with the case identifier identical to the case identifier of the first test case in the project case library as a second test case.
In the embodiment of the invention, the test cases comprise case identifications, wherein the case identifications can be a group of serial numbers formulated according to a certain rule and used for distinguishing different test cases. It should be noted that the use case identifier in the embodiment of the present invention may also be referred to as a use case number, which is not limited in this embodiment of the present invention. The project case library comprises test cases quoted from the shared case library, and the test cases with the case identifications identical to the case identifications of the first test cases in the project case library can be determined as second test cases according to the unique case identifications.
And step 2052, updating the theoretical test time defined in the second test case according to the optimized theoretical test time to obtain the second test case with the updated theoretical test time.
In the embodiment of the invention, the theoretical test time defined in the second test case can be modified into the optimized theoretical test time according to the optimized theoretical test time of the first test case, so that the second test case in the project case library keeps synchronous with the first test case in the sharing case library to obtain the second test case with the updated theoretical test time. Of course, other methods may also be used to optimize the theoretical test time of the second test case, which is only an example and is not limited in this embodiment of the present invention.
In the embodiment of the invention, the test case with the case identifier same as that of the first test case in the project case library is determined as the second test case; and updating the theoretical test time defined in the second test case according to the optimized theoretical test time to obtain the second test case with the updated theoretical test time. Therefore, the theoretical test time of the second test case with the same case identification in the project case library can be synchronously updated according to the first test case with the updated theoretical test time in the sharing case library, and the project test can be more reasonably performed on the server according to the test case in the project case library.
Optionally, any one of the project case libraries includes a test case referenced from the shared case library and one or more dedicated test cases of the project case library, and before step 201, the method further includes:
step 303, executing a test task according to each test case in each project case library to obtain execution data of each test case; wherein the execution data includes an actual test time.
In the embodiment of the invention, a plurality of project case libraries can be constructed according to a plurality of test projects, and any project case library comprises test cases quoted from a shared case library and special test cases of one or more project case libraries. The special test case may be a test case designed by a test design engineer for a test project to which the project case library belongs.
In the embodiment of the invention, a test task is formulated according to each test case in each project case library, and the test task is executed to carry out project test on a product so as to obtain the execution data of each test case; the execution data comprises the actual test time of the test case in the test task. The execution data of the test cases in the project case base is stored in the project case base, so that an engineer can perform test data analysis on the dimension of the test project based on the project case base. The test tasks may include test cases, task man-hours, and the like.
And 304, optimizing the theoretical test time of the special test case according to the actual test time of the special test case to obtain the special test case with the optimized theoretical test time.
In the embodiment of the invention, the theoretical test time can be optimized according to the actual test time of the special test case. The optimized theoretical test time can be obtained according to a preset time optimization algorithm. The time optimization algorithm includes calculating an optimized value of theoretical test time based on historical actual test time of the special test case stored in the project case library, and further determining the optimized theoretical test time according to the optimized value, which is only an example, and is not limited in this embodiment of the present invention.
Optionally, after step 304, the method further includes:
step 401, determining the special test case with the optimized theoretical test time in the project case library as a third test case.
In the embodiment of the invention, the special test case with the optimized theoretical test time in the project case library can be determined as the third test case. The third test case may be a test case that can be used for other test items, and the third test case includes a case identifier.
Step 402, under the condition that the third test case meets the preset sharing requirement, sending the third test case to the sharing case library so that other project case libraries can refer to the third test case from the sharing case library.
In the embodiment of the present invention, the preset sharing requirement may be that the content of the preset condition, the test data, the test step, or the expected result of the third test case has a reference value for other test items. And under the condition that the third test case meets the preset sharing requirement, sending the third test case to a sharing case library, wherein the sharing case library stores the third test case for other project case libraries to quote the third test case from the sharing case library.
In the embodiment of the invention, the special test case with the optimized theoretical test time in the project case library is determined as a third test case; and under the condition that the third test case meets the preset sharing requirement, sending the third test case to the sharing case library so that other project case libraries can quote the third test case from the sharing case library. Therefore, the test cases which have reference values for other test items in the project case library can be classified into the shared case library, so that the other project case libraries can refer to the test cases from the shared case library. The cost of test case design and maintenance of a test design engineer can be reduced, and the test efficiency of the whole product test line is improved.
Optionally, after step 205, the method further includes:
step 403, determining the test cases to be archived in the shared use case library according to a preset archiving requirement, and archiving the test cases to be archived to the historical use case library.
In the embodiment of the present invention, the preset filing requirement may be that the test case loses a reference value, or that a function of performing a test through the test case is cancelled, which is only an example, and the embodiment of the present invention is not limited thereto. In the embodiment of the invention, a historical case library can be constructed, wherein the historical case library is used for storing the archived test cases. The test cases meeting the preset filing requirement in the shared case library can be determined as the test cases to be filed, and the test cases to be filed are sent to the historical case library for storage, so that an engineer can analyze historical test data based on the historical case library.
Step 404, determining the test cases with the same case identifiers as those of the test cases to be archived in the project case library as the test cases to be deleted, and deleting the test cases to be deleted in each project case library.
In the embodiment of the invention, after the shared case library determines the test cases to be archived, the test cases with the same case identifications can be searched in each project case library according to the case identifications of the test cases to be archived, and the test cases with the same case identifications as the case identifications of the test cases to be archived in the project case library are determined as the test cases to be deleted. And deleting the test cases to be deleted in each project case library, so that the test cases to be deleted are not executed by the test projects to which the project case libraries belong.
In the embodiment of the invention, the test cases to be archived in the shared case library are determined according to the preset archiving requirement, and the test cases to be archived are archived to the historical case library; and determining the test cases with the same case identifiers as those of the test cases to be filed in the project case library as the test cases to be deleted, and deleting the test cases to be deleted in each project case library. Therefore, the test cases meeting the filing requirement in the shared case library and the project case library can be synchronously filed, the test cases meeting the filing requirement are not executed any more conveniently for each test project, and the rationality of the test projects can be improved.
It should be noted that the embodiment of the present invention can preset a time optimization algorithm based on the idea of neural learning, and optimize the theoretical test time of the test case through intelligent data analysis. The preset time optimization algorithm may include: and triggering and calculating the latest average test time of the test case in real time after the test case is executed, and recording the execution times and the average test time of the test case according to the case identification. Specifically, the latest average test time of the test case is calculated according to the actual test time and the historical average test time of the test case. And determining a target difference value according to the difference value between the latest average test time and the theoretical test time of the test case, and acquiring the execution times of the test case based on the execution data of the test case. And under the condition that the target difference is greater than a preset difference threshold and the execution times are greater than a preset time threshold, optimizing the theoretical test time according to the latest average test time to obtain the optimized theoretical test time. And updating the preset time threshold according to the execution times, so that the preset time threshold is larger than the execution times. Therefore, the maintenance quality of the theoretical test time can be improved, and more accurate man-hour reference is provided for engineers to make test plans.
It should be noted that, in the prior art, each test item generally adopts an offline mode to independently manage test cases, which is dispersed for the test case management of each test item in a product test line, and there are human operation errors and risks of information leakage. In addition, for the same or similar test cases which can be used by different test projects, if the test design engineers of each test project design the test cases independently, the problem of wasting manpower and time cost exists.
Exemplarily, fig. 3 is a schematic diagram of a test case management architecture provided by an embodiment of the present invention, and the embodiment of the present invention is based on a distributed Springboot microserver architecture, adopts JAVA language for development, deploys Mysql data storage at a back end, and builds a server test case intelligent management platform based on data sharing. As shown in fig. 3, the server test case intelligent management platform according to the embodiment of the present invention includes a shared use case library and a project use case library, and the shared use case library may trigger corresponding operations in response to events in which a test case is referred to, the test case is filed, and the test case is updated. And under the condition that the project case library sends a request for referring to the test cases in the shared case library to the shared case library, the shared case library responds to the request and sends the test cases required by the project case library to the project case library so as to carry out project testing on the project case library. And under the condition that the test cases in the shared case library are updated, triggering the sub-thread of the server test case intelligent management platform to automatically update the test cases with the same case identifiers in the project case library. And under the condition that the test cases in the shared case library are filed, triggering the sub-thread to synchronously file the test cases with the same case identifications in the project case library. The sub-thread is an internal program of a server test case intelligent management platform developed based on JAVA language, and has the main function of synchronously updating and archiving test cases with the same case identifiers in a shared case library and a project case library. In addition, the test cases with high multiplexing value on other test items in the project case library can be classified into the shared case library by one key, so that other test items can refer to the test cases from the shared case library. For example, the project case library may be provided with a sharing control, the sharing control is used for receiving a first input of a test engineer, and the project case library responds to the first input and sends the test cases in the project case library to the sharing case library. The first input may include a use case identifier input by an engineer, which is only an example, and the embodiment of the present invention is not limited thereto.
Compared with the traditional test case maintenance management method, the offline management is converted into the online system management, so that the test project operation is simplified, errors caused by manual operation can be reduced, and the safety of test key information can be improved. By establishing the shared case library as the common test case library of the server product line, the test cases can be conveniently quoted from the shared case library by each test item. Moreover, the test cases of the shared case library generate updating or filing events, and the corresponding test cases in the project case library are automatically triggered and updated, so that the labor cost for designing and maintaining the test cases of each test project can be reduced, and the management efficiency of the test cases is improved. Compared with the method for maintaining the cases through personal experience in the prior art, the method for managing the test cases disclosed by the embodiment of the invention is based on the continuous accumulation of the execution data of the test cases, and introduces the thinking of machine learning and intelligent analysis to set a time optimization algorithm to optimize the theoretical test time of the volume number cases, so that the quality of management and maintenance of the test cases of the server can be improved, and further, more accurate man-hour reference is provided for the formulation of a test plan, thereby forming a test case intelligent management strategy and technology which can be closed-loop and can be continuously optimized.
Exemplarily, fig. 4 is a schematic diagram of a theoretical test time optimization process of a test case provided by an embodiment of the present invention, and as shown in fig. 4, each test item formulates a test task based on the test case in a respective item case library, executes the test task to obtain execution data of the test case, and accumulates the test execution data. The sharing example library collects the execution data of the test cases in real time and obtains the actual test time. And calculating the latest average test time of the test case according to the actual test time based on a preset time optimization algorithm. And based on a preset difference threshold and a preset frequency threshold, determining the optimization time of the theoretical test time according to the target difference of the theoretical test time of the test case and the execution frequency of the test case, and automatically triggering the shared case library to optimize the theoretical test time according to the latest average test time.
Fig. 5 is a structural diagram of a test case management apparatus according to an embodiment of the present invention, where the apparatus 50 may include:
a first obtaining module 501, configured to obtain actual test time of a first test case based on execution data of the first test case in a shared case library;
a first optimizing module 502, configured to optimize theoretical test time of the first test case according to the actual test time to obtain optimized theoretical test time;
a first updating module 503, configured to update the theoretical test time of the second test case in the project case library according to the optimized theoretical test time; the project case library comprises test cases quoted from the shared case library, and the second test case is a test case corresponding to the first test case in the project case library.
Optionally, the first optimization module 502 is specifically configured to:
calculating the latest average test time of the test case according to the actual test time and the historical average test time of the first test case;
determining a target difference value according to the difference value between the latest average test time and the theoretical test time of the first test case;
and under the condition that the target difference is larger than a preset difference threshold, optimizing the theoretical test time according to the latest average test time to obtain the optimized theoretical test time.
Optionally, the apparatus 50 further includes:
a second obtaining module, configured to, after the first obtaining module 501 obtains the actual test time of the first test case based on the execution data of the first test case in the shared case library, obtain the execution times of the first test case based on the execution data of the first test case in the shared case library;
optionally, the first optimization module 502 is further specifically configured to: optimizing the theoretical test time according to the latest average test time under the condition that the target difference is greater than a preset difference threshold and the execution times are greater than a preset time threshold so as to obtain the optimized theoretical test time;
optionally, the apparatus 50 further includes:
a second updating module, configured to optimize the theoretical test time according to the latest average test time by the first optimization module 502, so as to obtain the optimized theoretical test time, and update the preset number threshold according to the execution number, so that the preset number threshold is greater than the execution number.
Optionally, the test case includes a case identifier, and the update module is specifically configured to:
determining a test case with the case identification identical to that of the first test case in the project case library as a second test case;
and updating the theoretical test time defined in the second test case according to the optimized theoretical test time to obtain the second test case with the updated theoretical test time.
Optionally, any one of the project case libraries includes a test case referenced from the shared case library and one or more dedicated test cases of the project case library, and the apparatus 50 further includes:
an execution module, configured to, based on the execution data of the first test case in the shared case library, the first obtaining module 501 obtains, before the actual test time of the first test case, a test task according to each test case in each project case library to obtain the execution data of each test case; wherein the execution data includes an actual test time;
and the second optimization module is used for optimizing the theoretical test time of the special test case according to the actual test time of the special test case so as to obtain the special test case with the optimized theoretical test time.
Optionally, the apparatus 50 further includes:
the determining module is used for optimizing the theoretical test time of the special test case by the second optimizing module according to the actual test time of the special test case to obtain the special test case with the optimized theoretical test time, and then determining the special test case with the optimized theoretical test time in the project case library as a third test case;
and the sharing module is used for sending the third test case to the sharing case library under the condition that the third test case meets the preset sharing requirement so as to be used by other project case libraries to refer to the third test case from the sharing case library.
Optionally, the apparatus 50 further includes:
the filing module is configured to determine the test case to be filed in the shared case library according to a preset filing requirement after the first updating module 503 updates the theoretical test time of the second test case in the project case library according to the optimized theoretical test time, and file the test case to be filed to the historical case library;
and the deleting module is used for determining the test cases with the case identifications same as those of the test cases to be archived in the project case library as the test cases to be deleted and deleting the test cases to be deleted in each project case library.
The present invention also provides an electronic device, see fig. 6, including: a processor 601, a memory 602, and a computer program 6021 stored on the memory and executable on the processor, which when executed by the processor implements the test case management method of the foregoing embodiments.
The invention also provides a readable storage medium, and when instructions in the storage medium are executed by a processor of the electronic device, the electronic device is enabled to execute the test case management method of the foregoing embodiment.
For the device embodiment, since it is basically similar to the method embodiment, the description is simple, and for the relevant points, refer to the partial description of the method embodiment.
The algorithms and displays presented herein are not inherently related to any particular computer, virtual machine, or other apparatus. The required structure for constructing such a system will be apparent from the description above. Moreover, the present invention is not directed to any particular programming language. It is appreciated that a variety of programming languages may be used to implement the teachings of the present invention as described herein, and any descriptions of specific languages are provided above to disclose the best mode of the invention.
In the description provided herein, numerous specific details are set forth. It is understood, however, that embodiments of the invention may be practiced without these specific details. In some instances, well-known methods, structures and techniques have not been shown in detail in order not to obscure an understanding of this description.
Similarly, it should be appreciated that in the foregoing description of exemplary embodiments of the invention, various features of the invention are sometimes grouped together in a single embodiment, figure, or description thereof for the purpose of streamlining the disclosure and aiding in the understanding of one or more of the various inventive aspects. However, the disclosed method should not be construed to reflect the intent: that the invention as claimed requires more features than are expressly recited in each claim. Rather, as the following claims reflect, inventive aspects lie in less than all features of a single foregoing disclosed embodiment. Thus, the claims following the detailed description are hereby expressly incorporated into this detailed description, with each claim standing on its own as a separate embodiment of this invention.
Those skilled in the art will appreciate that the modules in the device in an embodiment may be adaptively changed and disposed in one or more devices different from the embodiment. The modules or units or components of the embodiments may be combined into one module or unit or component, and furthermore they may be divided into a plurality of sub-modules or sub-units or sub-components. All of the features disclosed in this specification (including any accompanying claims, abstract and drawings), and all of the processes or elements of any method or apparatus so disclosed, may be combined in any combination, except combinations where at least some of such features and/or processes or elements are mutually exclusive. Each feature disclosed in this specification (including any accompanying claims, abstract and drawings) may be replaced by alternative features serving the same, equivalent or similar purpose, unless expressly stated otherwise.
The various component embodiments of the invention may be implemented in hardware, or in software modules running on one or more processors, or in a combination thereof. It will be appreciated by those skilled in the art that a microprocessor or Digital Signal Processor (DSP) may be used in practice to implement some or all of the functions of some or all of the components in a sequencing device according to the present invention. The present invention may also be embodied as an apparatus or device program for carrying out a portion or all of the methods described herein. Such programs implementing the present invention may be stored on computer-readable media or may be in the form of one or more signals. Such a signal may be downloaded from an internet website or provided on a carrier signal or in any other form.
It should be noted that the above-mentioned embodiments illustrate rather than limit the invention, and that those skilled in the art will be able to design alternative embodiments without departing from the scope of the appended claims. In the claims, any reference signs placed between parentheses shall not be construed as limiting the claim. The word "comprising" does not exclude the presence of elements or steps not listed in a claim. The word "a" or "an" preceding an element does not exclude the presence of a plurality of such elements. The invention may be implemented by means of hardware comprising several distinct elements, and by means of a suitably programmed computer. In the unit claims enumerating several means, several of these means may be embodied by one and the same item of hardware. The usage of the words first, second and third, etcetera do not indicate any ordering. These words may be interpreted as names.
It is clear to those skilled in the art that, for convenience and brevity of description, the specific working processes of the above-described systems, apparatuses and units may refer to the corresponding processes in the foregoing method embodiments, and are not described herein again.
The above description is only for the purpose of illustrating the preferred embodiments of the present invention and is not to be construed as limiting the invention, and any modifications, equivalents and improvements made within the spirit and principle of the present invention are intended to be included within the scope of the present invention.
The above description is only for the specific embodiments of the present invention, but the scope of the present invention is not limited thereto, and any person skilled in the art can easily think of the changes or substitutions within the technical scope of the present invention, and shall cover the scope of the present invention. Therefore, the protection scope of the present invention shall be subject to the protection scope of the claims.
It should be noted that, in the embodiments of the present application, the various data related processes are performed under the premise of complying with the data protection regulation policy corresponding to the country of the location, and obtaining the authorization given by the owner of the corresponding device.

Claims (10)

1. A test case management method, the method comprising:
acquiring actual test time of a first test case based on execution data of the first test case in a shared case library;
optimizing the theoretical test time of the first test case according to the actual test time to obtain the optimized theoretical test time;
updating the theoretical test time of a second test case in the project case library according to the optimized theoretical test time; the project case library comprises test cases quoted from the shared case library, and the second test case is a test case corresponding to the first test case in the project case library.
2. The method of claim 1, wherein optimizing the theoretical test time of the first test case according to the actual test time to obtain an optimized theoretical test time comprises:
calculating the latest average test time of the test case according to the actual test time and the historical average test time of the first test case;
determining a target difference value according to the difference value between the latest average test time and the theoretical test time of the first test case;
and under the condition that the target difference is larger than a preset difference threshold, optimizing the theoretical test time according to the latest average test time to obtain the optimized theoretical test time.
3. The method of claim 2, wherein after obtaining the actual test time of the first test case based on the execution data of the first test case in the shared use case library, the method further comprises:
acquiring the execution times of a first test case based on the execution data of the first test case in a sharing case library;
and when the target difference is greater than a preset difference threshold, optimizing the theoretical test time according to the latest average test time to obtain the optimized theoretical test time, including:
optimizing the theoretical test time according to the latest average test time under the condition that the target difference is greater than a preset difference threshold and the execution times are greater than a preset time threshold so as to obtain the optimized theoretical test time;
after the optimizing the theoretical test time according to the latest average test time to obtain the optimized theoretical test time, the method further includes:
and updating the preset time threshold according to the execution times, so that the preset time threshold is larger than the execution times.
4. The method according to any one of claims 1 to 3, wherein the test case includes a case identifier, and the updating the theoretical test time of the second test case in the project case library according to the optimized theoretical test time includes:
determining a test case with the case identification identical to that of the first test case in the project case library as a second test case;
and updating the theoretical test time defined in the second test case according to the optimized theoretical test time to obtain the second test case with the updated theoretical test time.
5. The method of claim 1, wherein any one of the project case libraries comprises a test case referenced from the shared case library and one or more dedicated test cases of the project case library, and wherein the method further comprises, before obtaining an actual test time of a first test case based on execution data of the first test case in the shared case library, the method further comprises:
executing a test task according to each test case in each project case library to obtain the execution data of each test case; wherein the execution data comprises an actual test time;
and optimizing the theoretical test time of the special test case according to the actual test time of the special test case to obtain the special test case with the optimized theoretical test time.
6. The method of claim 5, wherein after the optimizing the theoretical test time of the special test case according to the actual test time of the special test case to obtain the special test case with the optimized theoretical test time, the method further comprises:
determining the special test case with the optimized theoretical test time in the project case library as a third test case;
and under the condition that the third test case meets the preset sharing requirement, sending the third test case to the sharing case library so that other project case libraries can quote the third test case from the sharing case library.
7. The method of claim 1, wherein after updating the theoretical test time of the second test case in the project case library according to the optimized theoretical test time, the method further comprises:
determining a test case to be archived in the shared case library according to a preset archiving requirement, and archiving the test case to be archived to a historical case library;
and determining the test cases with the same case identifiers as those of the test cases to be archived in the project case library as the test cases to be deleted, and deleting the test cases to be deleted in each project case library.
8. A test case management apparatus, the apparatus comprising:
the first acquisition module is used for acquiring the actual test time of a first test case based on the execution data of the first test case in the shared case library;
the first optimization module is used for optimizing the theoretical test time of the first test case according to the actual test time so as to obtain the optimized theoretical test time;
the first updating module is used for updating the theoretical test time of the second test case in the project case library according to the optimized theoretical test time; the project case library comprises test cases quoted from the shared case library, and the second test case is a test case corresponding to the first test case in the project case library.
9. An electronic device, comprising:
a processor, a memory, and a computer program stored on the memory and executable on the processor, wherein the processor implements the test case management method of any of claims 1-7 when executing the program.
10. A readable storage medium, wherein instructions in the storage medium, when executed by a processor of an electronic device, enable the electronic device to perform the test case management method of one or more of claims 1-7.
CN202211293639.4A 2022-10-21 2022-10-21 Test case management method and device, electronic equipment and readable storage medium Pending CN115658402A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202211293639.4A CN115658402A (en) 2022-10-21 2022-10-21 Test case management method and device, electronic equipment and readable storage medium

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202211293639.4A CN115658402A (en) 2022-10-21 2022-10-21 Test case management method and device, electronic equipment and readable storage medium

Publications (1)

Publication Number Publication Date
CN115658402A true CN115658402A (en) 2023-01-31

Family

ID=84990126

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202211293639.4A Pending CN115658402A (en) 2022-10-21 2022-10-21 Test case management method and device, electronic equipment and readable storage medium

Country Status (1)

Country Link
CN (1) CN115658402A (en)

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN115964305A (en) * 2023-03-16 2023-04-14 广州嘉为科技有限公司 Cross-project test case library management method and device and storage medium

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN115964305A (en) * 2023-03-16 2023-04-14 广州嘉为科技有限公司 Cross-project test case library management method and device and storage medium

Similar Documents

Publication Publication Date Title
CN112215374A (en) Method, system, equipment and medium for checking medium and long term maintenance plan of power grid
CN110457175B (en) Service data processing method and device, electronic equipment and medium
CN106874483A (en) A kind of device and method of the patterned quality of data evaluation and test based on big data technology
CN108763093A (en) A kind of automated testing method and system
CN112306877B (en) Power system fault operation and maintenance method and system
CN113221362B (en) Satellite launching field performance test subject purpose selection method and device and electronic equipment
CN115658402A (en) Test case management method and device, electronic equipment and readable storage medium
CN110377519B (en) Performance capacity test method, device and equipment of big data system and storage medium
CN111859139A (en) Application program recommendation method and device, computing equipment and medium
CN116054910B (en) Fault analysis and device for earth station equipment based on knowledge graph construction
CN112559525A (en) Data checking system, method, device and server
CN111737233A (en) Data monitoring method and device
CN111104184A (en) Method and device for online loading and unloading of comprehensive traffic operation monitoring indexes
CN113722141B (en) Method and device for determining delay reason of data task, electronic equipment and medium
CN113448747B (en) Data transmission method, device, computer equipment and storage medium
CN113793063A (en) Method and device for detecting conflict of power distribution network planning project schemes
CN113677583B (en) Graph calculation-based vehicle driving data processing method and device and computer equipment
CN113986495A (en) Task execution method, device, equipment and storage medium
CN112667512A (en) Data drive test method, device, equipment and computer readable storage medium
CN115907830B (en) Policy execution method, device, equipment and readable medium based on index early warning
CN115686583B (en) Mass Internet of things equipment upgrading method and device, electronic equipment and storage medium
CN117076141B (en) High-applicability off-line data processing task issuing method and system
CN115865751B (en) Fault detection method and device based on polymorphic data
CN115965228A (en) Engineering intelligent evaluation method, system and device based on big data and storage medium
CN115936294A (en) Equipment health management analysis method and terminal

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination