Test case scheduling method and electronic equipment
By grouping and processing based on the specification configuration information of test cases and test equipment, reasonable scheduling of test cases is achieved, the problems of waste of resources and high test costs are solved, resource utilization is improved and testing costs are reduced.
Patent Information
- Application Number
- CN202410804573.3
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2024-06-20
- Publication Date
- 2025-04-22
- Estimated Expiration
- 2044-06-20
AI Technical Summary
During the testing process of operating system, the scheduling methods of test cases in the prior art lead to waste of resources of test equipment and high testing costs, and cannot effectively reduce resource waste and testing costs.
By obtaining the specification configuration requirements information of each test case and the specification configuration information of the idle test equipment, the test cases are grouped to form the target use case set that each idle test equipment needs to execute, and send it to the corresponding test equipment.
This method can make full use of the resources of each test device, improve resource utilization, reduce test costs, and reduce resource waste, without configuring the highest specifications for each test device.
Smart Images

Figure CN118838808B_ABST
Abstract
Description
Technical Field
[0001] The embodiments of the present application relate to the technical field of computing devices, and more particularly to a test case scheduling method and electronic device. Background Art
[0002] During the development or maintenance of an operating system, in order to ensure the stability and reliability of the operating system and improve the quality of the operating system and user experience, it is usually necessary to conduct a comprehensive test on the operating system. During the testing, the test cases in the test task are scheduled.
[0003] In the related art, when scheduling test cases in a test task, the test cases are generally randomly assigned to each test device for task execution based on the number of available test devices. In order to ensure that all test cases can be executed normally, each test device needs to be configured to the highest specification, which not only increases the test cost, but also leads to serious waste of resources.
[0004] Therefore, how to reasonably schedule test cases to reduce testing costs and reduce the waste of test equipment resources has become an urgent problem to be solved. Summary of the invention
[0005] The embodiments of the present application provide a test case scheduling method and an electronic device, which can reduce the test cost and reduce the waste of test equipment resources by reasonably scheduling the test cases.
[0006] In a first aspect, an embodiment of the present application provides a method for scheduling a test case, the method comprising:
[0007] Obtaining specification configuration requirement information of each test case and specification configuration information of idle test equipment; wherein the specification configuration requirement information represents the specification configuration requirement of the test case for the test equipment;
[0008] According to the specification configuration requirement information and the specification configuration information, each of the test cases is grouped and processed to obtain a target use case set that each idle test device needs to execute; wherein the target use case set includes a first category of use cases and / or a second category of use cases, the first category of use cases are test cases whose specification configuration requirements are consistent with the specification configuration information of the idle test device, and the second category of use cases are test cases whose specification configuration requirements are lower than the specification configuration information of the idle test device;
[0009] The target use case set is sent to a corresponding idle test device; wherein the idle test device is used to execute the test cases in the target use case set.
[0010] The beneficial effects of this embodiment are as follows: test cases are grouped and processed according to the specification configuration requirement information of the test cases and the specification configuration information of the idle test devices, so that the test cases can be assigned to appropriate test devices, thereby making full use of the resources of each test device and improving resource utilization. There is no need to equip each test device with the highest specification configuration, which reduces testing costs and reduces resource waste.
[0011] In a possible implementation, the test cases are grouped according to the specification configuration requirement information and the specification configuration information to obtain a target test case set that each idle test device needs to execute, including:
[0012] Matching the specification configuration requirement information of the test case with the specification configuration information of each idle test device;
[0013] If it is determined that there is an idle test device whose specification configuration information is consistent with the specification configuration requirement of the test case, the test case is allocated to the initial test case set of the idle test device;
[0014] If it is determined that there is no idle test device whose specification configuration information is consistent with the specification configuration requirement of the test case, the test case is allocated to an initial test case set of idle test devices whose specification configuration information is higher than the specification configuration requirement of the test case;
[0015] Based on the initial use case set of the idle test device, determine the target use case set that the idle test device needs to execute.
[0016] The beneficial effects of this implementation method are as follows: based on the specification configuration requirement information of the test case and the specification configuration information of the idle test equipment, each test case is adaptively grouped and processed. Ideally, each batch of test cases with different specification configuration requirements can find the corresponding test equipment specifications for case execution. When there is no corresponding test equipment specification, a test equipment containing this specification can also be found. In this way, a machine environment that can meet the specification configuration requirements of this batch of test cases can be found eventually, making full use of the existing test equipment so that test equipment of each specification configuration can be utilized, greatly improving resource utilization. Grouping and division according to the specification configuration required by the use case eliminates the need to configure each test equipment to the highest specification, thus reducing resource waste and lowering testing costs.
[0017] In a possible implementation, determining a target use case set that the idle test device needs to execute according to the initial use case set of the idle test device includes:
[0018] An initial use case set of an idle test device is determined, which is a target use case set that the idle test device needs to execute.
[0019] The beneficial effect of this implementation method is: directly determining the initial use case set of the idle test device as the target use case set that the idle test device needs to execute, which can reduce the scheduling time and thus improve the test efficiency.
[0020] In a possible implementation, determining a target use case set that the idle test device needs to execute according to the initial use case set of the idle test device includes:
[0021] Determine the number of test cases in the initial use case set of each idle test device, and determine the difference between the number of test cases in the initial use case set of the first test device and the number of test cases in the initial use case set of the second test device; wherein the specification configuration information of the first test device is less than the specification configuration information of the second test device, and the specification configuration information of the first test device is adjacent to the specification configuration information of the second test device;
[0022] If it is determined that the difference is greater than a preset value, part of the test cases in the initial test case set of the first test device is allocated to the initial test case set of the second test device to obtain the target test case set that the idle test device needs to execute.
[0023] The beneficial effect of this implementation method is as follows: by adjusting the number of test cases required to be executed by each test device according to the difference in the number of test cases required to be executed by each test device, the test cases required to be executed by each idle test device can be relatively balanced, thereby improving the test efficiency.
[0024] In a possible implementation manner, allocating some test cases in the initial test case set of the first test device to the initial test case set of the second test device includes:
[0025] The second type of use cases in the initial use case set of the first test device are allocated to the initial use case set of the second test device.
[0026] The beneficial effect of this implementation method is: when performing secondary allocation, the second type of use cases in this use case set are allocated to other test devices, so that this test device still mainly executes the test cases that match it, the matching degree is higher, and the test effect is more in line with the test requirements.
[0027] In a possible implementation, obtaining specification configuration information of an idle test device includes:
[0028] The Internet Protocol (IP) address information of the idle test device is obtained, and the idle test device is accessed through the IP address information of the idle test device to obtain the specification configuration information of the idle test device.
[0029] The beneficial effects of this implementation method are as follows: by accessing the test device through its IP address to obtain preset specification information of the test device, the timeliness of the specification configuration information can be improved, as well as the accuracy of the specification configuration information of the test device. When the specification information of the test device changes, the device can also be accessed through the corresponding IP address to obtain new specification configuration information.
[0030] In a possible implementation manner, before sending the target use case set to the corresponding idle test device, the method further includes:
[0031] The test time requirements of the test cases in the target use case set are obtained, and the test sequence of the test cases in the target use case set is adjusted according to the test time requirements.
[0032] The beneficial effects of this implementation are as follows: the test order of the test cases in the target case set is adjusted according to the test time requirements, so that the test cases can be executed at the specified time, thereby meeting the test requirements and improving user satisfaction with the test.
[0033] In a possible implementation, the method further includes:
[0034] Receive execution result information fed back by the idle test device; wherein the execution result information represents the execution result of the test case in the target test case set executed by the idle test device;
[0035] When the execution result indicates that the execution fails, a log request message is sent to the idle test device; wherein the log request message is used to instruct the idle test device to feed back a running log when executing the test case;
[0036] The operation log is received.
[0037] The beneficial effects of this implementation method are as follows: by obtaining the execution result information, the tester can clearly know the execution status of the test case, so as to better control the execution of the test task; according to the operation log, the cause of the test failure can also be better analyzed, so as to respond faster and better, so as to improve the execution efficiency of the test task.
[0038] In a possible implementation, the method further includes:
[0039] Analyze and process the operation log to obtain the reason why the idle test device fails to execute the test case;
[0040] The reason is sent to the tester via a preset data transmission method; wherein the preset data transmission method includes one or more of the following: e-mail, file transfer protocol, hypertext transfer protocol.
[0041] The beneficial effects of this implementation method are as follows: the scheduling device of the test case performs analysis on the cause of the exception, reducing the workload of the tester; sending the cause of the exception to the tester allows the tester to quickly know the cause of the exception in different ways, so that the tester can respond more quickly, thereby improving the execution efficiency of the test task and providing users with a better testing experience.
[0042] In a possible implementation, obtaining specification configuration requirement information for each test case includes:
[0043] The requirement document of each test case in the test case management system is traversed and analyzed to obtain the specification configuration requirement information of each test case; wherein the requirement document includes the specification configuration requirement information of the test case.
[0044] The beneficial effect of this implementation method is that the specification and configuration requirement information of each test case can be quickly obtained by traversing and analyzing the requirement document. Compared with manually inputting the specification and configuration requirement information of each test case, it has a higher degree of automation and a faster speed.
[0045] In a second aspect, an embodiment of the present application further provides an electronic device, the electronic device comprising: a processor, and a memory communicatively connected to the processor;
[0046] The memory stores computer-executable instructions;
[0047] The processor executes the computer-executable instructions stored in the memory to implement the test case scheduling method described in any one of the first aspects.
[0048] The beneficial effects of this embodiment are as follows: when the processor executes the test case scheduling method described in any one of the first aspects, it groups and processes each test case according to the specification configuration requirement information of the test case and the specification configuration information of the idle test equipment, so as to allocate the test case to the appropriate test equipment, thereby making full use of the resources of each test equipment and improving resource utilization. In addition, there is no need to equip each test equipment with the highest specification configuration, thereby reducing testing costs and reducing resource waste. BRIEF DESCRIPTION OF THE DRAWINGS
[0049] In order to more clearly illustrate the technical solutions in the embodiments of the present application or the related technologies, the following is a brief introduction to the drawings required for use in the embodiments or the related technical descriptions. Obviously, the drawings described below are some embodiments of the present application. For ordinary technicians in this field, other drawings can be obtained based on these drawings without paying creative labor.
[0050] Figure 1A flowchart of a method for scheduling a test case provided in an embodiment of the present application;
[0051] Figure 2 A schematic diagram of an architecture for grouping test cases provided in an embodiment of the present application;
[0052] Figure 3 A flowchart of another test case scheduling method provided in an embodiment of the present application;
[0053] Figure 4 A schematic diagram of the structure of a scheduling device for a test case provided in an embodiment of the present application;
[0054] Figure 5 A schematic structural diagram of an electronic device is provided for an embodiment of the present application. DETAILED DESCRIPTION
[0055] In order to make the purpose, technical solution and advantages of the embodiments of the present application clearer, the technical solution in the embodiments of the present application will be clearly and completely described below in conjunction with the drawings in the embodiments of the present application. Obviously, the described embodiments are part of the embodiments of the present application, not all of the embodiments. Based on the embodiments in the present application, all other embodiments made by ordinary technicians in this field under the enlightenment of the embodiments belong to the scope of protection of the present application.
[0056] The terms "first", "second", "third", "fourth", etc. (if any) in the specification and claims of the present application and the above-mentioned drawings are used to distinguish similar objects, and are not necessarily used to describe a specific order or sequence. It should be understood that the data used in this way can be interchangeable where appropriate, so that the embodiments of the present application described herein can be implemented in an order other than those illustrated or described herein. In addition, the terms "including" and "having" and any of their variations are intended to cover non-exclusive inclusions, for example, a process, method, system, product or device that includes a series of steps or units is not necessarily limited to those steps or units that are clearly listed, but may include other steps or units that are not clearly listed or inherent to these processes, methods, products or devices.
[0057] First, the terms involved in this application are explained:
[0058] Task Scheduling: It is a computer technology used to coordinate the execution of specific tasks or programs by scheduling and managing resources according to predetermined time, conditions, priorities, task dependencies, etc.
[0059] Test Case: refers to the description of the testing task for a specific software product, reflecting the test plan, method, technology and strategy, etc. Its content includes test objectives, test environment, input data, test steps, expected results, test scripts, etc. Among them, the test environment also includes the specification configuration requirement information of the test equipment, etc., which is finally documented.
[0060] During the development or maintenance of operating systems such as Linux, comprehensive testing is often required.
[0061] The embodiment of the present application proposes a method for scheduling test cases. When performing task scheduling, the specification configuration requirement information of each test case and the specification configuration information of the idle test equipment are obtained, and each test case is grouped and processed according to the specification configuration requirement information and the specification configuration information to obtain the target case set required to be executed by each idle test equipment, and then the target case set is sent to the corresponding idle test equipment. This method takes into account the matching between the specification configuration requirements of the test case and the specification configuration information of the idle test equipment, and allocates the test case to the corresponding test equipment that matches it for execution. In this way, not only the resources of the available test equipment are fully utilized, but also there is no need to configure each test equipment according to the highest specifications, which can reduce both the testing cost and the waste of resources.
[0062] The execution subject of the embodiment of the present application can be a scheduling device for a test case, which can be located in a scheduling system of an automated test system or in a processor of an electronic device, which can be a mobile terminal such as a mobile phone, a tablet, a computer, etc., or a server or other device, which is not limited by the embodiment of the present application. The embodiment of the present application is described in detail by taking the execution subject as a scheduling device for a test case as an example.
[0063] The technical solution of the present application and how the technical solution of the present application solves the above-mentioned technical problems are described in detail below with specific embodiments. The following specific embodiments can be combined with each other, and the same or similar concepts or processes may not be repeated in some embodiments. The embodiments of the present application will be described below in conjunction with the accompanying drawings.
[0064] Figure 1 A flow chart of a method for scheduling a test case provided in an embodiment of the present application. Figure 1 As shown, the test case scheduling method provided in this embodiment includes the following steps:
[0065] S101. Obtain specification configuration requirement information of each test case and specification configuration information of idle test equipment.
[0066] The idle test device is a test device in an idle state.
[0067] Exemplarily, the specification configuration requirement information of the test case represents the specification configuration requirement of the test case for the test equipment. Among them, the specification configuration requirement information of the test case for the test equipment mainly refers to the hardware configuration requirements of the test equipment, for example, the requirements for the central processing unit (CPU), memory, disk, network card and other components on the test equipment. For the CPU, there may be requirements for the CPU model, manufacturer, main frequency, number of cores, cache size and other information; for the memory, there may be requirements for the memory capacity, type, frequency, manufacturer and other information; for the disk, there may be requirements for the disk capacity, interface type, manufacturer, rotation speed and other information; for the network card, there may be requirements for the network card model, manufacturer, maximum transmission rate, interface type and other information. Different test cases may have different specification configuration requirement information.
[0068] Optionally, the test case can be manually written or automatically generated using a software tool or script, and the embodiment of the present application does not limit this. When generating the test case, the specification configuration requirement information of each test case is set according to the test requirements and the test equipment, and the specification configuration requirement information is written into the requirement document of the test case. After the test case is obtained, the requirement document of the test case is traversed and analyzed, and the specification configuration requirement information of the test case for the test equipment can be obtained.
[0069] Among them, the test equipment refers to the equipment used to execute test cases. Depending on the test requirements, the corresponding test equipment may be different. For example, the test equipment can be a computer, server and other equipment. When the test equipment is different, the corresponding specification configuration information may be different.
[0070] In an embodiment of the present application, there are multiple test cases scheduled in a test task, and there are also multiple idle test devices. The specification configuration requirement information of each test case may be different, and the specification configuration information of the idle test devices may also be different. Among them, the specification configuration requirement information of the test case can be manually input into the scheduling device of the test case, or it can be obtained by the scheduling device of the test case after retrieving the test case from the test case management system and traversing and analyzing the requirement document of the test case, or it can be obtained by other means, and the embodiment of the present application does not limit this.
[0071] The specification configuration information of the idle test device may also be manually input into the scheduling device of the test case, or may be obtained by other means. In a possible implementation, obtaining the specification configuration information of the idle test device may include: obtaining the Internet Protocol IP address information of the idle test device, accessing the idle test device through the IP address information of the idle test device, so as to obtain the specification configuration information of the idle test device.
[0072] Among them, each test device has its own unique Internet Protocol IP address. When the specification configuration information of the test device is needed, the test device is accessed through the IP address of the test device to obtain the preset specification information of the test device. Based on this method, the timeliness of the specification configuration information can be improved, and the accuracy of the specification configuration information of the test device can be improved. When the specification information of the test device changes, the device can also be accessed through the corresponding IP address to obtain the new specification configuration information.
[0073] S102. Grouping the test cases according to the specification configuration requirement information and the specification configuration information to obtain a target test case set that each idle test device needs to execute.
[0074] Exemplarily, the target use case set includes first-category use cases and / or second-category use cases, the first-category use cases being test cases whose specification configuration requirements are consistent with the specification configuration information of the idle test device, and the second-category use cases being test cases whose specification configuration requirements are lower than the specification configuration information of the idle test device.
[0075] In an embodiment of the present application, there are multiple test cases scheduled in a test task, and there are also multiple idle test devices, and the number of test cases is greater than the number of idle test devices. Each idle test device must execute multiple test cases, and the set of multiple test cases executed by the idle test device is the target test case set that the idle test device needs to execute. In the target test case set that any idle test device needs to execute, it may only include the first category of test cases whose specification configuration requirements are consistent with the specification configuration information of the idle test device, or it may only include the second category of test cases whose specification configuration requirements are lower than the specification configuration information of the idle test device, and it may also include the first category of test cases and the second category of test cases at the same time. The embodiment of the present application does not limit this, and it can be determined based on the grouping results of specific test cases.
[0076] To this end, in a possible implementation method, after the test case scheduling device obtains the specification configuration requirement information of each test case and the specification configuration information of the idle test equipment, the specification configuration requirement information of the test case can be matched with the specification configuration information of each idle test equipment; if it is determined that there is an idle test equipment whose specification configuration information is consistent with the specification configuration requirements of the test case, the test case is assigned to the initial use case set of the idle test equipment; if it is determined that there is no idle test equipment whose specification configuration information is consistent with the specification configuration requirements of the test case, the test case is assigned to the initial use case set of idle test equipment whose specification configuration information is higher than the specification configuration requirements of the test case; and then, based on the initial use case set of the idle test equipment, the target use case set that needs to be executed by the idle test equipment is determined.
[0077] Understandably, in actual applications, in order to improve test efficiency, there may be a situation where multiple idle test devices with the same specification configuration information are used for testing at the same time. When multiple idle test devices with the same specification configuration information are used for testing, the same idle test devices evenly divide the test cases to be executed.
[0078] Among them, each configuration of the high-specification test equipment includes the configuration of the low-specification test equipment, that is, an idle test equipment whose specification configuration information is higher than the specification configuration requirement of the test case can also execute the test case.
[0079] For example, Figure 2 A schematic diagram of an architecture for grouping test cases provided in an embodiment of the present application. Figure 2 As shown, if the specification configuration requirements of test cases 1 to 4 in the test task are specification A, specification B, specification C, and specification D respectively, the preset specification configurations of the idle test equipment are specification A and specification C, where specification A includes specification B, and specification C includes specification D. When grouping test cases, for each test case, search for the test equipment with the corresponding specification configuration according to the specification configuration requirements of the test case. If the test equipment with the corresponding specification configuration is found, the test case is divided into the case set of the matching test equipment. If not found, search for a test equipment with a higher specification. For example, Figure 3 If test device A that matches the specification and configuration requirements of test case 1 is found, test case 1 is assigned to use case set A executed by test device A. If no test device that matches the specification and configuration requirements of test case 2 is found, test case 2 is assigned to use case set A executed by test device A with a higher specification than B. Similarly, test cases 3 and 4 can be assigned to use case set C executed by test device C.
[0080] Optionally, when it is determined that there is no idle test equipment whose specification configuration information is consistent with the specification configuration requirements of the test case, the test case is preferably assigned to an initial use case set of idle test equipment whose specification configuration information is one level higher than the specification configuration requirements of the test case to avoid excessive waste of resources.
[0081] For example, if the test task requires testing the running status of the operating system on the test devices using different numbers of network cards, the test task provides 4 specification configuration requirements, namely test cases A1, A2, A3, and A4, which use 1 network card, 2 network cards, 3 network cards, and 4 network cards. Currently, there are 2 idle test devices, one is device B4 with 4 network cards, and the other is device B2 with 2 network cards. When grouping the test cases, for each test case, the specification configuration requirement information of the test case is matched with the specification configuration information of each idle test device. For example, for test case A1, the specification configuration requirement of test case A1 "using 1 network card" is matched with the specification configuration information of test device B4 "having 4 network cards" and the specification configuration information of test device B2 "having 2 network cards". Since there is no test device "having 1 network card", test case A1 is assigned to idle test device B4 "having 2 network cards" which is one level higher than "having 1 network card". 2; for test case A2, the specification configuration requirement of test case A2 "using 2 network cards" is matched with the specification configuration information of test device B4 "having 4 network cards" and the specification configuration information of test device B2 "having 2 network cards". Since the specification configuration information of test device B2 "having 2 network cards" is consistent with the specification configuration requirement of test case A2 "using 2 network cards", test case A2 is assigned to the initial use case set of test device B2; by analogy, test cases A3 and A4 can be assigned to the initial use case set of test device B4. After determining the initial use case set of each idle test device, determine the target use case set that the idle test device needs to execute based on the initial use case set of the idle test device.
[0082] Among them, this method of adaptively grouping each test case according to the specification configuration requirement information of the test case and the specification configuration information of the idle test equipment, under ideal circumstances, each batch of test cases with different specification configuration requirements can find the corresponding test equipment specifications for case execution. When there is no corresponding test equipment specification, a test device containing this specification can also be found. Similarly, a machine environment that can meet the specification configuration requirements of this batch of test cases can be found eventually, making full use of the existing test equipment so that test equipment of various specifications can be utilized, greatly improving resource utilization. Grouping and dividing according to the specification configuration required by the use case eliminates the need to configure each test device to the highest specification, reducing resource waste and lowering testing costs. Moreover, by finding test equipment for execution according to the specifications required by the use case, it is also possible to adapt to multiple systems and meet the execution requirements of multiple sets of specification configurations.
[0083] Optionally, when determining the target use case set that the idle test device needs to execute based on the initial use case set of the idle test device, the initial use case set of the idle test device can be directly determined as the target use case set that the idle test device needs to execute. This method is suitable for scenarios where there are relatively few test cases and the distribution of specification configuration requirements for test equipment is relatively balanced. At this time, the grouping result can be directly determined and the next test action can be performed, thereby reducing scheduling time and improving test efficiency.
[0084] In addition, when there are relatively many test cases and the number of test cases allocated to each idle test device is uneven, the initial test case set can be further adjusted to balance the test cases required to be executed by each idle test device. Therefore, in a possible implementation, determining the target test case set required to be executed by the idle test device based on the initial test case set of the idle test device may also include:
[0085] S1. Determine the number of test cases in the initial use case set of each idle test device, and determine the difference between the number of test cases in the initial use case set of the first test device and the number of test cases in the initial use case set of the second test device; wherein, the specification configuration information of the first test device is less than the specification configuration information of the second test device, and the specification configuration information of the first test device is adjacent to the specification configuration information of the second test device.
[0086] It can be understood that to determine whether two idle test devices are adjacent, the idle test devices can be sorted according to the specification configuration information, and it is determined that two idle test devices with consecutive serial numbers are two idle test devices with adjacent specification configuration information. For example, if there are currently three idle test devices, namely, devices N1, N2, and N3 with 2, 1, and 6 network cards, respectively, and they are sorted from largest to smallest according to the specification configuration information, namely (1) device N3, (2) device N1, and (3) device N2, then serial number (1) device N3 is adjacent to serial number (2) device N1 (at this time, device N2 is the first test device and device N3 is the second test device), and serial number (2) device N1 is adjacent to serial number (3) device N2 (at this time, device N2 is the first test device and device N1 is the second test device).
[0087] For the case where multiple idle test devices with the same specification configuration information are used to perform tests separately at the same time, the number of test cases in the initial use case set of the first test device at this time can be: the average number of test cases in the initial use case set of the first test devices with the same specification configuration information; the number of test cases in the initial use case set of the second test device can be: the average number of test cases in the initial use case set of the second test device with the same specification configuration information.
[0088] S2. If it is determined that the difference is greater than a preset value, some test cases in the initial test case set of the first test device are allocated to the initial test case set of the second test device to obtain a target test case set that the idle test device needs to execute.
[0089] Exemplarily, after the test cases are initially grouped according to the specification configuration requirement information of the test cases and the specification configuration information of the idle test devices, and the initial use case set of each idle test device is determined, it can also be adjusted according to the number of test cases in each initial use case set, so that the test cases required to be executed by each idle test device are relatively balanced, so as to complete the test as soon as possible. Optionally, the number of test cases in the initial use case set of each idle test device is first determined, and the difference in the number of test cases in the initial use case set of the first test device and the second test device with adjacent specification configuration information is determined. If the difference is greater than a preset value, that is, the number of test cases in the first test device is greater than the number of test cases in the second test device by a certain value, since the preset specification configuration of the second test device is higher, the second test device can also execute the test case set in the first test device, and some test cases in the initial use case set of the first test device can be allocated to the initial use case set of the second test device, so that the difference is less than or equal to the preset value, so that the number of test cases that the two test devices are responsible for executing is relatively balanced, which can also complete the test faster.
[0090] Optionally, when allocating some test cases in the initial use case set of the first test device to the initial use case set of the second test device, the second type of use cases in the initial use case set of the first test device can be allocated to the initial use case set of the second test device. In this way, the first test device still mainly executes the test cases that match it, and its matching degree is higher.
[0091] Optionally, when allocating some test cases in the initial use case set of the first test device to the initial use case set of the second test device, the second type of use cases in the initial use case set of the first test device can be first allocated to the initial use case set of the second test device based on the size of the difference. If the difference is still greater than the preset value after adjustment, some of the first type of use cases can also be allocated to the initial use case set of the second test device to ensure that the number of test cases executed by the two test devices is relatively balanced.
[0092] S103: Send the target use case set to the corresponding idle test device.
[0093] The idle test equipment is used to execute the test cases in the target test case set.
[0094] Exemplarily, the test case scheduling device is connected to the idle test equipment via wired or wireless means. After the test case scheduling device determines the target use case set that each idle test equipment needs to execute, the target use case set is sent to the corresponding idle test equipment via a pre-set information transmission method, so that the idle test equipment can execute the test cases in the target use case set to perform testing and obtain test results.
[0095] Among them, the embodiments of the present application do not limit the information transmission method. For example, the pre-set information transmission method can be wired transmission, and the target use case set is sent to the idle test equipment through a wired cable such as optical fiber, coaxial cable, twisted pair, etc., which has the characteristics of stability and high-speed transmission; or, the pre-set information transmission method can also be wireless transmission, and the target use case set is sent to the idle test equipment through wireless signals such as radio waves, infrared rays, lasers, etc.; or, the pre-set information transmission method can also be optical fiber transmission, which uses optical fiber transmission, which has the advantages of high-speed transmission and strong anti-interference; and so on. In actual scenarios, the appropriate data transmission method can be selected according to the device configuration and the size of the target use case set, so that the target use case set can be sent to the idle test equipment more safely and efficiently.
[0096] The test case scheduling method provided in the embodiment of the present application groups and processes each test case according to the specification configuration requirement information and the specification configuration information, and obtains the target case set that each idle test device needs to execute; wherein the target case set includes the first type of case and / or the second type of case, the first type of case is the test case whose specification configuration requirement is consistent with the specification configuration information of the idle test device, and the second type of case is the test case whose specification configuration requirement is lower than the specification configuration information of the idle test device; and sends the target case set to the corresponding idle test device; wherein the idle test device is used to execute the test cases in the target case set. In the above manner, the test cases are allocated to the appropriate test devices, so that the resources of each test device can be fully utilized, the resource utilization rate is improved, and there is no need to equip each test device with the highest specification configuration, which reduces the testing cost and reduces the waste of resources.
[0097] Figure 3 A flowchart of another test case scheduling method provided in an embodiment of the present application. Figure 3 As shown, the test case scheduling method provided in this embodiment includes the following steps:
[0098] S301. Obtain specification configuration requirement information of each test case and specification configuration information of idle test equipment.
[0099] It should be noted that the implementation of step S301 may refer to the description of the aforementioned step S101 and will not be repeated here.
[0100] S302: Group each test case according to the specification configuration requirement information and the specification configuration information to obtain a target test case set that each idle test device needs to execute.
[0101] It should be noted that the implementation of step S302 may refer to the description of the aforementioned step S102 and will not be repeated here.
[0102] S303: Obtain the test time requirements of the test cases in the target use case set, and adjust the test sequence of the test cases in the target use case set according to the test time requirements.
[0103] For example, in some test tasks, some test cases also have requirements for test time. Therefore, before sending the target test case to the corresponding idle test device, the test time requirements of the test cases in the target case set can also be obtained, and the test order of the test cases in the target case set can be adjusted according to the test time requirements. Among them, the test time requirements of each test case can be obtained by traversing and analyzing each test case in the target case set. When adjusting the test order of the test cases in the target case set according to the test time requirements, the test cases with earlier test requirements are placed in front, and the test cases with later test requirements are placed in the back, so that after the target case set is sent to the test device, the test device can execute the test cases in sequence according to the required test order, thereby determining the test results at the specified time.
[0104] Optionally, when adjusting the test sequence according to the test time requirements, the correlation between the test contents, further test environment requirements, test objectives and other information can also be comprehensively considered. For example, test cases with the same test objectives executed by different test devices can be executed at the same time, so that the execution results of each test device can be obtained at a similar time, so as to facilitate subsequent unified data analysis. And so on, comprehensively consider the actual needs of all aspects, and further adjust the test sequence of the test cases to make the test go more smoothly, meet the test requirements, and improve user satisfaction with the test.
[0105] S304: Send the target use case set to the corresponding idle test device.
[0106] It should be noted that the implementation of step S304 may refer to the description of the aforementioned step S103 and will not be repeated here.
[0107] Optionally, if the test order of the test cases in the target use case set is adjusted, the target use case set sent to the idle test device is the target use case set after the test order is adjusted.
[0108] S305: Receive execution result information fed back by the idle test device.
[0109] The execution result information represents the execution result of the test cases in the target test case set executed by the idle test device. The execution result can be represented by the execution status, for example, the execution result can be execution success, execution failure, execution interruption, execution in progress, etc.
[0110] Exemplarily, when the idle test device executes each test case in the target test case set, an execution result of the test case will be generated. In some examples, the test device will feed back the execution result to the scheduling device of the test case, and the scheduling device of the test case can receive the execution result information fed back by the test device. Based on the execution result information, the tester can clearly know the execution status of the test case, so as to better control the execution of the test task.
[0111] S306: When the execution result indicates that the execution fails, a log request message is sent to an idle test device, and an operation log is received.
[0112] The log request information is used to instruct the idle test device to feedback the running log when executing the test case.
[0113] Exemplarily, when the execution result indicates that the idle test device fails to execute the test case, the test case scheduling device may further send a log request message to the idle test device to request the idle test device to feed back a running log when executing the test case.
[0114] Optionally, in other possible embodiments, when the execution result indicates that the idle test device fails to execute the test case, the execution result information fed back by the idle test device may also directly include the running log, so that the scheduling device of the test case does not need to send log request information to the idle test device.
[0115] Optionally, based on the running log of the test case, the tester can analyze the reason for the failure of the idle test device to execute the test case. If it is due to the test case, the test case can be adjusted. If it is due to the test device, it can be reallocated to other idle test devices for execution to better complete the test.
[0116] Optionally, in some examples, the test case scheduling device may also analyze and process the operation log to obtain the reason why the idle test device fails to execute the test case, and send the reason to the tester via a preset data transmission method. The preset data transmission method includes one or more of the following: email, file transfer protocol, and hypertext transfer protocol.
[0117] Exemplarily, the scheduling device of the test case can also perform log analysis and send the cause of the exception to the tester via any one of email, file transfer protocol, hypertext transfer protocol, etc., so that the tester can know the cause of the exception and respond more quickly, thereby improving the execution efficiency of the test task and providing users with a better testing experience.
[0118] In addition, in some examples, in order to improve the security of data during transmission, when data transmission is involved, the transmitted data can also be encrypted using encryption algorithms such as national encryption algorithms to improve data security, which is not limited in the embodiments of the present application.
[0119] The test case scheduling method provided in the embodiment of the present application, after obtaining the target use case set that needs to be executed by the idle test device, also obtains the test time requirements of the test cases in the target use case set, and adjusts the test order of the test cases in the target use case set according to the test time requirements, so that the test can be carried out more smoothly, and the test meets the test requirements, thereby improving the user's satisfaction with the test; in addition, the embodiment of the present application also obtains the execution result information fed back by the test device, and when the execution result indicates that the execution failed, sends log request information to the test device to obtain the operation log, so that the reason for the failure of the test case execution can be analyzed, and corresponding response actions can be made, thereby improving the execution efficiency of the test task and providing users with a better testing experience.
[0120] It should be noted that the test case scheduling method provided in the embodiment of the present application is not only applicable to the scheduling and execution of test tasks in operating systems such as Linux, but is also applicable to processes such as Web-side automated testing and mobile-side automated testing, and the embodiment of the present application does not impose any restrictions on this.
[0121] The following is an embodiment of the device of the present application, which can be used to execute the embodiment of the method of the present application. For details not disclosed in the embodiment of the device of the present application, please refer to the embodiment of the method of the present application.
[0122] Figure 4 A schematic diagram of the structure of a test case scheduling device provided in an embodiment of the present application. Figure 4 As shown, the test case scheduling device 40 provided in the embodiment of the present application includes an acquisition unit 401, a processing unit 402 and a transceiver unit 403.
[0123] The acquisition unit 401 is used to acquire the specification configuration requirement information of each test case and the specification configuration information of the idle test equipment; wherein the specification configuration requirement information represents the specification configuration requirement of the test case for the test equipment.
[0124] Processing unit 402 is used to group and process each test case according to the specification configuration requirement information and the specification configuration information to obtain a target use case set that each idle test device needs to execute; wherein the target use case set includes first-category use cases and / or second-category use cases, the first-category use cases are test cases whose specification configuration requirements are consistent with the specification configuration information of the idle test device, and the second-category use cases are test cases whose specification configuration requirements are lower than the specification configuration information of the idle test device.
[0125] The transceiver unit 403 is used to send the target use case set to the corresponding idle test device; wherein the idle test device is used to execute the test cases in the target use case set.
[0126] In one implementation, the processing unit 402 is specifically configured to:
[0127] Matching the specification configuration requirement information of the test case with the specification configuration information of each idle test device;
[0128] If it is determined that there is an idle test device whose specification configuration information is consistent with the specification configuration requirements of the test case, the test case is assigned to the initial test case set of the idle test device;
[0129] If it is determined that there is no idle test device whose specification configuration information is consistent with the specification configuration requirement of the test case, the test case is assigned to an initial test case set of idle test devices whose specification configuration information is higher than the specification configuration requirement of the test case;
[0130] Based on the initial use case set of the idle test device, determine the target use case set that the idle test device needs to execute.
[0131] In one implementation, the processing unit 402 is specifically configured to:
[0132] An initial use case set of an idle test device is determined, which is a target use case set that the idle test device needs to execute.
[0133] In one implementation, the processing unit 402 is specifically configured to:
[0134] Determine the number of test cases in the initial use case set of each idle test device, and determine the difference between the number of test cases in the initial use case set of the first test device and the number of test cases in the initial use case set of the second test device; wherein the specification configuration information of the first test device is less than the specification configuration information of the second test device, and the specification configuration information of the first test device is adjacent to the specification configuration information of the second test device;
[0135] If it is determined that the difference is greater than a preset value, some test cases in the initial test case set of the first test device are allocated to the initial test case set of the second test device to obtain a target test case set that the idle test device needs to execute.
[0136] In one implementation, the processing unit 402 is specifically configured to:
[0137] The second type of use cases in the initial use case set of the first test device are allocated to the initial use case set of the second test device.
[0138] In one implementation, the acquiring unit 401 is specifically configured to:
[0139] The Internet Protocol (IP) address information of the idle test device is obtained, and the idle test device is accessed through the IP address information of the idle test device to obtain the specification configuration information of the idle test device.
[0140] In one implementation, the processing unit 402 is further configured to:
[0141] Obtain the test time requirements of the test cases in the target use case set, and adjust the test sequence of the test cases in the target use case set according to the test time requirements.
[0142] In one implementation, the transceiver unit 403 is further configured to:
[0143] Receive execution result information fed back by the idle test device; wherein the execution result information represents the execution result of the test case in the target test case set executed by the idle test device;
[0144] When the execution result indicates that the execution fails, a log request message is sent to the idle test device; wherein the log request message is used to instruct the idle test device to feedback the operation log when executing the test case; and receive the operation log.
[0145] In one implementation, the transceiver unit 403 is further configured to:
[0146] Analyze and process the operation log to obtain the reasons why the idle test equipment fails to execute the test case;
[0147] The reason is sent to the tester via a preset data transmission method; wherein the preset data transmission method includes one or more of the following: email, file transfer protocol, hypertext transfer protocol.
[0148] The device provided in this embodiment can be used to execute the method of the above embodiment. Its implementation principle and technical effect are similar and will not be described in detail here.
[0149] It should be noted that it should be understood that the division of the various modules of the above device is only a division of logical functions. In actual implementation, they can be fully or partially integrated into one physical entity, or they can be physically separated. And these modules can all be implemented in the form of software called by processing elements; they can also be all implemented in the form of hardware; some modules can also be implemented in the form of software called by processing elements, and some modules can be implemented in the form of hardware. In addition, it can also be stored in the memory of the above device in the form of program code, and the functions of the above data processing modules can be called and executed by a processing element of the above device. The implementation of other modules is similar. In addition, all or part of these modules can be integrated together, or they can be implemented independently. The processing element here can be an integrated circuit with signal processing capabilities. In the implementation process, each step of the above method or each module above can be completed by an integrated logic circuit of hardware in the processor element or instructions in the form of software.
[0150] Figure 5 A schematic diagram of the structure of an electronic device is provided in an embodiment of the present application. Figure 5 As shown, the electronic device 50 includes a processor 501 and a memory 502 communicatively connected to the processor.
[0151] The memory 502 is used to store programs. Specifically, the program may include program codes, and the program codes include computer operation instructions. The memory 502 may include a high-speed RAM memory, and may also include a non-volatile memory, such as at least one disk memory.
[0152] The processor 501 is used to execute the computer-executable instructions stored in the memory 502 to implement the network configuration method described in the aforementioned method embodiment. The processor 501 may be a central processing unit (CPU), or an application specific integrated circuit (ASIC), or one or more integrated circuits configured to implement the embodiments of the present application.
[0153] The electronic device 50 may further include a communication interface 503, so as to communicate and interact with an external device through the communication interface 503. The external device may be, for example, a server or other electronic devices.
[0154] In specific implementation, if the communication interface 503, the memory 502 and the processor 501 are implemented independently, the communication interface 503, the memory 502 and the processor 501 can be connected to each other through a bus and communicate with each other. The bus can be an Industry Standard Architecture (ISA) bus, a Peripheral Component Interconnect (PCI) bus or an Extended Industry Standard Architecture (EISA) bus, etc. The bus can be divided into an address bus, a data bus, a control bus, etc., but it does not mean that there is only one bus or one type of bus.
[0155] Optionally, in a specific implementation, if the communication interface 503, the memory 502 and the processor 501 are integrated on a chip, the communication interface 503, the memory 502 and the processor 501 can complete communication through an internal interface.
[0156] The electronic device provided in this embodiment can execute the technical solution in the above method embodiment, and its beneficial effects are similar, which will not be described in detail here.
[0157] An embodiment of the present application also provides a computer-readable storage medium, in which computer-executable instructions are stored. When the computer-executable instructions are executed by a processor, they are used to implement the technical solution provided by any of the aforementioned method embodiments.
[0158] An embodiment of the present application also provides a computer program product, including a computer program, which is used to implement the technical solution provided by the aforementioned method embodiment when executed by a processor.
[0159] Those skilled in the art can understand that all or part of the steps of implementing the above-mentioned method embodiments can be completed by hardware related to program instructions. The aforementioned program can be stored in a computer-readable storage medium. When the program is executed, the steps of the above-mentioned method embodiments are executed; and the aforementioned storage medium includes: ROM, RAM, disk or optical disk and other media that can store program codes.
[0160] Finally, it should be noted that the above embodiments are only used to illustrate the technical solutions of the embodiments of the present application, rather than to limit them. Although the embodiments of the present application have been described in detail with reference to the aforementioned embodiments, those skilled in the art should understand that they can still modify the technical solutions described in the aforementioned embodiments, or replace some or all of the technical features therein by equivalents. These modifications or replacements do not cause the essence of the corresponding technical solutions to deviate from the scope of the technical solutions of the embodiments of the present application.
Claims
1. A test case scheduling method, characterized in that: The method comprises: Obtaining specification configuration requirement information of each test case and specification configuration information of idle test equipment; wherein the specification configuration requirement information represents the specification configuration requirement of the test case for the test equipment; Matching the specification configuration requirement information of the test case with the specification configuration information of each idle test device; If it is determined that there is an idle test device whose specification configuration information is consistent with the specification configuration requirement of the test case, the test case is allocated to the initial test case set of the idle test device; If it is determined that there is no idle test device whose specification configuration information is consistent with the specification configuration requirement of the test case, the test case is allocated to an initial test case set of idle test devices whose specification configuration information is higher than the specification configuration requirement of the test case; In the case where the number of test cases that need to be executed by each idle test device is uneven, determine the number of test cases in the initial use case set of each idle test device, and determine the difference between the number of test cases in the initial use case set of the first test device and the number of test cases in the initial use case set of the second test device; wherein the specification configuration information of the first test device is smaller than the specification configuration information of the second test device, and the specification configuration information of the first test device is adjacent to the specification configuration information of the second test device; If it is determined that the difference is greater than a preset value, some test cases in the initial test case set of the first test device are allocated to the initial test case set of the second test device to obtain a target test case set that needs to be executed by the idle test device; The target use case set includes a first type of use case and / or a second type of use case, wherein the first type of use case is a test case whose specification configuration requirements are consistent with the specification configuration information of the idle test device, and the second type of use case is a test case whose specification configuration requirements are lower than the specification configuration information of the idle test device; The target use case set is sent to a corresponding idle test device; wherein the idle test device is used to execute the test cases in the target use case set.
2. The method according to claim 1, characterized in that The method further includes, when the number of test cases to be executed by each idle test device is balanced, An initial use case set of an idle test device is determined, which is a target use case set that the idle test device needs to execute.
3. The method according to claim 2, characterized in that Allocating part of the test cases in the initial test case set of the first test device to the initial test case set of the second test device, comprising: The second type of use cases in the initial use case set of the first test device are allocated to the initial use case set of the second test device.
4. The method according to claim 1, characterized in that: Get the specification and configuration information of the idle test device, including: The Internet Protocol (IP) address information of the idle test device is obtained, and the idle test device is accessed through the IP address information of the idle test device to obtain the specification configuration information of the idle test device.
5. The method according to any one of claims 1 to 4, characterized in that Before sending the target use case set to the corresponding idle test device, the method further includes: The test time requirements of the test cases in the target use case set are obtained, and the test sequence of the test cases in the target use case set is adjusted according to the test time requirements.
6. The method according to any one of claims 1 to 4, characterized in that The method further comprises: Receive execution result information fed back by the idle test device; wherein the execution result information represents the execution result of the test case in the target test case set executed by the idle test device; When the execution result indicates that the execution fails, a log request message is sent to the idle test device; wherein the log request message is used to instruct the idle test device to feed back the operation log when executing the test case; and the operation log is received.
7. The method according to claim 6, characterized in that The method further comprises: Analyze and process the operation log to obtain the reason why the idle test device fails to execute the test case; The reason is sent to the tester via a preset data transmission method; wherein the preset data transmission method includes one or more of the following: e-mail, file transfer protocol, hypertext transfer protocol.
8. An electronic device, characterized in that: The electronic device comprises: a processor, and a memory communicatively connected to the processor; The memory stores computer-executable instructions; The processor executes the computer-executable instructions stored in the memory to implement the method according to any one of claims 1 to 7.
Citation Information
Patent Citations
Method and device for executing test task, server and storage medium
CN111190810A
Resource allocation method and computer equipment
CN112052084A