Test methods, apparatus, electronic devices and media that execute steps in parallel

By using XML to construct parallel-execution test script structures in the automated testing system, the problems of low script writing efficiency and high error probability in existing technologies are solved, realizing an efficient and readable automated testing method that is suitable for unified testing of multiple products in urban rail transit control systems.

CN117743150BActive Publication Date: 2026-11-17CRSC URBAN RAIL TRANSIT TECH CO LTD
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202311615792.9
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2023-11-29
Publication Date
2026-11-17
Estimated Expiration
2043-11-29

AI Technical Summary

Technical Problem

Existing automated testing systems cannot be uniformly adapted to various train control products. Script writing efficiency is low and the probability of errors is high, increasing the learning cost and risk of errors for testers.

Method used

The test method adopts parallel execution of steps. The test script structure is constructed using XML language, including test task elements, dependency library elements, variable elements and process elements, to achieve parallel execution and improve the readability and efficiency of the script.

Benefits of technology

It improves the readability and writing efficiency of test scripts, shortens the testing cycle, reduces the probability of errors, and simplifies the learning and application process of automated testing.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN117743150B_ABST
    Figure CN117743150B_ABST
Patent Text Reader

Abstract

This invention provides a testing method, apparatus, electronic device, and medium for parallel execution of steps. The method includes: acquiring a test task; determining a test script structure corresponding to the test task, the test script structure being constructed based on test task elements, dependency library elements, variable elements, and process elements; and executing the test task based on the test script structure. The test task elements describe the test cases corresponding to the test task, the dependency library elements describe the test function information corresponding to the test task, the variable elements describe the variables used in the test cases, and the process elements describe the execution threads corresponding to the test task. All process elements are executed in parallel, and the execution threads are in a parallel relationship. The parallel execution testing method provided by this invention has a highly readable test script structure and can shorten the testing cycle.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This invention relates to the field of software testing technology, and in particular to a testing method, apparatus, electronic device, and medium that executes test steps in parallel. Background Technology

[0002] The safe operation of urban rail transit train control systems involves multiple stages, including software development, software testing, and field integration. Software testing is an essential component for ensuring safe equipment operation. Software testing is divided into manual and automated testing. Currently, most testing work still relies on manual testing, while automated testing is limited by manpower and cost, resulting in fewer application scenarios compared to manual testing. However, automated testing has developed rapidly in recent years, with its application scope gradually expanding. It is now used for functional and data testing of various train control equipment, including interlocking systems, area controllers, and onboard systems. However, the lack of standardization in automated testing systems across different products increases the learning curve for testers. Furthermore, the promotion and application of automated testing has revealed that using text editors and programming languages ​​to write scripts is inefficient and prone to errors, highlighting the urgent need for highly readable automated test scripts.

[0003] Existing automated testing software can only support a single product and cannot adapt to all train control products on the same platform. At the same time, most automated testing scripts are currently written using text editors and programming languages, which results in low script writing efficiency and a high probability of errors. Summary of the Invention

[0004] This invention provides a testing method, apparatus, electronic device, and medium that executes steps in parallel, in order to solve the problems of low script writing efficiency and high error probability in the prior art.

[0005] This invention provides a test method for parallel execution of steps, comprising:

[0006] Obtain test tasks;

[0007] Based on the test task, the test script structure corresponding to the test task is determined. The test script structure is constructed based on test task elements, dependency library elements, variable elements, and process elements.

[0008] Based on the aforementioned test script structure, execute the test task;

[0009] The test task element describes the test case corresponding to the test task, the dependency library element describes the test function information corresponding to the test task, the variable element describes the variables needed in the test case, and the process element describes the execution thread corresponding to the test task. All process elements are executed in parallel, and the execution threads are in a parallel relationship.

[0010] In some embodiments, the process elements include step elements, jump elements, and condition elements;

[0011] The step element is used to indicate the test steps for performing the test task;

[0012] The jump element is used to indicate jumps between different steps;

[0013] The condition element is used to indicate the conditions for executing the jump element.

