CN114519006A - Test method, device, equipment and storage medium - Google Patents

Test method, device, equipment and storage medium Download PDF

Info

Publication number
CN114519006A
CN114519006A CN202210141360.8A CN202210141360A CN114519006A CN 114519006 A CN114519006 A CN 114519006A CN 202210141360 A CN202210141360 A CN 202210141360A CN 114519006 A CN114519006 A CN 114519006A
Authority
CN
China
Prior art keywords
test
group
case
consuming
case group
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
CN202210141360.8A
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 CN202210141360.8A priority Critical patent/CN114519006A/en
Publication of CN114519006A publication Critical patent/CN114519006A/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/3684Test management for test design, e.g. generating new test cases
    • 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
    • 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/3676Test management for coverage analysis
    • 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/3692Test management for test results analysis

Abstract

The disclosure provides a test method, a test device, test equipment and a storage medium, and relates to the technical field of tests. The method comprises the following steps: acquiring a test case set; grouping the test cases in the test case set to obtain at least one test case group; sequencing at least one test case group according to the priority order; and adding each test case group to the test queue based on the sequencing result so that the preset number of nodes obtain the test cases from the test queue and test the test cases. The testing method provided by the disclosure shortens the testing time and improves the testing efficiency.

Description

Test method, device, equipment and storage medium
Technical Field
The present disclosure relates to the field of computers, and more particularly, to the field of testing technologies, and more particularly, to a testing method, an apparatus, a device, and a storage medium.
Background
Unit Test (Unit Test) refers to checking and verifying the smallest testable Unit in software, and is the most important ring for software quality verification in continuous construction. However, for a mature code library, the number of unit test cases is generally very large, and it usually takes a long time to perform a complete test process, so the test time also becomes a key point for affecting the development performance.
Disclosure of Invention
The disclosure provides a test method, apparatus, device and storage medium.
According to a first aspect of the present disclosure, there is provided a test method comprising: acquiring a test case set; grouping the test cases in the test case set to obtain at least one test case group; sequencing at least one test case group according to the priority order; and adding each test case group to the test queue based on the sequencing result so that the preset number of nodes obtain the test cases from the test queue and test the test cases.
According to a second aspect of the present disclosure, there is provided a test apparatus comprising: the test case set acquisition module is configured to acquire a test case set; the grouping module is configured to group the test cases in the test case set to obtain at least one test case group; the sequencing module is configured to sequence at least one test case group according to a priority order; and the test module is configured to add each test case group to the test queue based on the sequencing result so that the preset number of nodes acquire the test cases from the test queue and test the test cases.
According to a third aspect of the present disclosure, there is provided an electronic device comprising: at least one processor; and a memory communicatively coupled to the at least one processor; wherein the memory stores instructions executable by the at least one processor to enable the at least one processor to perform the method as described in any one of the implementations of the first aspect.
According to a fourth aspect of the present disclosure, there is provided a non-transitory computer readable storage medium having stored thereon computer instructions for causing a computer to perform the method as described in any one of the implementations of the first aspect.
According to a fifth aspect of the present disclosure, a computer program product is provided, comprising a computer program which, when executed by a processor, implements the method as described in any of the implementations of the first aspect.
It should be understood that the statements in this section do not necessarily identify key or critical features of the embodiments of the present disclosure, nor do they limit the scope of the present disclosure. Other features of the present disclosure will become apparent from the following description.
Drawings
The drawings are included to provide a better understanding of the present solution and are not to be construed as limiting the present disclosure. Wherein:
FIG. 1 is an exemplary system architecture diagram in which the present disclosure may be applied;
FIG. 2 is a flow diagram of one embodiment of a testing method according to the present disclosure;
FIG. 3 is a flow diagram of another embodiment of a testing method according to the present disclosure;
FIG. 4 is a schematic diagram of one application scenario of a testing method according to the present disclosure;
FIG. 5 is a schematic diagram of a grouping process of test cases;
FIG. 6 is a schematic structural diagram of one embodiment of a testing device according to the present disclosure;
FIG. 7 is a block diagram of an electronic device used to implement the testing method of an embodiment of the present disclosure.
Detailed Description
Exemplary embodiments of the present disclosure are described below with reference to the accompanying drawings, in which various details of the embodiments of the disclosure are included to assist understanding, and which are to be considered as merely exemplary. 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 disclosure. Also, descriptions of well-known functions and constructions are omitted in the following description for clarity and conciseness.
It should be noted that, in the present disclosure, the embodiments and features of the embodiments may be combined with each other without conflict. The present disclosure will be described in detail below with reference to the accompanying drawings in conjunction with embodiments.
Fig. 1 illustrates an exemplary system architecture 100 to which embodiments of the testing method or testing apparatus of the present disclosure may be applied.
As shown in fig. 1, the system architecture 100 may include terminal devices 101, 102, 103, a network 104, and a server 105. Network 104 is the medium used to provide communication links between terminal devices 101, 102, 103 and server 105. Network 104 may include various connection types, such as wired, wireless communication links, or fiber optic cables, among others.
A user may use terminal devices 101, 102, 103 to interact with a server 105 over a network 104 to receive or transmit information or the like. Various client applications may be installed on the terminal devices 101, 102, 103.
The terminal apparatuses 101, 102, and 103 may be hardware or software. When the terminal devices 101, 102, 103 are hardware, they may be various electronic devices including, but not limited to, smart phones, tablet computers, laptop portable computers, desktop computers, and the like. When the terminal apparatuses 101, 102, 103 are software, they can be installed in the above-described electronic apparatuses. It may be implemented as multiple pieces of software or software modules, or as a single piece of software or software module. And is not particularly limited herein.
The server 105 may provide various services. For example, the server 105 may analyze and process the test case set acquired from the terminal apparatuses 101, 102, 103, and generate a processing result (e.g., generate a test queue).
The server 105 may be hardware or software. When the server 105 is hardware, it may be implemented as a distributed server cluster composed of a plurality of servers, or may be implemented as a single server. When the server 105 is software, it may be implemented as multiple pieces of software or software modules (e.g., to provide distributed services), or as a single piece of software or software module. And is not particularly limited herein.
It should be noted that the testing method provided by the embodiment of the present disclosure is generally executed by the server 105, and accordingly, the testing apparatus is generally disposed in the server 105.
It should be understood that the number of terminal devices, networks, and servers in fig. 1 is merely illustrative. There may be any number of terminal devices, networks, and servers, as desired for implementation.
With continued reference to FIG. 2, a flow 200 of one embodiment of a testing method according to the present disclosure is shown. The test method comprises the following steps:
Step 201, a test case set is obtained.
In this embodiment, an execution subject of the test method (for example, the server 105 shown in fig. 1) obtains a test case set, where the test case set includes a plurality of test cases, and the test cases are cases that need to be tested. For example, the execution main body may first obtain a plurality of files to be tested, and then determine whether the files to be tested are test cases that need to be tested according to the content of the defined portion in the files to be tested, so as to obtain a test case set.
The test file refers to a file that can be run. For a compiled language, such as Java, C + +, etc., the execution entity compiles the compiled language first to obtain a test file that can be finally executed. And aiming at the test tasks of the same version, the history of the same version is directly obtained for testing, namely, the history output is multiplexed, and the test file is not reconstructed. And the third-party dependence used by the code base is buffered, so that the instable time consumption of constructing the dependence each time is reduced, and the testing efficiency is improved.
Step 202, grouping the test cases in the test case set to obtain at least one test case group.
In this embodiment, the execution subject groups test cases in the test case set, so as to obtain at least one test case group. Since many frames or cases need to have a certain context preparation cost for running, in order to reduce this time consumption, the test cases are issued in groups in this embodiment, and the granularity of test case grouping greatly affects the efficiency of test execution. Too coarse granularity may result in individual nodes already completing testing, while other nodes still need a long time to run the tasks in the group, thereby not fully utilizing the advantages of the multiple nodes. If the granularity is too fine, too much extra time is introduced in the scenes that the execution speed of some test tasks is high and the context preparation is time-consuming, so that the test efficiency cannot be effectively improved. Therefore, in this embodiment, the execution subject generates an appropriate grouping granularity based on the test framework, the historical elapsed time, the total number of test cases, and the number of concurrently executable test cases, and then groups the test cases in the test case set based on the granularity, thereby obtaining at least one test case group. The number of concurrently executable programs may be set by a user, or may be set by the execution main unit according to a test condition, which is not specifically limited in this embodiment. Optionally, the executing body further performs feature calculation for each packet, and stores execution information of the feature calculation.
And step 203, sequencing at least one test case group according to the priority order.
In this embodiment, the execution entity sorts the at least one test case group obtained in step 202 according to a priority order. For example, when the at least one test case group generated in step 202 includes a first test group, a second test group, and a third test group, and the priority of the second test group is greater than the priority of the first test group, and the priority of the second test group is greater than the priority of the third test group, the execution subject sorts the first test group, the second test group, and the third test group according to the priority order of the second test group, the first test group, and the third test group, where the priority order of the first test group, the second test group, and the third test group may be determined according to the test elapsed time, and may of course be determined according to other conditions, which is not limited in this embodiment.
And 204, adding each test case group to the test queue based on the sequencing result so that the preset number of nodes acquire the test cases from the test queue and test the test cases.
In this embodiment, the execution subject may add each test case group to the test queue based on the sorting result obtained in step 203, so that a preset number of nodes obtain test cases from the test queue, and test the obtained test cases. The test queue may be a distributed queue, the test nodes may be lightweight programs deployed in a plurality of containers, and the preset number is set according to an actual situation. After the test nodes in the multiple containers are started, data resources are synchronously output to the local, and tasks are sequentially obtained from the test queue for testing. The log, time consumption, process state and produced result file of each group are recorded in the whole execution, and the result file is stored in real time.
Optionally, after all the test cases are tested, the execution main body performs aggregation analysis on the data files generated by the nodes to obtain a test result file corresponding to each test case, where the test result file may include, but is not limited to, information such as a test result, a coverage result, a log summary, and a time-consuming analysis record.
The test method provided by the embodiment of the disclosure includes firstly, obtaining a test case set; then grouping the test cases in the test case set to obtain at least one test case group; then, at least one test case group is sequenced according to the priority order; and finally, adding each test case group to the test queue based on the sequencing result so that the preset number of nodes can obtain the test cases from the test queue and test the test cases. In the testing method in the embodiment, a distributed concurrent execution testing mode is adopted, serial testing tasks are distributed to a plurality of machine nodes with variable quantities according to the size of a project, and a grouping and sequencing algorithm is added to realize optimal and most efficient scheduling, so that on the premise of ensuring the testing quality, the testing time is shortened, the testing efficiency is improved, and the resource utilization rate is further improved.
In the technical scheme of the disclosure, the processes of collecting, storing, using, processing, transmitting, providing, disclosing and the like of the personal information of the related user all accord with the regulations of related laws and regulations, and do not violate the common customs of public order.
With continued reference to fig. 3, fig. 3 illustrates a flow 300 of another embodiment of a testing method according to the present disclosure. The test method comprises the following steps:
step 301, a test case set is obtained.
In this embodiment, an execution subject of the test method (e.g., the server 105 shown in fig. 1) may obtain a test case set.
In some optional implementations of this embodiment, the test case set includes at least one test case; and the test case is generated by the following steps: acquiring a test file; and determining whether the test file is a test case to be tested or not according to the predefined content in the test file.
In this implementation manner, the test case set in this embodiment may include at least one test case, and the test case is generated through the following steps: first, the execution body obtains a test file, where the test file may be a compiled executable file, or a historical version file. Because the test frames of different languages have different requirements on the definition part of the test case, the execution main body can judge whether the test file meets the requirements through the predefined content in the test file, namely, whether the test file is the test case needing to be tested is determined, so that the test case set needing to be tested is obtained, and the test case set can be automatically and efficiently determined.
Step 302, grouping the test cases in the test case set to obtain at least one test case group.
In this embodiment, the execution body may group the test cases in the test case set to obtain at least one test case group.
In some optional implementations of this embodiment, step 302 includes: dividing the test cases with historical time-consuming records into a group to obtain a known time-consuming case group; and dividing the test cases without the historical time-consuming records into a group to obtain an unknown time-consuming case group.
In the implementation manner, for each test case in the test case set, the execution main body first judges whether historical time consumption information of the test case exists in a historical group or not through a fingerprint identifier of the test case, and divides the test cases with historical time consumption records into a group, so that a known time consumption case group is obtained; that is, the historical grouping and the current test case set are subjected to intersection by fingerprint identification, so that a known time-consuming case set is obtained, the historical time-consuming information of the test cases in the known time-consuming case set is obtained, and the test cases in the known time-consuming case set are arranged according to the historical time-consuming reverse order.
And then, dividing the test cases without the historical time-consuming records into a group, namely, taking a difference set from the historical group and the current test case set through fingerprint identification, thereby obtaining an unknown time-consuming case group.
Test cases in the test case set are grouped based on historical consumed time, so that sequencing can be reasonably performed according to the consumed time, and the test efficiency is improved.
In some optional implementations of this embodiment, step 302 further includes: and dividing test cases which fail in the known time-consuming case group into a group to obtain a failed case group.
In the implementation mode, in consideration of early exposure of problems, the execution main body can group the known time-consuming case groups again, test cases with test failures are divided into one group from the known time-consuming case groups, and the failed case groups are obtained, so that the test cases in the failed case groups can be processed as soon as possible, and the test speed is improved.
In some optional implementations of this embodiment, step 302 further includes: dividing test cases with historical time consumption larger than a preset threshold value in a known time-consuming case group into a group to obtain a long time-consuming case group; and dividing the test cases with historical time consumption not greater than a preset threshold value in the known time-consuming case group into a group to obtain a short time-consuming case group.
In the implementation manner, the execution main body judges whether the historical consumed time of the test cases in the known consumed time case group exceeds a preset threshold, and divides the test cases with the historical consumed time greater than the preset threshold into a group to obtain a long consumed time case group; and dividing the test cases with historical time consumption not more than a preset threshold value in the known time-consuming case group into a group to obtain a short time-consuming case group.
And the test cases in the known time-consuming case group are grouped again based on time consumption, and are split into groups with smaller granularity for issuing, so that the test speed can be further improved.
And 303, sequencing at least one test case group according to the priority order.
In this embodiment, the execution subject may sort at least one test case group according to a priority order.
In some optional embodiments of this embodiment, the priority order of at least one test case group is: a failed use case group, a long time-consuming use case group, an unknown time-consuming use case group, and a short time-consuming use case group.
In the implementation manner, the task with longer consumed time is executed with higher priority, and the overall consumed time is reduced, so that the scheduling priority order is modified by referring to historical consumed time feedback for test case packets before the test cases are released. Setting the priority of the failed use case group to be the highest in consideration of early exposure and early resolution; the task consuming long time often becomes the key for improving the testing efficiency, so the priority of the long-time-consuming case group is set as the second; and the short time consumption means that the test case can be executed quickly, so the priority of the short time consumption case group is set to be the lowest, and therefore, the priority sequence of at least one test case group is as follows: failed use case group > long time consuming use case group > unknown time consuming use case group > short time consuming use case group. By adjusting the priority order of each test case group, the test efficiency can be further improved.
And 304, adding each test case group to the test queue based on the sequencing result so that the preset number of nodes acquire the test cases from the test queue and test the test cases.
In this embodiment, the execution main body adds each test case group to the test queue based on the sorting result, so that a preset number of nodes acquire the test cases from the test queue and test the test cases, and thus, the tasks are issued to the cloud test queue in an ordered queue manner, so that the test nodes test the test cases.
The steps 301-304 are substantially the same as the steps 201-204 in the foregoing embodiment, and the specific implementation manner can refer to the foregoing description of the steps 201-204, which is not described herein again.
Step 305, obtaining test files generated by testing the test cases by a preset number of nodes.
In this embodiment, the execution body may obtain a test file generated by testing the test case by a preset number of nodes. The preset number may be set according to an actual situation, which is not specifically limited in this embodiment. After the test nodes in each container are started, data resources can be synchronously output to the local, and after all test cases are executed, the execution main body can acquire the generated test files.
And step 306, performing aggregation analysis on the test files to obtain a final test result of the test case.
In this embodiment, the execution subject may perform aggregation analysis on the test files obtained in step 305, so as to obtain a final test result of the test case. The method for aggregation analysis can be implemented by using the prior art, and is not described herein again. The final test results include, but are not limited to, test results, coverage results, log summaries, and time-consuming analysis records.
By carrying out aggregation analysis on the test files generated by each node, the final test result of the test case can be generated, and thus the test of the test case is completed.
In this embodiment, the execution time of a single task is reduced by adopting a distributed single test mode, and the overall execution time of the total task is also reduced. For example, a single test task that takes 5 minutes (min) is executed serially under the condition of 5 resource nodes, and each task needs 5min after being executed; and under the condition of distributed tasks, tasks consuming 5min are distributed to 5 resource nodes, the execution of a single task needs 1min, under the condition of full resource load, the waiting time of a second task is 1min, the execution time is 1min, and the total time consumption is 2 min. By analogy, the longest task also takes only 5 min. The overall execution efficiency is improved. Similarly, when the limited resources can finish the task more quickly, the task throughput of each resource is improved, and the utilization rate of the whole resources is further improved.
As can be seen from fig. 3, compared with the embodiment corresponding to fig. 2, the test method in this embodiment highlights a step of grouping the test cases and a step of generating a final test result of the test cases, in this embodiment, a single test task is divided into a plurality of subtasks with finer granularity to be executed, and time consumed for executing the single subtask is shorter, so that limited resources can complete more tasks in a shorter time, and therefore, the method reduces the overall execution time, improves the utilization rate of the resources, and makes scheduling of the resources more effective.
With continued reference to fig. 4, fig. 4 shows a schematic diagram of one application scenario of a testing method according to the present disclosure. In the application scenario, the execution subject of the test method performs case scheduling first. Firstly, the execution main body is compiled and constructed, and concentrated compiling is carried out before use case scheduling aiming at a compiled language so as to obtain a single test file which can be finally operated; the historical output is reused for the task execution of the same version, and repeated construction is not sent again; and buffering the dependency aiming at the third-party dependency used in the compiling of the code base so as to reduce the time consumption of pulling the constructed dependency each time, and filing and storing the final produced file. Then, the execution main body can perform case retrieval based on the test characteristics, and because different test frames of different languages have different requirements on the definition of the test case, the execution main body can identify the real test case through the definition part in the test case, so as to determine the case set to be tested. And then, the execution main body groups the test case sets to be tested based on the concurrency number of the test, and releases the test cases in a group form, so that the preparation time consumption during the test can be reduced, and the test efficiency is improved.
With further reference to fig. 5, fig. 5 shows a grouping process of test cases, after a case set to be tested (i.e. a current case set) is determined, the execution subject performs grouping based on a historical time-consuming case set, for example, an intersection is taken between the current case set and the historical time-consuming case set, so as to obtain a known time-consuming case set, and a difference set is taken between the current case set and the historical time-consuming case set, so as to obtain an unknown time-consuming case set. Then, considering the early exposure of the problem, the execution body groups the known time-consuming case sets again, and divides the test cases with failed tests from the known time-consuming case sets into a group to obtain a failed case set. Dividing the test cases with historical time consumption larger than a preset threshold into a group to obtain a long time consumption case set; and dividing the test cases with historical time consumption not greater than a preset threshold value in the known time-consuming case group into a group to obtain a short time-consuming case set.
Then, the execution subject generates the latest priority pair as: a failed use case set, a long time-consuming use case set, an unknown time-consuming use case set, and a short time-consuming use case set. And finally, issuing each test task to a cloud task queue in an ordered queue mode, wherein the cloud task queue comprises a task 1, a task 2 and a task 3 … ….
And then, after the execution containers are started, the execution containers synchronously output and data resources to the local, and sequentially acquire and execute tasks from the ordered task queue of the cloud, namely, testing is carried out, and the execution main body can record the log, time consumption, process state and output result files of each group.
And finally, after all the test cases are executed, the execution main body performs aggregation analysis on the data files generated by the nodes, and generates final test results, coverage rate results, log summarization, time-consuming analysis records and the like. Therefore, serial tasks are distributed to a plurality of machine nodes with variable quantity according to the size of a project in a mode of executing single test concurrently, and efficient scheduling is achieved. And then under the prerequisite of guaranteeing test quality, shortened the test duration, promoted efficiency of software testing.
With further reference to fig. 6, as an implementation of the method shown in the above figures, the present disclosure provides an embodiment of a testing apparatus, which corresponds to the embodiment of the method shown in fig. 2, and which may be applied in various electronic devices.
As shown in fig. 6, the test apparatus 600 of the present embodiment includes: a first acquisition module 601, a grouping module 602, a sorting module 603, and a testing module 604. The first obtaining module 601 is configured to obtain a test case set; a grouping module 602 configured to group the test cases in the test case set to obtain at least one test case group; a sorting module 603 configured to sort at least one test case group according to a priority order; the test module 604 is configured to add each test case group to the test queue based on the sorting result, so that a preset number of nodes obtain the test cases from the test queue and test the test cases.
In this embodiment, in the test apparatus 600: the specific processing of the first obtaining module 601, the grouping module 602, the sorting module 603, and the testing module 604 and the technical effects thereof can refer to the related descriptions of step 201 and step 204 in the corresponding embodiment of fig. 2, which are not described herein again.
In some optional implementations of this embodiment, the test case set includes at least one test case; and the test case is generated by the following steps: acquiring a test file; and determining whether the test file is a test case to be tested or not according to the predefined content in the test file.
In some optional implementations of this embodiment, the grouping module includes: the first grouping submodule is configured to group the test cases with historical time consumption records into a group to obtain a known time consumption case group; and the second grouping submodule is configured to group the test cases without the historical time consumption records into a group, so that an unknown time consumption case group is obtained.
In some optional implementations of this embodiment, the grouping module further includes: and the third grouping submodule is configured to group the test cases which fail in the known time-consuming case group into one group, so as to obtain a failed case group.
In some optional implementations of this embodiment, the grouping module further includes: the fourth grouping submodule is configured to group the test cases with historical time consumption larger than a preset threshold value in the known time-consuming case group to obtain a long time-consuming case group; and the fifth grouping submodule is configured to group the test cases with historical time consumption not greater than a preset threshold value in the known time-consuming case groups to obtain a short time-consuming case group.
In some optional implementation manners of this embodiment, the priority order of at least one test case group is: a failed case group, a long time-consuming case group, an unknown time-consuming case group, and a short time-consuming case group.
In some optional implementations of the present embodiment, the testing apparatus 600 further includes: the second acquisition module is configured to acquire test files generated by testing the test cases by a preset number of nodes; and the aggregation module is configured to perform aggregation analysis on the test files to obtain a final test result of the test case.
The present disclosure also provides an electronic device, a readable storage medium, and a computer program product according to embodiments of the present disclosure.
FIG. 7 illustrates a schematic block diagram of an example electronic device 700 that can be used to implement embodiments of the present disclosure. Electronic devices are 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 electronic device 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 disclosure described and/or claimed herein.
As shown in fig. 7, the device 700 comprises a computing unit 701, which may perform various suitable actions and processes according to a computer program stored in a Read Only Memory (ROM)702 or a computer program loaded from a storage unit 708 into a Random Access Memory (RAM) 703. In the RAM 703, various programs and data required for the operation of the device 700 can also be stored. The computing unit 701, the ROM 702, and the RAM 703 are connected to each other by a bus 704. An input/output (I/O) interface 705 is also connected to bus 704.
Various components in the device 700 are connected to the I/O interface 705, including: an input unit 706 such as a keyboard, a mouse, or the like; an output unit 707 such as various types of displays, speakers, and the like; a storage unit 708 such as a magnetic disk, optical disk, or the like; and a communication unit 709 such as a network card, modem, wireless communication transceiver, etc. The communication unit 709 allows the device 700 to exchange information/data with other devices via a computer network, such as the internet, and/or various telecommunication networks.
Computing unit 701 may be a variety of general purpose and/or special purpose processing components with processing and computing capabilities. Some examples of the computing unit 701 include, but are not limited to, a Central Processing Unit (CPU), a Graphics Processing Unit (GPU), various specialized Artificial Intelligence (AI) computing chips, various computing units running machine learning model algorithms, a Digital Signal Processor (DSP), and any suitable processor, controller, microcontroller, and so forth. The calculation unit 701 executes the respective methods and processes described above, such as the test method. For example, in some embodiments, the testing method may be implemented as a computer software program tangibly embodied in a machine-readable medium, such as storage unit 708. In some embodiments, part or all of a computer program may be loaded onto and/or installed onto device 700 via ROM 702 and/or communications unit 709. When the computer program is loaded into RAM 703 and executed by the computing unit 701, one or more steps of the testing method described above may be performed. Alternatively, in other embodiments, the computing unit 701 may be configured to perform the testing method by any other suitable means (e.g., by means of firmware).
Various implementations of the systems and techniques described here above may be implemented in digital electronic circuitry, integrated circuitry, Field Programmable Gate Arrays (FPGAs), Application Specific Integrated Circuits (ASICs), Application Specific Standard Products (ASSPs), system on a chip (SOCs), load programmable logic devices (CPLDs), 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.
Program code for implementing the methods of the present disclosure may be written in any combination of one or more programming languages. These program codes may be provided to a processor or controller of a general purpose computer, special purpose computer, or other programmable data processing apparatus, such that the program codes, when executed by the processor or controller, cause the functions/operations specified in the flowchart and/or block diagram to be performed. The program code may execute entirely on the machine, partly on the machine, as a stand-alone software package, partly on the machine and partly on a remote machine or entirely on the remote machine or server.
In the context of this disclosure, a machine-readable medium may be a tangible medium that can contain, or store a program for use by or in connection with an instruction execution system, apparatus, or device. The machine-readable medium may be a machine-readable signal medium or a machine-readable storage medium. A machine-readable medium may include, but is not limited to, an electronic, magnetic, optical, electromagnetic, infrared, or semiconductor system, apparatus, or device, or any suitable combination of the foregoing. More specific examples of a machine-readable storage medium would include an electrical connection based on one or more wires, a portable computer diskette, a hard disk, a Random Access Memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM or flash memory), an optical fiber, a portable compact disc read-only memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination of the foregoing.
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.
Cloud computing (cloud computer) refers to a technology architecture that accesses a flexibly extensible shared physical or virtual resource pool through a network, where the resource may include a server, an operating system, a network, software, an application or a storage device, and the like, and can be deployed and managed in an on-demand and self-service manner. Through the cloud computing technology, high-efficiency and strong data processing capacity can be provided for technical application and model training of artificial intelligence, block chains and the like.
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 may be a cloud server, a server of a distributed system, or a server with a combined blockchain.
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 disclosure may be executed in parallel, sequentially, or in different orders, as long as the desired results of the technical solutions disclosed in the present disclosure can be achieved, and the present disclosure is not limited herein.
The above detailed description should not be construed as limiting the scope of the disclosure. 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 disclosure should be included in the scope of protection of the present disclosure.

