CN112540914A - Execution method, execution device, server and storage medium for unit test - Google Patents

Execution method, execution device, server and storage medium for unit test Download PDF

Info

Publication number
CN112540914A
CN112540914A CN202011359878.6A CN202011359878A CN112540914A CN 112540914 A CN112540914 A CN 112540914A CN 202011359878 A CN202011359878 A CN 202011359878A CN 112540914 A CN112540914 A CN 112540914A
Authority
CN
China
Prior art keywords
task
target test
equipment
execution
test task
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
CN202011359878.6A
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.)
Beijing Baidu Netcom Science and Technology Co Ltd
Original Assignee
Beijing Baidu Netcom Science and 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 Beijing Baidu Netcom Science and Technology Co Ltd filed Critical Beijing Baidu Netcom Science and Technology Co Ltd
Priority to CN202011359878.6A priority Critical patent/CN112540914A/en
Publication of CN112540914A publication Critical patent/CN112540914A/en
Pending legal-status Critical Current

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F11/00Error detection; Error correction; Monitoring
    • G06F11/36Preventing errors by testing or debugging software
    • G06F11/3668Software testing
    • G06F11/3672Test management
    • G06F11/3688Test management for test execution, e.g. scheduling of test suites

Abstract

The application discloses a unit test execution method, a unit test execution device, a server and a storage medium, and relates to the field of deep learning. The specific implementation scheme is as follows: acquiring a task queue; the task queue comprises a plurality of unit test tasks; performing task scheduling on a plurality of unit test tasks in a task queue to determine a target test task to be executed; querying historical execution information of the target test task to determine first equipment which fails to execute the target test task; and scheduling second equipment in the equipment set except the first equipment to execute the target test task. Therefore, the method can effectively improve the execution efficiency of the unit test, improve the resource utilization rate and improve the development efficiency of developers.

Description