[0014] In some embodiments, the process elements are divided into main process elements and branch process elements; the main process elements are used to describe the test sequence process, and the branch process elements are used to handle random events.

[0015] In some embodiments, executing the test task based on the test script structure includes:

[0016] The test task is executed based on the execution relationship between the step elements; the execution relationship includes: sequential execution, conditional execution, and loop execution.

[0017] The sequential execution is used to instruct all steps to be executed in order.

[0018] The conditional execution is used to instruct the execution of the steps corresponding to the jump element based on a first preset condition;

[0019] The loop execution is used to instruct the steps corresponding to the jump element to be executed cyclically based on a second preset condition.

[0020] In some embodiments, the process elements correspond one-to-one with the execution threads.

[0021] In some embodiments, the scripting language corresponding to the test script structure is XML.

[0022] The present invention also provides a test apparatus for parallel execution of steps, comprising:

[0023] The acquisition module is used to acquire test tasks;

[0024] The determination module is used to determine the test script structure corresponding to the test task based on the test task. The test script structure is constructed based on test task elements, dependency library elements, variable elements, and process elements.

[0025] An execution module is used to execute the test task based on the test script structure;

[0026] The test task element describes the test case corresponding to the test task, the dependency library element describes the test function information corresponding to the test task, the variable element describes the variables needed in the test case, and the process element describes the execution thread corresponding to the test task. All process elements are executed in parallel, and the execution threads are in a parallel relationship.

[0027] The present invention also provides an electronic device, including a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein the processor executes the program to implement a test method in which the steps described above are executed in parallel.

[0028] The present invention also provides a non-transitory computer-readable storage medium having a computer program stored thereon, which, when executed by a processor, implements a test method in which the steps described above are executed in parallel.

[0029] The present invention also provides a computer program product, including a computer program that, when executed by a processor, implements a test method in which the steps described above are executed in parallel.

[0030] The test method, apparatus, electronic device, and medium provided by the present invention, which executes test steps in parallel, improves the readability of the test script structure and improves test efficiency by determining the test script structure corresponding to the test task and constructing the test script structure using test task elements, dependency library elements, variable elements, and process elements. Executing the corresponding test task can shorten the test cycle. Attached Figure Description

[0031] To more clearly illustrate the technical solutions in this invention or the prior art, the drawings used in the description of the embodiments or the prior art will be briefly introduced below. Obviously, the drawings described below are some embodiments of this invention. For those skilled in the art, other drawings can be obtained from these drawings without creative effort.

[0032] Figure 1 This is a flowchart illustrating the test method for parallel execution of steps provided by the present invention;

[0033] Figure 2 This is a schematic diagram of the test script structure for the test method of parallel execution of steps provided by the present invention;

[0034] Figure 3 This is a schematic diagram of the script executor structure of the test method for parallel execution of steps provided by the present invention;

[0035] Figure 4 This is a schematic diagram of the sequential execution flow of the test method for parallel execution of steps provided by the present invention;

[0036] Figure 5 This is a schematic diagram of the conditional execution of the test method for parallel execution of steps provided by the present invention;

[0037] Figure 6 This is a schematic diagram of the cyclic execution of the test method for parallel execution of steps provided by the present invention;

[0038] Figure 7 This is a schematic diagram of the structure of the test device for parallel execution of steps provided by the present invention;

[0039] Figure 8 This is a schematic diagram of the structure of the electronic device provided by the present invention. Detailed Implementation

[0040] To make the objectives, technical solutions, and advantages of this invention clearer, the technical solutions of this invention will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only some, not all, of the embodiments of this invention. All other embodiments obtained by those skilled in the art based on the embodiments of this invention without creative effort are within the scope of protection of this invention.

[0041] The following is combined Figures 1-8 The present invention describes a test method, apparatus, electronic device, and medium that executes the steps of the present invention in parallel.

[0042] The execution subject of the test method for parallel execution of steps provided by this invention can be an electronic device, a component in the electronic device, an integrated circuit, or a chip. The electronic device can be a mobile electronic device or a non-mobile electronic device. For example, mobile electronic devices can be mobile phones, tablets, laptops, PDAs, in-vehicle electronic devices, wearable devices, ultra-mobile personal computers (UMPCs), netbooks, or personal digital assistants (PDAs), etc., while non-mobile electronic devices can be servers, network-attached storage (NAS), personal computers (PCs), televisions (TVs), ATMs, or self-service machines, etc. This invention does not impose specific limitations.