Claims (17)

1. A method of testing, comprising:
acquiring a test case set;
grouping the test cases in the test case set to obtain at least one test case group;
sequencing the at least one test case group according to a priority order;
and adding each test case group to a test queue based on the sequencing result so that a preset number of nodes acquire test cases from the test queue and test the test cases.
2. The method of claim 1, wherein the set of test cases comprises at least one test case; and
the test case is generated by the following steps:
acquiring a test file;
and determining whether the test file is a test case to be tested or not according to the predefined content in the test file.
3. The method of claim 1, wherein the grouping test cases in the set of test cases to obtain at least one test case group comprises:
dividing the test cases with historical time consumption records into a group to obtain a known time consumption case group;
and dividing the test cases without the historical time-consuming records into a group to obtain an unknown time-consuming case group.
4. The method of claim 3, wherein the grouping test cases in the test case set to obtain at least one test case group further comprises:
And dividing the test cases which fail in the known time-consuming case group into a group to obtain a failed case group.
5. The method of claim 4, wherein the grouping of the test cases in the set of test cases to obtain at least one test case group further comprises:
dividing the test cases with historical time consumption larger than a preset threshold value in the known time-consuming case group into a group to obtain a long time-consuming case group;
and dividing the test cases with historical time consumption not more than a preset threshold value in the known time-consuming case group into a group to obtain a short time-consuming case group.
6. The method of claim 5, wherein the at least one test case group has a priority order of: a failed case group, a long time-consuming case group, an unknown time-consuming case group, and a short time-consuming case group.
7. The method of any of claims 1-6, further comprising:
acquiring a test file generated by testing the test case by the preset number of nodes;
and performing aggregation analysis on the test file to obtain a final test result of the test case.
8. A test apparatus, comprising:
the test case set acquisition module is configured to acquire a test case set;
The grouping module is configured to group the test cases in the test case set to obtain at least one test case group;
a sorting module configured to sort the at least one test case group according to a priority order;
and the test module is configured to add each test case group to the test queue based on the sequencing result so that a preset number of nodes acquire the test cases from the test queue and test the test cases.
9. The apparatus of claim 8, wherein the set of test cases comprises at least one test case; and
the test case is generated by the following steps:
acquiring a test file;
and determining whether the test file is a test case to be tested or not according to the predefined content in the test file.
10. The apparatus of claim 8, wherein the grouping module comprises:
the first grouping submodule is configured to group the test cases with historical time consumption records into a group to obtain a known time consumption case group;
and the second grouping submodule is configured to group the test cases without the historical time consumption records into a group, so that an unknown time consumption case group is obtained.
11. The apparatus of claim 10, wherein the grouping module further comprises:
and the third grouping submodule is configured to group the test cases which fail the test in the known time-consuming case group to obtain a failed case group.
12. The apparatus of claim 11, wherein the grouping module further comprises:
the fourth grouping submodule is configured to group the test cases with historical time consumption larger than a preset threshold value in the known time-consuming case group into a group, so that a long time-consuming case group is obtained;
and the fifth grouping submodule is configured to group the test cases with historical time consumption not greater than a preset threshold value in the known time-consuming case groups into one group, so as to obtain a short time-consuming case group.
13. The apparatus of claim 12, wherein the priority order of the at least one test case group is: a failed case group, a long time-consuming case group, an unknown time-consuming case group, and a short time-consuming case group.
14. The apparatus of any of claims 8-13, further comprising:
the second obtaining module is configured to obtain a test file generated by testing the test case by the preset number of nodes;
and the aggregation module is configured to perform aggregation analysis on the test files to obtain a final test result of the test case.
15. An electronic device, 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 one of claims 1-7.
16. A non-transitory computer readable storage medium having stored thereon computer instructions for causing the computer to perform the method of any one of claims 1-7.
17. A computer program product comprising a computer program which, when executed by a processor, implements the method according to any one of claims 1-7.
CN202210141360.8A 2022-02-16 2022-02-16 Test method, device, equipment and storage medium Pending CN114519006A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202210141360.8A CN114519006A (en) 2022-02-16 2022-02-16 Test method, device, equipment and storage medium

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202210141360.8A CN114519006A (en) 2022-02-16 2022-02-16 Test method, device, equipment and storage medium