Execution method, execution device, server and storage medium for unit test
Technical Field
The present application relates to the field of computers, and in particular, to the field of deep learning, and more particularly, to a unit test execution method, an execution apparatus, a server, and a storage medium.
Background
In the development process of a large-scale software project, in order to ensure the software quality, a developer can develop a large number of test programs for testing whether the functions of the functions are normal, namely unit tests. Generally, the code amount of the unit test may account for more than 50% of the total code amount, and as the project advances, the number of unit tests may increase. Therefore, how to complete the unit test quickly and efficiently is crucial.
Disclosure of Invention
The application provides a unit test execution method, a unit test execution device, a server and a storage medium.
According to an aspect of the present application, there is provided a method of performing a unit test, including:
acquiring a task queue; the task queue comprises a plurality of unit test tasks;
performing task scheduling on a plurality of unit test tasks in the task queue to determine a target test task to be executed;
querying historical execution information of the target test task to determine first equipment which fails to execute the target test task;
and scheduling second equipment in the equipment set except the first equipment to execute the target test task.
According to another aspect of the present application, there is provided an apparatus for performing a unit test, including:
the acquisition module is used for acquiring the task queue; the task queue comprises a plurality of unit test tasks;
the scheduling module is used for performing task scheduling on the plurality of unit test tasks in the task queue so as to determine a target test task to be executed;
the query module is used for querying the historical execution information of the target test task so as to determine first equipment which fails to execute the target test task;
and the execution module is used for scheduling second equipment in the equipment set except the first equipment to execute the target test task.
According to another aspect of the present application, there is provided a server comprising:
at least one processor; and
a memory communicatively coupled to the at least one processor; wherein the content of the first and second substances,
the memory stores instructions executable by the at least one processor to enable the at least one processor to perform the above-described execution method.
According to another aspect of the present application, there is provided a non-transitory computer readable storage medium storing computer instructions for causing a computer to perform the above-described execution method.
Other effects of the above-described alternative will be described below with reference to specific embodiments.
Drawings
The drawings are included to provide a better understanding of the present solution and are not intended to limit the present application. Wherein:
FIG. 1 is a flow chart illustrating a method for performing a unit test according to an embodiment of the present disclosure;
FIG. 2 is a flow diagram illustrating a method for performing a unit test according to one embodiment of the present application;
FIG. 3 is a flow diagram illustrating a method for performing a unit test according to another embodiment of the present application;
FIG. 4 is a schematic structural diagram of an apparatus for performing a unit test according to an embodiment of the present disclosure;
FIG. 5 is a block diagram of a server performing a method of unit testing according to an embodiment of the present application.
Detailed Description
The following description of the exemplary embodiments of the present application, taken in conjunction with the accompanying drawings, includes various details of the embodiments of the application for the understanding of the same, which are to be considered exemplary only. Accordingly, those of ordinary skill in the art will recognize that various changes and modifications of the embodiments described herein can be made without departing from the scope and spirit of the present application. Also, descriptions of well-known functions and constructions are omitted in the following description for clarity and conciseness.
An execution method, an execution apparatus, a server, and a storage medium of a unit test according to an embodiment of the present application are described below with reference to the drawings.
Before describing the method of performing the unit test of the present application, the following unit test will be explained.
In the development process of a large-scale software project, in order to ensure the software quality, a developer can develop a large number of test programs for testing whether the functions of the functions are normal, namely unit tests. Particularly, in an open source community with cooperation of multiple persons, a plurality of developers exist, the code amount is huge, and at the moment, unit testing becomes an important means for ensuring the software quality, and is an indispensable link in the continuous integration process.
Generally, the code amount of the unit test is more than 50% of the total code amount, the number of the unit tests is more and more as the project advances, and the time required for passing all the unit tests is longer and longer. If not controlled, inefficient unit test loops can greatly limit the development efficiency of developers.
In addition to the proliferation of the number of unit tests, some random errors that do not affect the correctness of the program may be generated during the execution of the unit tests. The reasons for this include: the concurrency is too large, so that the memory overflows; insufficient disk space; network interruption; the unit test execution order is not fixed, etc. Although the correctness of the program is not affected by the errors, the unit testing procedure fails to be executed, and the developer is caused to execute the unit testing procedure again. As the number of unit tests increases, more resources are required, and the probability of random errors is higher. This wastes a significant amount of hardware resources and the developer's valuable time.
Therefore, the method for executing the unit test can effectively improve the execution efficiency of the unit test, improve the resource utilization rate and improve the development efficiency of developers.
Fig. 1 is a flowchart illustrating a method for performing a unit test according to an embodiment of the present application.
The unit test execution method in the embodiments of the present application may be executed by the unit test execution device provided in the embodiments of the present application, and the device may be configured in a server.
As shown in fig. 1, a method for executing a unit test according to an embodiment of the present application includes:
step S101, acquiring a task queue; wherein the task queue comprises a plurality of unit test tasks.
It will be appreciated that each unit test task has a unit test name, a command to be executed, a probability of a random error occurring on the device, and the like.
As an implementation mode for acquiring the task queue, the server firstly acquires the probability of random errors of each unit test task on the equipment, and then sorts all unit test tasks according to the random error probability of each unit test task on the equipment to form the task queue. For example, a unit test having a higher probability of occurrence of random errors may be prioritized, and thus the unit test having a higher probability of occurrence of random errors may be preferentially performed.
It should be noted that, if there are a plurality of unit tests with the same probability of random error occurrence, the unit test tasks may be queued according to the sequence of program execution from high priority to low priority, so as to execute the unit test tasks in sequence.
Step S102, task scheduling is carried out on a plurality of unit test tasks in the task queue so as to determine a target test task to be executed.
That is, the server schedules a unit test task, such as the unit test task with the highest priority, from the task queue as the target test task to be executed.
Step S103, querying historical execution information of the target test task to determine a first device which fails to execute the target test task.
The historical execution information may include the number of times of historical execution and the first device that failed in the historical execution task, that is, the first device that has executed the target test task several times before the target test task is executed this time and failed in the target test task.
In this embodiment, after determining a target test task to be executed, a server determines whether the target test task has failed to be executed, and if the target test task has failed to be executed, acquires a first device that has failed to execute the target test task.
And step S104, scheduling second equipment except the first equipment in the equipment set to execute the target test task.
In this embodiment, in order to reduce the possibility that the target test task fails again as much as possible, when the target test task is executed again, the server selects a new device (a second device in the device set except the first device) to execute the target test task, that is, a failure retry mechanism and a multi-machine parallel mechanism. The failure retry mechanism can reduce the probability of random errors of unit test tasks, improve the resource utilization rate and improve the development efficiency of developers; the multi-machine parallel mechanism can improve the execution speed of the unit test link, thereby improving the execution efficiency of the unit test and the development efficiency of developers.
The unit test execution method of the embodiment of the application includes the steps of firstly obtaining a task queue including a plurality of unit test tasks, carrying out task scheduling on the plurality of unit test tasks in the task queue to determine a target test task to be executed, then inquiring historical execution information of the target test task to determine first equipment which fails to execute the target test task, and finally scheduling second equipment except the first equipment in an equipment set to execute the target test task. Therefore, the method can effectively improve the execution efficiency of the unit test, improve the resource utilization rate and improve the development efficiency of developers.
In order to shorten the time consumption of the unit testing link, further improve the execution efficiency of the unit testing, improve the resource utilization rate, and improve the development efficiency of the developer, in an example of the present application, as shown in fig. 2, after the step S104 of scheduling a second device in the device set except the first device to execute the target testing task, the method further includes:
in step S201, when the second device fails to execute the target test task, the failure times in the history execution information are updated.
In this embodiment, after the server schedules the second device in the device set except the first device to execute the target task, the second device executes the target test task, and if the second device fails to execute the target test task, the failure times in the historical execution information are superimposed by 1, that is, the failure times in the historical execution information of the target test task are updated.
After the failure times in the historical execution information of the target test task are updated, judging the relationship between the updated failure times and the time threshold, and executing the step S202 under the condition that the updated failure times are smaller than the time threshold; in the case where the number of failures after the update is greater than or equal to the number threshold, step S203 is executed.
In order to reduce the possibility of the unit test failing to execute again, in the embodiment of the present application, the threshold of times is less than or equal to the total number of devices in the device set. This is particularly because if a target test task fails on a device, which may be a problem of the device itself, such as a network outage, since the network outage may not be recovered for a short time, the probability that the target test task fails to be executed again on the device is higher than that of other devices. In order to reduce the possibility of the target test task failing to be executed again, a new device is selected to execute the target test task when the target test task is executed again, so in the embodiment of the present application, the threshold of the number of times is set to be less than or equal to the total number of devices in the device set.
Step S202, target test tasks are added into the task queue, and second equipment is added into the equipment list of the equipment which fails to execute in the historical execution information.
As an implementation manner for adding a target test task to a task queue, the method comprises the following steps: configuring the priority of the target detection task according to the updated failure times; and adding the target test task to the corresponding position of the task queue according to the priority.
It should be noted that the relationship between the number of failures and the priority of the target test task may be obtained in advance and stored in the server. Assuming that the maximum priority is 1, the higher the value, the lower the priority. When the number of failures is 1, the priority of the target test task is a quotient obtained by dividing the number of unit test tasks included in the current task queue by 2 and then rounding (or adding or subtracting a preset value such as 1 on the basis of rounding), and the value is approximately the middle position of the task queue; when the failure times are 2, the priority of the target test task is the number of unit test tasks included in the current task queue, the tail position of the task queue and the lowest priority.
In this embodiment, when a second device, for example, the Host1, in the device set fails to execute for the first time, the server adds the second device, for example, the Host1, to the device list of the failed devices in the history execution information as the first device that failed to execute the unit test task, and adjusts the priority of the failed unit test task to a position approximately in the middle of the task queue; when a second device such as the Host2 in the device set fails to execute for the second time, the second device such as the Host2 is added to the device list of the failed device in the history execution information, the second device is also used as the first device which fails to execute the unit test, the priority of the failed unit test task is adjusted, and the priority is adjusted to the position at the tail of the task queue, so that the tasks with different failure times can be arranged at different positions in the task queue, the unit test tasks with errors in the queue are prevented from being concentrated, and mutual interference among different unit test tasks is reduced.
As an achievable way to configure the priority of the target test task according to the updated failure times, the method includes: determining a corresponding priority value range according to the updated failure times; and determining the priority of the target test task configuration within the priority value range.
It should be noted that the relationship between the failure times and the priority value range may be preset and stored in the server. For example, when the number of failures is 1, the value range of the priority may be 1 to a value obtained by dividing the number of unit test tasks included in the current task queue by 2 and then rounding (or adding or subtracting a preset value such as 1 on the basis of rounding), and approximately the head of the task queue to a certain position in the middle; when the number of failures is 2, the value range of the priority may be a quotient obtained by dividing the number of unit test tasks included in the current task queue by 2 and then rounding (or adding or subtracting a preset value such as 1 on the basis of rounding) the value to the number of unit test tasks included in the current task queue, and approximately a position from the middle to the end of the task queue.
In this embodiment, when the execution of the second device in the device set fails, the server adds the second device to the device list of the failed device in the history execution information, and uses the device list as the first device, and obtains the corresponding priority value range. On the basis of the maximum value of the value range, a random disturbance is added, so that the priority floats in a small range, and therefore, several unit test tasks which fail to be continuously executed are prevented from being distributed on continuous positions of a task queue. For example, several unit test tasks occupying a large amount of memory fail because of continuous execution, and when the unit test tasks are executed again, the unit test tasks should be dispersed as much as possible to avoid being concentrated again. Therefore, the position of the target test task to be executed in the task queue is dynamically adjusted, so that the time of a unit test link can be fully utilized, the concentration of wrong unit test tasks in the queue can be avoided, and the mutual interference among different unit test tasks is reduced as much as possible.
Step S203, delete the target test task.
That is, in the case where the updated number of failures is greater than or equal to the number threshold, the server deletes the name of the target test task from the task queue.
The execution method of the unit test comprises the steps of firstly obtaining a task queue comprising a plurality of unit test tasks, carrying out task scheduling on the plurality of unit test tasks in the task queue to determine a target test task to be executed, then inquiring historical execution information of the target test task to determine first equipment failing to execute the target test task, finally scheduling second equipment except the first equipment in an equipment set to execute the target test task, updating failure times in the historical execution information under the condition that the second equipment fails to execute the target test task, adding the target test task into the task queue under the condition that the updated failure times are smaller than a time threshold value, and adding the second equipment into an equipment list of the failed equipment executing in the historical execution information; and deleting the target test task under the condition that the updated failure times are larger than or equal to the time threshold. Therefore, the method can shorten the time consumption of the unit test link, further improve the execution efficiency of the unit test, improve the resource utilization rate and improve the development efficiency of developers.
To make the present application more clear to those skilled in the art, fig. 3 is a flowchart illustrating a method for performing a unit test according to another embodiment of the present application. As shown in fig. 3, the method for executing the unit test includes:
in step S301, a unit test task list and a device list are initialized.
Step S302, adding the unit test task into a priority task queue.
Step S303, select a suitable device for the unit test task.
In step S304, it is determined whether the device is in the list of executing failed devices. If yes, returning to the step S303; if not, step S305 is performed.
Step S305, the unit test task is distributed to the equipment.
In step S306, the unit test task is executed by the device.
Step S307, it is determined whether the unit test task is successfully executed. If yes, go to step S310; if not, step S308 is performed.
S308, judging whether the execution times is more than or equal to 3. If yes, go to step S310; if not, step S309 is performed.
S309, add the device with failed execution to the list of the device with failed execution, and execute step S302 in a loop.
S310, removing the unit test task from the priority task queue.
S311, recording the execution result of the unit test task.
Assume that the number of unit test tasks included in the task queue is NuThe number of devices Host is NhThe devices are independent of each other, and the number of unit test failure retries is NtThe probability of a random error occurring on the device for a unit test is p. Wherein N ish≥Nh
For the conventional execution method of unit test (only one device, failure without retry), the probability of success of unit test is
Figure BDA0002803683460000081
The time consuming expectation that all unit tests pass is:
Figure BDA0002803683460000082
wherein, tiIndicating the time required for the ith unit test to be successfully performed once. Using the execution method of the unit test (adding the failure retry mechanism) of the application, the success probability of the unit test link is
Figure BDA0002803683460000083
The time consuming expectation that all unit tests pass is:
Figure BDA0002803683460000084
the time savings expected in the present application compared to conventional methods of performing unit tests is Δ T ═ T1-T2
E.g. Nu=100,Nt=3,p=0.01,
Figure BDA0002803683460000085
Therefore, the success probability of the unit testing link can be improved from 36.60% to 99.99%, the time consumption is expected to be shortened from 273.20min to 100.01min, and the efficiency is improved by 63.4%.
In conclusion, by the unit test execution method, the probability of random errors in the unit test process can be greatly reduced, and the task queuing time is shortened; the execution time of the unit test is shortened, the execution efficiency of the unit test is improved, and the resource utilization rate is improved; the development efficiency of developers is improved, and the software iteration speed is increased.
In order to implement the above embodiments, an execution device for unit testing is further provided in the embodiments of the present application.
Fig. 4 is a schematic structural diagram of an execution apparatus for unit testing according to an embodiment of the present application.
As shown in fig. 4, the apparatus 400 for performing unit test according to the embodiment of the present application includes: an acquisition module 410, a scheduling module 420, a query module 430, and an execution module 440.
The obtaining module 410 is configured to obtain a task queue; the task queue comprises a plurality of unit test tasks;
the scheduling module 420 is configured to perform task scheduling on the plurality of unit test tasks in the task queue to determine a target test task to be executed;
a query module 430, configured to query historical execution information of the target test task to determine a first device that failed to execute the target test task;
and the execution module 440 is configured to schedule a second device in the device set, except the first device, to execute the target test task.
In a possible implementation manner of the embodiment of the present application, the executing apparatus 400 further includes:
the updating module is used for updating the failure times in the historical execution information under the condition that the second equipment fails to execute the target test task;
and the adding module is used for adding the target test task into the task queue and adding the second equipment into the equipment list of the failed equipment in the historical execution information under the condition that the updated failure times are smaller than the time threshold.
In a possible implementation manner of the embodiment of the present application, the adding module includes:
the configuration unit is used for configuring the priority of the target test task according to the updated failure times;
and the adding unit is used for adding the target test task to the corresponding position of the task queue according to the priority.
In a possible implementation manner of the embodiment of the present application, the configuration unit includes:
the first determining subunit is used for determining a corresponding priority value range according to the updated failure times;
and the second determining subunit is used for determining the priority of the target test task configuration in the priority value range.
In a possible implementation manner of the embodiment of the present application, the execution apparatus 400 further includes:
and the deleting module is used for deleting the target test task under the condition that the updated failure times are greater than or equal to the time threshold.
In one possible implementation manner of the embodiment of the present application, the time threshold is less than or equal to the total number of devices in the device set.
It should be noted that the explanation of the embodiment of the method for executing the unit test is also applicable to the apparatus for executing the unit test in this embodiment, and therefore, the description thereof is omitted here.
According to the execution device for the unit test, the task queue is obtained through the obtaining module; the task queue comprises a plurality of unit test tasks, the scheduling module is used for performing task scheduling on the plurality of unit test tasks in the task queue to determine a target test task to be executed, the query module is used for querying historical execution information of the target test task to determine first equipment which fails to execute the target test task, and the execution module is used for scheduling second equipment except the first equipment in the equipment set to execute the target test task. Therefore, the device can shorten the time consumption of unit testing links, improve the execution efficiency of unit testing, improve the resource utilization rate and improve the development efficiency of developers.
According to an embodiment of the present application, a server and a readable storage medium are also provided.
Fig. 5 is a block diagram of a server for executing a unit test according to an embodiment of the present application. Server is intended to represent various forms of digital computers, such as laptops, desktops, workstations, personal digital assistants, servers, blade servers, mainframes, and other appropriate computers. The server may also represent various forms of mobile devices, such as personal digital processing, cellular phones, smart phones, wearable devices, and other similar computing devices. The components shown herein, their connections and relationships, and their functions, are meant to be examples only, and are not meant to limit implementations of the present application that are described and/or claimed herein.
As shown in fig. 5, the server includes: one or more processors 501, memory 502, and interfaces for connecting the various components, including high-speed interfaces and low-speed interfaces. The various components are interconnected using different buses and may be mounted on a common motherboard or in other manners as desired. The processor may process instructions executed within the server, including instructions stored in or on the memory to display graphical information of the GUI on an external input/output device (such as a display device coupled to the interface). In other embodiments, multiple processors and/or multiple buses may be used, along with multiple memories and multiple memories, as desired. Also, multiple servers may be connected, with each device providing portions of the necessary operations (e.g., as an array of servers, a group of blade servers, or a multi-processor system). In fig. 5, one processor 501 is taken as an example.
Memory 502 is a non-transitory computer readable storage medium as provided herein. The memory stores instructions executable by at least one processor to cause the at least one processor to perform the unit test execution method provided herein. The non-transitory computer readable storage medium of the present application stores computer instructions for causing a computer to perform the execution method of the unit test provided herein.
The memory 502, which is a non-transitory computer readable storage medium, may be used to store non-transitory software programs, non-transitory computer executable programs, and modules, such as program instructions/modules corresponding to the execution method of the unit test in the embodiment of the present application (for example, the obtaining module 410, the scheduling module 420, the query module 430, and the execution module 440 shown in fig. 4). The processor 501 executes various functional applications of the server and data processing, i.e., an execution method of the unit test in the above-described method embodiment, by executing the non-transitory software program, instructions, and modules stored in the memory 502.
The memory 502 may include a storage program area and a storage data area, wherein the storage program area may store an operating system, an application program required for at least one function; the storage data area may store data created according to the use of the server of the execution method of the unit test, and the like. Further, the memory 502 may include high speed random access memory, and may also include non-transitory memory, such as at least one magnetic disk storage device, flash memory device, or other non-transitory solid state storage device. In some embodiments, memory 502 may optionally include memory located remotely from processor 501, and these remote memories may be connected over a network to a server executing the method of unit testing. Examples of such networks include, but are not limited to, the internet, intranets, local area networks, mobile communication networks, and combinations thereof.
The server of the execution method of the unit test may further include: an input device 503 and an output device 504. The processor 501, the memory 502, the input device 503 and the output device 504 may be connected by a bus or other means, and fig. 5 illustrates the connection by a bus as an example.
The input device 503 may receive input numeric or character information and generate key signal inputs related to user settings and function control of a server of the execution method of the unit test, such as an input device of a touch screen, a keypad, a mouse, a track pad, a touch pad, a pointing stick, one or more mouse buttons, a track ball, a joystick, or the like. The output devices 504 may include a display device, auxiliary lighting devices (e.g., LEDs), and haptic feedback devices (e.g., vibrating motors), among others. The display device may include, but is not limited to, a Liquid Crystal Display (LCD), a Light Emitting Diode (LED) display, and a plasma display. In some implementations, the display device can be a touch screen.
Various implementations of the systems and techniques described here can be realized in digital electronic circuitry, integrated circuitry, application specific ASICs (application specific integrated circuits), computer hardware, firmware, software, and/or combinations thereof. These various embodiments may include: implemented in one or more computer programs that are executable and/or interpretable on a programmable system including at least one programmable processor, which may be special or general purpose, receiving data and instructions from, and transmitting data and instructions to, a storage system, at least one input device, and at least one output device.
These computer programs (also known as programs, software applications, or code) include machine instructions for a programmable processor, and may be implemented using high-level procedural and/or object-oriented programming languages, and/or assembly/machine languages. As used herein, the terms "machine-readable medium" and "computer-readable medium" refer to any computer program product, apparatus, and/or device (e.g., magnetic discs, optical disks, memory, Programmable Logic Devices (PLDs)) used to provide machine instructions and/or data to a programmable processor, including a machine-readable medium that receives machine instructions as a machine-readable signal. The term "machine-readable signal" refers to any signal used to provide machine instructions and/or data to a programmable processor.
To provide for interaction with a user, the systems and techniques described here can be implemented on a computer having: a display device (e.g., a CRT (cathode ray tube) or LCD (liquid crystal display) monitor) for displaying information to a user; and a keyboard and a pointing device (e.g., a mouse or a trackball) by which a user can provide input to the computer. Other kinds of devices may also be used to provide for interaction with a user; for example, feedback provided to the user can be any form of sensory feedback (e.g., visual feedback, auditory feedback, or tactile feedback); and input from the user may be received in any form, including acoustic, speech, or tactile input.
The systems and techniques described here can be implemented in a computing system that includes a back-end component (e.g., as a data server), or that includes a middleware component (e.g., an application server), or that includes a front-end component (e.g., a user computer having a graphical user interface or a web browser through which a user can interact with an implementation of the systems and techniques described here), or any combination of such back-end, middleware, or front-end components. The components of the system can be interconnected by any form or medium of digital data communication (e.g., a communication network). Examples of communication networks include: local Area Networks (LANs), Wide Area Networks (WANs), and the Internet.
The computer system may include clients and servers. A client and server are generally remote from each other and typically interact through a communication network. The relationship of client and server arises by virtue of computer programs running on the respective computers and having a client-server relationship to each other. The Server can be a cloud Server, also called a cloud computing Server or a cloud host, and is a host product in a cloud computing service system, so as to solve the defects of high management difficulty and weak service expansibility in the traditional physical host and VPS service ("Virtual Private Server", or simply "VPS").
According to the technical scheme of the embodiment of the application, the deep learning field is involved, the probability of random errors in the unit testing process can be greatly reduced, and the task queuing time is shortened; the execution time of the unit test is shortened, the execution efficiency of the unit test is improved, and the resource utilization rate is improved; the development efficiency of developers is improved, and the software iteration speed is accelerated.
It should be understood that various forms of the flows shown above may be used, with steps reordered, added, or deleted. For example, the steps described in the present application may be executed in parallel, sequentially, or in different orders, and the present invention is not limited thereto as long as the desired results of the technical solutions disclosed in the present application can be achieved.
The above-described embodiments should not be construed as limiting the scope of the present application. It should be understood by those skilled in the art that various modifications, combinations, sub-combinations and substitutions may be made in accordance with design requirements and other factors. Any modification, equivalent replacement, and improvement made within the spirit and principle of the present application shall be included in the protection scope of the present application.