[0043] The following uses the test method of parallel execution of the steps provided by the present invention by a computer as an example to illustrate the technical solution of the present invention in detail.

[0044] Figure 1This is a flowchart illustrating the test method for parallel execution of steps provided by the present invention. (Refer to...) Figure 1 The test method for parallel execution of steps provided by the present invention includes:

[0045] Step 110: Obtain the test task;

[0046] Step 120: Based on the test task, determine the test script structure corresponding to the test task. The test script structure is constructed based on test task elements, dependency library elements, variable elements, and process elements.

[0047] Step 130: Execute the test task based on the test script structure;

[0048] The test task element describes the test case corresponding to the test task, the dependency library element describes the test function information corresponding to the test task, the variable element describes the variables needed in the test case, and the process element describes the execution thread corresponding to the test task. All process elements are executed in parallel, and each execution thread is in a parallel relationship.

[0049] This invention provides an automated testing platform for a single product of an urban rail train control system, which has a visual script editing interface and an execution interface.

[0050] In step 110, the test task refers to the task of performing functional or data tests on the train control equipment. The test task can be automatically generated by the automated test platform or generated based on the test instructions input by the user; no specific limitation is made here.

[0051] In step 120, the test task is read and the test script structure corresponding to the test task is parsed out.

[0052] In some embodiments, the scripting language corresponding to the test script structure is XML.

[0053] In practice, the scripting languages ​​corresponding to the test script structure can include, but are not limited to, Extensible Markup Language (XML), Python, and Tool Command Language (TCL). Among these, XML offers advantages such as flexibility, good extensibility, and explicit information processing. Given these advantages, XML is adopted as the scripting language for the automated testing platform, which verifies product functionality by executing the test scripts. The editing, parsing, and execution of the scripts are key aspects of this invention.

[0054] The test script structure in this invention is built based on test task elements, dependency library elements, variable elements, and process elements.

[0055] In practice, the test script structure in XML language includes test task elements, dependency library elements, variable elements, and procedure elements.

[0056] The following provides a detailed explanation of the test task element, dependency library element, variable element, and process element.

[0057] like Figure 2 As shown, a test task is a collection of all elements. Elements such as dependent libraries, variables, and procedures are sub-elements of the test task. At the same time, the procedure element contains step elements and jump elements.

[0058] I. Test Task Elements

[0059] The test task element describes the test case and defines the task identifier (ID) and description attributes to facilitate testers in recording test case information. The specific attribute definitions are shown in Table 1 below.

[0060] Table 1

[0061] property Value types describe ID String Define the test case name, for example: "ID" = "Case-1-12" Description String Define test case description information

[0062] II. Dependency Library Elements

[0063] The dependency library element (Lib) describes test function information and defines name and address attributes to facilitate testers in recording test case information. See Table 2 for specific attribute definitions.

[0064] Table 2

[0065] property Value types describe name String Define the test function library name addr String Define the address of the test function library; the address is generally an absolute path.

[0066] III. Variable Elements

[0067] The variable element (Var) describes the variables needed in the test case and defines the name, type, description, and value attributes to facilitate testers in recording test case information. See Table 3 for specific attribute definitions.

[0068] Table 3

[0069]

[0070] IV. Process Elements

[0071] The process element describes an execution thread and defines three attributes: name, description, and execution period. See Table 4 for the specific attribute definitions.

[0072] Table 4

[0073]

[0074]

[0075] A process element is a collection of step elements, jump elements, and condition elements. In a normal test case, the steps are executed sequentially. Jumps rely on condition sub-elements to control the flow of the process. Multiple conditions are used to implement logic such as (for loop, while loop, if statement) and modify the execution order of the step elements in the process.

[0076] In some embodiments, each process element corresponds one-to-one with an execution thread.