Publications (1)

Publication Number Publication Date
CN114519006A true CN114519006A (en) 2022-05-20

Family

ID=81598852

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202210141360.8A Pending CN114519006A (en) 2022-02-16 2022-02-16 Test method, device, equipment and storage medium

Country Status (1)

Country Link
CN (1) CN114519006A (en)

Cited By (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN115374019A (en) * 2022-10-27 2022-11-22 畅捷通信息技术股份有限公司 Method and system for testing distributed UI test cases and computer storage medium
CN116755953A (en) * 2023-08-22 2023-09-15 北京象帝先计算技术有限公司 Test result grouping method, device, electronic equipment and readable storage medium

Cited By (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN115374019A (en) * 2022-10-27 2022-11-22 畅捷通信息技术股份有限公司 Method and system for testing distributed UI test cases and computer storage medium
CN116755953A (en) * 2023-08-22 2023-09-15 北京象帝先计算技术有限公司 Test result grouping method, device, electronic equipment and readable storage medium
CN116755953B (en) * 2023-08-22 2023-12-19 北京象帝先计算技术有限公司 Test result grouping method, device, electronic equipment and readable storage medium

Similar Documents

Publication Publication Date Title
US9477512B2 (en) Task-based modeling for parallel data integration
US9256460B2 (en) Selective checkpointing of links in a data flow based on a set of predefined criteria
CN112948079B (en) Task scheduling method, device, equipment and computer storage medium
CN114519006A (en) Test method, device, equipment and storage medium
CN110233802B (en) Method for constructing block chain structure with one main chain and multiple side chains
CN107562532B (en) Method and device for predicting hardware resource utilization rate of equipment cluster
US9984044B2 (en) Predicting performance regression of a computer system with a complex queuing network model
WO2016018352A1 (en) Platform configuration selection based on a degraded makespan
CN115150471A (en) Data processing method, device, equipment, storage medium and program product
CN112817660A (en) Method, device, equipment and storage medium for expanding small program capacity
CN111767126A (en) System and method for distributed batch processing
CN116126719A (en) Interface testing method and device, electronic equipment and storage medium
CN107493205B (en) Method and device for predicting capacity expansion performance of equipment cluster
CN113259878B (en) Call bill settlement method, system, electronic device and computer readable storage medium
CN114416357A (en) Method and device for creating container group, electronic equipment and medium
CN110737572B (en) Big data platform resource preemption test method, system, terminal and storage medium
US9769025B2 (en) Predicting the performance of a multi-stage communications network under load from multiple communicating servers
CN113723893A (en) Method and device for processing orders
CN113010310A (en) Job data processing method and device and server
US20170024745A1 (en) Network management event escalation
CN112799797A (en) Task management method and device
CN114153427A (en) Optimization method and system of continuous integration assembly line
CN117453376B (en) Control method, device, equipment and storage medium for high-throughput calculation
CN111367875B (en) Ticket file processing method, system, equipment and medium
CN113360368B (en) Method and device for testing software performance

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