Claims (14)

1. A method of performing a unit test, comprising:
acquiring a task queue; the task queue comprises a plurality of unit test tasks;
performing task scheduling on a plurality of unit test tasks in the task queue to determine a target test task to be executed;
querying historical execution information of the target test task to determine first equipment which fails to execute the target test task;
and scheduling second equipment in the equipment set except the first equipment to execute the target test task.
2. The execution method of claim 1, wherein, after scheduling a second device of the set of devices other than the first device to execute the target test task, further comprising:
updating the failure times in the historical execution information under the condition that the second equipment fails to execute the target test task;
and under the condition that the updated failure times are smaller than a time threshold value, adding the target test task into the task queue, and adding the second equipment into an equipment list of failed equipment executed in the historical execution information.
3. The execution method of claim 2, wherein said adding the target test task to the task queue comprises:
configuring the priority of the target test task according to the updated failure times;
and adding the target test task to a corresponding position of the task queue according to the priority.
4. The execution method of claim 3, wherein the configuring the priority of the target test task according to the updated number of failures comprises:
determining a corresponding priority value range according to the updated failure times;
and determining the priority of the target test task configuration within the priority value range.
5. The execution method of claim 2, wherein after the updating the number of failures in the historical execution information, further comprising:
and deleting the target test task under the condition that the updated failure times are greater than or equal to the time threshold.
6. The execution method of claim 2, wherein the threshold number of times is less than or equal to a total number of devices in the set of devices.
7. An apparatus for performing a unit test, comprising:
the acquisition module is used for acquiring the task queue; the task queue comprises a plurality of unit test tasks;
the scheduling module is used for performing task scheduling on the plurality of unit test tasks in the task queue so as to determine a target test task to be executed;
the query module is used for querying the historical execution information of the target test task so as to determine first equipment which fails to execute the target test task;
and the execution module is used for scheduling second equipment in the equipment set except the first equipment to execute the target test task.
8. The execution apparatus of claim 7, further comprising:
the updating module is used for updating the failure times in the historical execution information under the condition that the second equipment fails to execute the target test task;
and the adding module is used for adding the target test task into the task queue and adding the second equipment into an equipment list of the failed equipment executed in the historical execution information under the condition that the updated failure times are smaller than a time threshold.
9. The execution device of claim 8, wherein the adding module comprises:
the configuration unit is used for configuring the priority of the target test task according to the updated failure times;
and the adding unit is used for adding the target test task to the corresponding position of the task queue according to the priority.
10. The execution apparatus of claim 9, wherein the configuration unit comprises:
the first determining subunit is configured to determine a corresponding priority value range according to the updated failure times;
and the second determining subunit is used for determining the priority of the target test task configuration in the priority value range.
11. The execution apparatus of claim 8, further comprising:
and the deleting module is used for deleting the target test task under the condition that the updated failure times are greater than or equal to the time threshold.
12. The execution apparatus of claim 8, wherein the threshold number of times is less than or equal to a total number of devices in the set of devices.
13. A server, comprising:
at least one processor; and
a memory communicatively coupled to the at least one processor; wherein the content of the first and second substances,
the memory stores instructions executable by the at least one processor to enable the at least one processor to perform the method of any of claims 1-6.
14. A non-transitory computer readable storage medium storing computer instructions for causing a computer to perform the method of any one of claims 1-6.
CN202011359878.6A 2020-11-27 2020-11-27 Execution method, execution device, server and storage medium for unit test Pending CN112540914A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202011359878.6A CN112540914A (en) 2020-11-27 2020-11-27 Execution method, execution device, server and storage medium for unit test

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202011359878.6A CN112540914A (en) 2020-11-27 2020-11-27 Execution method, execution device, server and storage medium for unit test