[0077] The test scenario described in the test script may involve multiple threads executing concurrently, with these threads operating in parallel. To accommodate various scenarios, a test task can contain multiple process elements, each representing an execution thread, and all process elements execute in parallel. For example, if the object under test needs to connect to multiple simulation devices, the interaction process between a single simulation device and the device under test can be written into a single process element.

[0078] In some embodiments, process elements are divided into main process elements and branch process elements; main process elements are used to describe test sequence processes, and branch process elements are used to handle random events.

[0079] In actual execution, process elements can also be divided into main processes and branch processes. The main process describes the test sequence process, while the branch process is used to handle possible random events, such as the pre-screening confirmation information that the train simulation may receive during the execution of the test script.

[0080] In some embodiments, the process elements include step elements, jump elements, and condition elements;

[0081] The step element is used to indicate the test steps for performing the test task;

[0082] The jump element is used to indicate jumps between different steps;

[0083] The condition element is used to indicate the conditions for executing the jump element.

[0084] V. Step Elements

[0085] The Step element describes the test steps of a test task. It is a sub-element of the Process element. After execution, it calls the function in the function library. It defines three attributes: name, action, description, and parameters. See Table 5 for the specific attribute definitions.

[0086] Table 5

[0087]

[0088] VI. Jump Elements

[0089] The Skip element describes a conditional message. It is a child element of the process element and jumps to the specified step after execution. It defines a name and the number of times it is executed. See Table 6 for the specific attribute definitions.

[0090] Table 6

[0091]

[0092] VII. Conditional Elements

[0093] The Condition element describes a condition and is a child element of the Procedure element. After execution, it jumps to the specified step. It defines a name and the number of times it is executed. See Table 7 for the specific attribute definitions.

[0094] Table 7

[0095]

[0096]

[0097] The test method for parallel execution of steps provided by this invention improves the readability of the test script structure and increases test efficiency by determining the test script structure corresponding to the test task and constructing the test script structure using test task elements, dependency library elements, variable elements and process elements. Executing the corresponding test task can shorten the test cycle.

[0098] like Figure 3 As shown, the present invention also provides a script executor.

[0099] The script executor parses the XML script and calls the function library management module 310 and the process management module 320 according to the script description.

[0100] The function library management module 310 is used to store information contained in a dependency library file, including a function library management list and a variable list.

[0101] The function library management list refers to the detailed information of each interface function instruction, while the variable list refers to the detailed information of global variables.

[0102] The function library management module 310 and the process management module 320 are described below.

[0103] I. Function Library Management Module 310

[0104] First, the function library in the function library management module 310 is loaded. The function library file is located in the specified path, and the function information of the Application Programming Interface (API) in the function library file is loaded. After successful loading, the methods in the function library can be called. Examples include creating a train, managing a route, or changing the train's position.

[0105] The basic structure of the dependency library model (ApiInterface) is shown in Table 8:

[0106] Table 8

[0107] name type describe Is it necessary? FileName String Dependency library file name yes APIMethodList List <apimethod> < / apimethod> Instruction List no VarList List <varible> < / varible> Global variable list no

[0108] APiMethod is an API instruction:

[0109] The instruction model stores the initialized instructions. Each instruction corresponds to a function in the function dependency library. An instruction should contain the following information: basic information of the instruction, parameter information of the instruction, and return value information of the instruction.

[0110] The basic information of an instruction includes its Chinese name, function name, type, and description; the parameter information includes its Chinese name, English name, type, and prompt; and the return value information.

[0111] The basic structure of the API Interface model is shown in Table 9:

[0112] Table 9

[0113]

[0114] ApiParamParam is the input parameter of the instruction. The basic structure of the parameter model is shown in Table 10:

[0115] Table 10

[0116]

[0117]

[0118] For the variable model, the basic structure of Varible is shown in Table 11:

[0119] Table 11

[0120]

[0121] II. Process Management Module 320

[0122] In the automated testing platform, multiple processes execute in parallel, with no specific order between them. Within each process element, steps execute sequentially. Jump elements are execution logic keywords, and conditional and loop execution are achieved through combinations of jump elements and conditional elements.

[0123] In some embodiments, based on the test script structure, test tasks are executed, including:

[0124] Test tasks are executed based on the execution relationships between step elements; these relationships include sequential execution, conditional execution, and loop execution.

[0125] Sequential execution is used to instruct all steps to be executed sequentially.

[0126] Conditional execution is used to instruct the execution of the steps corresponding to the jump element based on a first preset condition;

[0127] The "Loop Execution" option is used to instruct the steps corresponding to the jump element to be executed repeatedly based on a second preset condition.

[0128] The following sections will explain sequential execution, conditional execution, and loop execution in turn.

[0129] I. Sequential Execution

[0130] like Figure 4 As shown, the steps are executed sequentially. After step element 1 is completed, step element 2 is executed, and after step element 2 is completed, step element 3 is executed, until the execution is completed.

[0131] II. Condition Execution

[0132] like Figure 5 As shown, after step 1 is completed, the process proceeds to the jump element. The jump element determines whether the current execution state meets either condition 1 or condition 2 based on the information defined in the condition element. If condition 1 is met, the process jumps to step 2; if condition 2 is met, the process jumps to step 3. When both conditions are met, the first defined condition takes precedence, which is condition 1 in the example. Condition element 1 and condition element 2 are the first preset conditions. The specific content of these conditions can be set according to the actual situation and is not specifically limited here.

[0133] III. Execution in a Cyclic Formation

[0134] like Figure 6As shown, after step element 1 is executed, the system enters the jump element. Condition element 1 defines the loop count as n, and the target step is step element 1. The executor triggers a counter the first time it enters the jump element, and after n executions, it automatically jumps to step element 2 in sequence. Alternatively, condition element 2 can be defined, and the system can jump to other steps based on the condition. Condition elements 1 and 2 are the second preset conditions; the specific conditions can be set according to actual conditions and are not specifically limited here.

[0135] This invention provides a test script structure based on XML and a method for designing automated test executors. Users can understand test cases and the testers' intentions by reading the scripts, while also shortening the testing cycle: verifying product functionality by executing scripts shortens the regression testing cycle.

[0136] Let's take XML scripting as an example to illustrate the execution process of a test task.

[0137]

[0138]

[0139]

[0140] The test apparatus for parallel execution of steps provided by the present invention will be described below. The test apparatus for parallel execution of steps described below and the test method for parallel execution of steps described above can be referred to in correspondence.

[0141] Figure 7 This is a schematic diagram of the test apparatus for parallel execution of steps provided by the present invention. (Refer to...) Figure 7 The test apparatus for parallel execution of steps provided by the present invention includes:

[0142] Module 710 is used to acquire test tasks;

[0143] The determination module 720 is used to determine the test script structure corresponding to the test task based on the test task, wherein the test script structure is constructed based on test task elements, dependency library elements, variable elements and process elements;

[0144] Execution module 730 is used to execute the test task based on the test script structure;

[0145] The test task element describes the test case corresponding to the test task, the dependency library element describes the test function information corresponding to the test task, the variable element describes the variables needed in the test case, and the process element describes the execution thread corresponding to the test task. All process elements are executed in parallel, and the execution threads are in a parallel relationship.

[0146] The test apparatus for parallel execution of steps provided by the present invention improves the readability of the test script structure and improves test efficiency by determining the test script structure corresponding to the test task and constructing the test script structure using test task elements, dependency library elements, variable elements and process elements. Executing the corresponding test task can shorten the test cycle.

[0147] In some embodiments, the process elements include step elements, jump elements, and condition elements;

[0148] The step element is used to indicate the test steps for performing the test task;

[0149] The jump element is used to indicate jumps between different steps;

[0150] The condition element is used to indicate the conditions for executing the jump element.

[0151] In some embodiments, the process elements are divided into main process elements and branch process elements; the main process elements are used to describe the test sequence process, and the branch process elements are used to handle random events.

[0152] In some embodiments, the execution module 730 is specifically used for:

[0153] The test task is executed based on the execution relationship between the step elements; the execution relationship includes: sequential execution, conditional execution, and loop execution.