Publications (1)

Publication Number Publication Date
CN112540914A true CN112540914A (en) 2021-03-23

Family

ID=75015199

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202011359878.6A Pending CN112540914A (en) 2020-11-27 2020-11-27 Execution method, execution device, server and storage medium for unit test

Country Status (1)

Country Link
CN (1) CN112540914A (en)

Cited By (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN113127172A (en) * 2021-04-21 2021-07-16 上海销氪信息科技有限公司 Task execution method and device, electronic equipment and storage medium
CN113204478A (en) * 2021-04-06 2021-08-03 北京百度网讯科技有限公司 Method, device and equipment for running test unit and storage medium
CN117271501A (en) * 2023-11-23 2023-12-22 山东省国土空间数据和遥感技术研究院(山东省海域动态监视监测中心) Data quality inspection method and device, electronic equipment and storage medium
CN117785431A (en) * 2024-02-27 2024-03-29 云粒智慧科技有限公司 Task scheduling distribution method and device, electronic equipment and storage medium

Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20150331779A1 (en) * 2014-05-13 2015-11-19 Unisys Corporation Framework to accommodate test plan changes without affecting or interrupting test execution
CN107943686A (en) * 2017-10-30 2018-04-20 北京奇虎科技有限公司 A kind of test dispatching method, apparatus, server and storage medium
CN107943684A (en) * 2017-10-30 2018-04-20 北京奇虎科技有限公司 A kind of test crash retries method, apparatus, server and storage medium
CN108459961A (en) * 2017-12-29 2018-08-28 微梦创科网络科技(中国)有限公司 The method, client and server of examination are resurveyed after a kind of failure of testing case

Patent Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20150331779A1 (en) * 2014-05-13 2015-11-19 Unisys Corporation Framework to accommodate test plan changes without affecting or interrupting test execution
CN107943686A (en) * 2017-10-30 2018-04-20 北京奇虎科技有限公司 A kind of test dispatching method, apparatus, server and storage medium
CN107943684A (en) * 2017-10-30 2018-04-20 北京奇虎科技有限公司 A kind of test crash retries method, apparatus, server and storage medium
CN108459961A (en) * 2017-12-29 2018-08-28 微梦创科网络科技(中国)有限公司 The method, client and server of examination are resurveyed after a kind of failure of testing case

Cited By (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN113204478A (en) * 2021-04-06 2021-08-03 北京百度网讯科技有限公司 Method, device and equipment for running test unit and storage medium
CN113204478B (en) * 2021-04-06 2022-05-03 北京百度网讯科技有限公司 Method, device and equipment for operating test unit and storage medium
CN113127172A (en) * 2021-04-21 2021-07-16 上海销氪信息科技有限公司 Task execution method and device, electronic equipment and storage medium
CN117271501A (en) * 2023-11-23 2023-12-22 山东省国土空间数据和遥感技术研究院(山东省海域动态监视监测中心) Data quality inspection method and device, electronic equipment and storage medium
CN117785431A (en) * 2024-02-27 2024-03-29 云粒智慧科技有限公司 Task scheduling distribution method and device, electronic equipment and storage medium

Similar Documents

Publication Publication Date Title
CN110806923B (en) Parallel processing method and device for block chain tasks, electronic equipment and medium
CN111753997B (en) Distributed training method, system, device and storage medium
CN112540914A (en) Execution method, execution device, server and storage medium for unit test
EP3859533A2 (en) Method and apparatus for testing map service, electronic device, storage medium and computer program product
CN112925651A (en) Application resource deployment method, device, electronic equipment and medium
CN112925652A (en) Application resource deployment method, device, electronic equipment and medium
CN111625949A (en) Simulation engine system, simulation processing method, device and medium
CN110706147A (en) Image processing environment determination method and device, electronic equipment and storage medium
CN111158666A (en) Entity normalization processing method, device, equipment and storage medium
CN112199355A (en) Data migration method and device, electronic equipment and storage medium
CN112560499A (en) Pre-training method and device of semantic representation model, electronic equipment and storage medium
CN111782341A (en) Method and apparatus for managing clusters
CN112306646A (en) Method, device, equipment and readable storage medium for processing transaction
CN111625195A (en) Method and device for server capacity expansion
CN110752968A (en) Performance benchmark test method and device, electronic equipment and storage medium
CN111966471B (en) Access method, device, electronic equipment and computer storage medium
CN111782147A (en) Method and apparatus for cluster scale-up
CN112214416A (en) Method and device for debugging small program, electronic equipment and storage medium
CN111966877A (en) Front-end service method, device, equipment and storage medium
CN111865686A (en) Cloud product capacity expansion method, device, equipment and storage medium
CN111680599A (en) Face recognition model processing method, device, equipment and storage medium
CN111782357A (en) Label control method and device, electronic equipment and readable storage medium
CN115639953A (en) Data migration method and device
CN112486644A (en) Method, apparatus, device and storage medium for generating information
CN111258954B (en) Data migration method, device, equipment and storage medium

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