[0154] The sequential execution is used to instruct all steps to be executed in order.

[0155] The conditional execution is used to instruct the execution of the steps corresponding to the jump element based on a first preset condition;

[0156] The loop execution is used to instruct the steps corresponding to the jump element to be executed cyclically based on a second preset condition.

[0157] In some embodiments, the process elements correspond one-to-one with the execution threads.

[0158] In some embodiments, the scripting language corresponding to the test script structure is XML.

[0159] Figure 8 An example is a schematic diagram of the physical structure of an electronic device, such as... Figure 8As shown, the electronic device may include: a processor 810, a communication interface 820, a memory 830, and a communication bus 840, wherein the processor 810, the communication interface 820, and the memory 830 communicate with each other through the communication bus 840. The processor 810 can call logical instructions in the memory 830 to execute a test method that performs steps in parallel, the method including:

[0160] Obtain test tasks;

[0161] Based on the test task, the test script structure corresponding to the test task is determined. The test script structure is constructed based on test task elements, dependency library elements, variable elements, and process elements.

[0162] Based on the aforementioned test script structure, execute the test task;

[0163] The test task element describes the test case corresponding to the test task, the dependency library element describes the test function information corresponding to the test task, the variable element describes the variables needed in the test case, and the process element describes the execution thread corresponding to the test task. All process elements are executed in parallel, and the execution threads are in a parallel relationship.

[0164] Furthermore, the logical instructions in the aforementioned memory 830 can be implemented as software functional units and, when sold or used as independent products, can be stored in a computer-readable storage medium. Based on this understanding, the technical solution of the present invention, essentially, or the part that contributes to the prior art, or a part of the technical solution, can be embodied in the form of a software product. This computer software product is stored in a storage medium and includes several instructions to cause a computer device (which may be a personal computer, server, or network device, etc.) to execute all or part of the steps of the methods described in the various embodiments of the present invention. The aforementioned storage medium includes various media capable of storing program code, such as USB flash drives, portable hard drives, read-only memory (ROM), random access memory (RAM), magnetic disks, or optical disks.

[0165] On the other hand, the present invention also provides a computer program product, the computer program product comprising a computer program that can be stored on a non-transitory computer-readable storage medium, wherein when the computer program is executed by a processor, the computer is capable of executing a test method in parallel with the steps provided by the above methods, the method comprising:

[0166] Obtain test tasks;

[0167] Based on the test task, the test script structure corresponding to the test task is determined. The test script structure is constructed based on test task elements, dependency library elements, variable elements, and process elements.

[0168] Based on the aforementioned test script structure, execute the test task;

[0169] The test task element describes the test case corresponding to the test task, the dependency library element describes the test function information corresponding to the test task, the variable element describes the variables needed in the test case, and the process element describes the execution thread corresponding to the test task. All process elements are executed in parallel, and the execution threads are in a parallel relationship.

[0170] In another aspect, the present invention also provides a non-transitory computer-readable storage medium having a computer program stored thereon, which, when executed by a processor, implements a test method for performing the steps provided by the above methods in parallel, the method comprising:

[0171] Obtain test tasks;

[0172] Based on the test task, the test script structure corresponding to the test task is determined. The test script structure is constructed based on test task elements, dependency library elements, variable elements, and process elements.

[0173] Based on the aforementioned test script structure, execute the test task;

[0174] The test task element describes the test case corresponding to the test task, the dependency library element describes the test function information corresponding to the test task, the variable element describes the variables needed in the test case, and the process element describes the execution thread corresponding to the test task. All process elements are executed in parallel, and the execution threads are in a parallel relationship.

[0175] The device embodiments described above are merely illustrative. The units described as separate components may or may not be physically separate. The components shown as units may or may not be physical units; that is, they may be located in one place or distributed across multiple network units. Some or all of the modules can be selected to achieve the purpose of this embodiment according to actual needs. Those skilled in the art can understand and implement this without any creative effort.

[0176] Through the above description of the embodiments, those skilled in the art can clearly understand that each embodiment can be implemented by means of software plus necessary general-purpose hardware platforms, and of course, it can also be implemented by hardware. Based on this understanding, the above technical solutions, in essence or the part that contributes to the prior art, can be embodied in the form of a software product. This computer software product can be stored in a computer-readable storage medium, such as ROM / RAM, magnetic disk, optical disk, etc., and includes several instructions to cause a computer device (which may be a personal computer, server, or network device, etc.) to execute the methods described in the various embodiments or some parts of the embodiments.

[0177] Finally, it should be noted that the above embodiments are only used to illustrate the technical solutions of the present invention, and not to limit them; although the present invention has been described in detail with reference to the foregoing embodiments, those skilled in the art should understand that modifications can still be made to the technical solutions described in the foregoing embodiments, or equivalent substitutions can be made to some of the technical features; and these modifications or substitutions do not cause the essence of the corresponding technical solutions to deviate from the spirit and scope of the technical solutions of the embodiments of the present invention.

Claims

1. A method of testing in which steps are performed in parallel, characterized in that, include: Obtain test tasks; Based on the test task, the test script structure corresponding to the test task is determined. The test script structure is constructed based on test task elements, dependency library elements, variable elements, and process elements. Based on the aforementioned test script structure, execute the test task; The test task element describes the test case corresponding to the test task, the dependency library element describes the test function information corresponding to the test task, the variable element describes the variables needed in the test case, and the process element describes the execution thread corresponding to the test task. All process elements are executed in parallel, and the execution threads are in a parallel relationship. The process elements include step elements, jump elements, and condition elements; The step element is used to indicate the test steps for performing the test task; The jump element is used to indicate jumps between different steps; The condition element is used to indicate the conditions for executing the jump element; Each process element corresponds one-to-one with the execution thread.

2. The test method for parallel execution of steps according to claim 1, characterized in that, The process elements are divided into main process elements and branch process elements; the main process elements are used to describe the test sequence process, and the branch process elements are used to handle random events.

3. The test method for parallel execution of steps according to claim 1, characterized in that, The execution of the test task based on the test script structure includes: The test task is executed based on the execution relationship between the step elements; the execution relationship includes: sequential execution, conditional execution, and loop execution. The sequential execution is used to instruct all steps to be executed in order. The conditional execution is used to instruct the execution of the steps corresponding to the jump element based on a first preset condition; The loop execution is used to instruct the steps corresponding to the jump element to be executed cyclically based on a second preset condition.

4. The test method for parallel execution of steps according to any one of claims 1-3, characterized in that, The test script structure is written in XML.

5. A test apparatus for parallel execution of steps, characterized in that, include: The acquisition module is used to acquire test tasks; The determination module is used to determine the test script structure corresponding to the test task based on the test task. The test script structure is constructed based on test task elements, dependency library elements, variable elements, and process elements. An execution module is used to execute the test task based on the test script structure; The test task element describes the test case corresponding to the test task, the dependency library element describes the test function information corresponding to the test task, the variable element describes the variables needed in the test case, and the process element describes the execution thread corresponding to the test task. All process elements are executed in parallel, and the execution threads are in a parallel relationship. The process elements include step elements, jump elements, and condition elements; The step element is used to indicate the test steps for performing the test task; The jump element is used to indicate jumps between different steps; The condition element is used to indicate the conditions for executing the jump element; Each process element corresponds one-to-one with the execution thread.

6. An electronic device comprising a memory, a processor, and a computer program stored in the memory and executable on the processor, characterized in that, When the processor executes the program, it implements a test method in which the steps of any one of claims 1 to 4 are executed in parallel.

7. A non-transitory computer-readable storage medium having a computer program stored thereon, characterized in that, When the computer program is executed by a processor, it implements a test method in which the steps described in any one of claims 1 to 4 are executed in parallel.

8. A computer program product, comprising a computer program, characterized in that, When the computer program is executed by a processor, it implements a test method in which the steps described in any one of claims 1 to 4 are executed in parallel.

Citation Information

Patent Citations

  • XML-based distributed automated test method

    CN107870863A

  • Industrial gateway device automated test method based on XML script driving

    CN108521350A