A testing method and related device

By constructing the target link and performing tests using traversal methods, the high maintenance costs and omissions caused by repeated step updates in the prior art are solved, and the same step is reused and efficiently updated in multiple test processes are achieved.

CN113900933BActive Publication Date: 2025-07-29DUXIAOMAN TECH (BEIJING) CO LTD
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202111152568.1
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2021-09-29
Publication Date
2025-07-29
Estimated Expiration
2041-09-29

AI Technical Summary

Technical Problem

In the prior art, repeated testing steps (such as card binding steps) need to be updated in all test processes during updates, resulting in high maintenance costs and high possibility of omissions.

Method used

By generating sublinks and steps, constructing target links, and performing tests using traversal methods, the same step is multiplexed in multiple test processes, and the corresponding link is only updated when the steps are updated.

Benefits of technology

Reduces maintenance costs and reduces the possibility of update misses, improving the efficiency and accuracy of the test process.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN113900933B_ABST
    Figure CN113900933B_ABST
Patent Text Reader

Abstract

The present application discloses a testing method and related devices. Instead of generating a test script for each test service, sub-links are generated based on the minimum units of multiple steps required by multiple test services, and a target link required for a target test service is generated based on the sub-links and / or steps. The target link is determined as the current test link, the i-th node in the current test link is determined as the target node, the type of the target node is identified. If the type of the target node is a step, the actions included in the target node are executed to complete the test of this step, and the (i + 1)-th node is re-determined as the target node, and the type of the target node and subsequent steps are continued to be executed until all nodes in the target link are executed; if the type of the target node is a sub-link, the target node is re-determined as the current test link, and the i-th node in the current test link is used as the target node and subsequent steps are executed.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the technical field of data processing, and in particular, to a test method and related device. Background Art

[0002] In the field of testing, all steps executed on the application object under test (such as selecting a certain piece of data in a list, inputting data into a text box, etc.) are stacked to generate a test script, and the application object is tested according to the test script.

[0003] In the related art, one test process corresponds to one test script. However, the same step will appear in many test processes. For example, in the financial field, the step of binding a card will appear in test processes such as credit granting business, loan disbursement business, and purchase business. The code of the binding card step needs to be written into the corresponding test script for each test process.

[0004] However, when the repeated step (such as the binding card step) is updated, all test processes that depend on this step need to be updated accordingly, resulting in a high maintenance cost and a high possibility of omission. Summary of the Invention

[0005] In view of the above problems, the present application provides a test method and related device, which are used to reduce the maintenance cost and the possibility of update omission.

[0006] Based on this, the embodiments of the present application disclose the following technical solutions:

[0007] On the one hand, an embodiment of the present application provides a test method, and the method includes:

[0008] Obtain a target link corresponding to a target test service, where the target link includes multiple nodes, and the types of the nodes include steps and sub-links, and the sub-link is determined according to the smallest unit of multiple identical steps included in multiple test services;

[0009] Determine the target link as the current test link, and determine the i-th node in the current test link as the target node;

[0010] Identify the type of the target node;

[0011] If the type of the target node is a step, execute the action included in the target node, re-determine the (i + 1)-th node as the target node, execute the step of identifying the type of the target node and subsequent steps until all nodes in the target link are identified;

[0012] If the type of the target node is a sub-link, re-determine the target node as the current test link, use the j-th node in the current test link as the target node, and perform the step of identifying the type of the target node and subsequent steps until all nodes in the target link are identified.

[0013] Optionally, the obtaining of the target link corresponding to the target test service includes:

[0014] Obtain the nodes required for the target test service and the sequential relationship between the nodes;

[0015] Generate a target link according to the nodes and the sequential relationship.

[0016] Optionally, the performing of the actions included in the target node includes:

[0017] Determine the parameter passing rule between the target node and other nodes;

[0018] Perform the actions included in the target node according to the parameter passing rule.

[0019] Optionally, the target node and the other nodes are nodes with a strong correlation relationship, and the parameter passing rule is to determine the input parameter of the target node according to the input parameter or output parameter of the other nodes.

[0020] Optionally, the target node and the other nodes belong to the nodes in the target sub-link, and the parameter passing rule is to determine the input parameters of the target node and the other nodes according to the input parameter of the target sub-link.

[0021] Optionally, the method further includes:

[0022] The input parameter of the target sub-link is actively passed to the target node and the other nodes; or,

[0023] The target node and the other nodes actively obtain the input parameter of the target sub-link.

[0024] Optionally, the method further includes:

[0025] Update the parameter passing rule, and the updated parameter passing rule is to determine the input parameter of the target node according to the input parameter or output parameter of the other nodes.

[0026] Optionally, the method further includes:

[0027] Determine the output parameter of the target sub-link according to the parameter of the target node and the parameter of the other nodes, where the parameter includes the output parameter and the input parameter.

[0028] Optionally, the parameter passing rule is to determine the input parameters of the target node and the input parameters of the other nodes according to the preset global variables.

[0029] On the other hand, an embodiment of the present application provides a test device, which includes: an acquisition unit, a determination unit, an identification unit, a first execution unit, and a second execution unit;

[0030] The acquisition unit is configured to acquire a target link corresponding to a target test service, where the target link includes multiple nodes, and the types of the nodes include steps and sub-links, and the sub-links are determined according to the smallest units of multiple identical steps included in multiple test services;

[0031] The determination unit is configured to determine the target link as the current test link, and determine the i-th node in the current test link as the target node;

[0032] The identification unit is configured to identify the type of the target node;

[0033] The first execution unit is configured to, if the type of the target node is a step, execute the actions included in the target node, re-determine the (i + 1)-th node as the target node, execute the identification of the type of the target node and subsequent steps until all the nodes in the target link are identified;

[0034] The second execution unit is configured to, if the type of the target node is a sub-link, re-determine the target node as the current test link, use the j-th node in the current test link as the target node, execute the identification of the type of the target node and subsequent steps until all the nodes in the target link are identified.

[0035] On the other hand, the present application provides a computer device, which includes a processor and a memory:

[0036] The memory is used to store program codes and transmit the program codes to the processor;

[0037] The processor is configured to execute the method described in the above aspect according to the instructions in the program codes.

[0038] On the other hand, the present application provides a computer-readable storage medium, which is used to store a computer program, and the computer program is used to execute the method described in the above aspect.

[0039] Compared with the prior art, the advantages of the above technical solutions of the present application are as follows:

[0040] Instead of generating a test script for each test service, sub-links are generated based on the smallest units of multiple steps required by multiple test services, and the target link required for the target test service is generated based on the sub-links and / or steps. The target link is determined as the current test link, the i-th node in the current test link is determined as the target node, the type of the target node is identified. If the type of the target node is a step, the actions included in the target node are executed to complete the test of this step, and the (i + 1)-th node is re-determined as the target node, and continue to execute the identification of the type of the target node and subsequent steps until all nodes in the target link have been executed; if the type of the target node is a sub-link, the target node is re-determined as the current test link, and execute taking the i-th node in the current test link as the target node and subsequent steps. Thus, the target link constructed by combining steps and sub-links can complete the test by traversal, realizing the reuse of the same step in multiple test processes. When a certain step needs to be updated, the links constructed based on this step will all be updated correspondingly, which not only reduces the maintenance cost but also reduces the possibility of update omission. BRIEF DESCRIPTION OF THE DRAWINGS

[0041] In order to more clearly illustrate the technical solutions in the embodiments of the present application or the prior art, the following will briefly introduce the drawings required for the description of the embodiments or the prior art. Obviously, the drawings in the following description are only some embodiments recorded in the present application. For those of ordinary skill in the art, without creative efforts, other drawings can also be obtained based on these drawings.

[0042] Figure 1 It is a flowchart of a test method provided by an embodiment of the present application;

[0043] Figure 2 It is a schematic diagram of four test services provided by an embodiment of the present application;

[0044] Figure 3 It is a schematic diagram of the code of a credit line provided by an embodiment of the present application;

[0045] Figure 4 It is a schematic diagram of a parameter passing rule provided by an embodiment of the present application;

[0046] Figure 5 It is a schematic diagram of setting a parameter passing rule provided by an embodiment of the present application;

[0047] Figure 6 It is a schematic diagram of a parameter passing rule provided by an embodiment of the present application;

[0048] Figure 7 It is a schematic diagram of a parameter passing rule provided by an embodiment of the present application;

[0049] Figure 8 A schematic diagram of setting parameter transfer rules provided by an embodiment of the present application;

[0050] Figure 9 A schematic diagram of setting parameter transfer rules provided by an embodiment of the present application;

[0051] Figure 10 A schematic diagram of a parameter transfer rule provided by an embodiment of the present application;

[0052] Figure 11 A schematic diagram of setting parameter transfer rules provided by an embodiment of the present application;

[0053] Figure 12 A schematic diagram of a parameter transfer rule provided by an embodiment of the present application;

[0054] Figure 13 A schematic diagram of setting parameter transfer rules provided by an embodiment of the present application;

[0055] Figure 14 A schematic diagram of a test device provided by an embodiment of the present application;

[0056] Figure 15 A structural diagram of a computer device provided by an embodiment of the present application. Detailed implementation manners

[0057] In order to enable those skilled in the art to better understand the solution of the present application, the technical solutions in the embodiments of the present application will be clearly and completely described below with reference to the accompanying drawings in the embodiments of the present application. Obviously, the described embodiments are only a part of the embodiments of the present application, rather than all the embodiments. Based on the embodiments in the present application, all other embodiments obtained by those of ordinary skill in the art without creative efforts shall fall within the protection scope of the present application.

[0058] To facilitate the understanding of the embodiments of the present application, some terms related to the present application are explained below.

[0059] Step: It refers to an action with complete semantics in the test process, which can be an action or an encapsulation of multiple atomic actions. For example, the product purchase test service includes actions such as importing products first, setting quotas, and setting switches, but the product purchase can be provided as a complete step. The semantic scope of the specific step encapsulation is determined by the developer according to its own business semantics.

[0060] Link: It refers to a step link that can achieve a complete path. Each type of test service can customize the action granularity of the business test service and the step list granularity according to needs. Each link can be composed of sub-links and steps.

[0061] The following will introduce a test method provided by an embodiment of the present application in conjunction with Figure 1 , as shown in Figure 1 , which is a flowchart of a test method provided by the present application. The method may include the following steps 101-105.

[0062] S101: Obtain a target link corresponding to a target test service.

[0063] The link includes multiple nodes. The type of each node can be a step or a sub-link. The target link is the link corresponding to the target test service. Among them, the sub-link is determined according to the smallest unit of multiple identical steps included in multiple test services.

[0064] As Figure 2 shown, this figure is a schematic diagram of four test services provided by an embodiment of the present application. Among them, the four test services are real-name test service, subscription test service, credit-granting test service, and loan disbursement test service. The smallest unit of multiple identical steps included in the above four test services is the step of creating user data, the step of creating an account, and the step of binding a card. Therefore, the step of creating user data, the step of creating an account, and the step of binding a card can be determined as the real-name link. The real-name link can also be used as a sub-link and combined with the subscription step to form a subscription link, and combined with the credit-granting step to form a credit-granting link. Similarly, the credit-granting link can also be used as a sub-link and combined with the loan disbursement step to form a loan disbursement link.

[0065] It can be seen from the above that the step of binding a card is used by multiple links, but actually this step is only written once, rather than generating corresponding test scripts for all test services that require this step, achieving high reuse. Moreover, by means of building blocks, steps are quickly combined with steps, steps with sub-links, and sub-links with sub-links to form the link required by the test service, so as to obtain the target link corresponding to the target test service. When some steps in the link are updated, the link generated according to this step will also be updated accordingly, thus reducing the maintenance cost and the possibility of update omission.

[0066] As a possible implementation manner, a user can perform business testing through the test platform provided by an embodiment of the present application. When the user builds the target link corresponding to the target test service, the user can determine the nodes required for the target test service and the order relationship between the nodes according to the needs of the target test service. After obtaining the nodes and the order relationship between the nodes on the test platform, the target link can be generated according to the nodes and the order relationship.

[0067] Taking the example where a user generates a credit line for the credit testing service through the testing platform. At this time, the target testing service is the credit testing service, and the target link is the credit line. When the user constructs the credit line, the credit line can be composed of the real-name sub-link and the credit steps. It can be understood that if there is no real-name sub-link at this time, the credit line can also be generated based on the steps of creating user data, creating an account, binding a card, and the credit steps.

[0068] As a possible implementation, the link includes a link identifier, link own parameters, and dependent nodes, and the steps include a step identifier and step parameters. As Figure 3 shown, this figure is a schematic diagram of the code of a credit line provided by an embodiment of the present application. Among them, "nodeName" represents the node identifier, such as the node name. It can be understood that if the node is a link, it represents the link identifier, and if the node is a step, it represents the step identifier. "nodeChildren" represents the dependent nodes of the link. It can be understood that in the step, "nodeChildren": Array[0] indicates that no dependent nodes are required in this step. "nodeParamInfo" represents the step parameters, and "projectId" represents the link own parameters.

[0069] As a possible implementation, the code of the target link may also include a node type, represented by "nodeType".

[0070] S102: Determine the target link as the current test link, and determine the i-th node in the current test link as the target node.

[0071] As a possible implementation, after obtaining the target link, execute it in the top-down order in the target link, that is, execute the actions included in it according to the steps and / or sub-links included in the target link until all the nodes in the target link are traversed. At this time, i can start taking values from 1 until i is equal to the number of nodes included in the target link.

[0072] S103: Identify the type of the target node.

[0073] The target node includes two types, steps or sub-links. If the type of the identified target node is a step, execute S104. If the type of the identified target node is a sub-link, execute S105.

[0074] S104: If the type of the target node is a step, execute the actions included in the target node, re-determine the (i + 1)-th node as the target node, and execute S103 until all the nodes in the target link are identified.

[0075] If the type of the target node is a step, execute the actions included in the step, complete the test of the step, and then re-determine the next node of the target node, that is, the (i + 1)-th node, as the target node, identify the type of the (i + 1)-th node, that is, execute S103, until all nodes in the target link are identified.

[0076] S105: If the type of the target node is a sub-link, re-determine the target node as the current test link, take the j-th node in the current test link as the target node, and execute S103 until all nodes in the target link are identified.

[0077] If the type of the target node is a sub-link, re-determine the target node as the current test link, take the j-th node in the current test link as the target node, and execute S103. j can start from 1 and take values until j is equal to the number of nodes included in the current test link, that is, traverse the nodes within the sub-link. After executing in sequence, then traverse the nodes in the target link until all nodes in the target link are executed.

[0078] As can be seen from the above technical solution, instead of generating a test script for each test service, a sub-link is generated based on the minimum units of multiple steps required by multiple test services, and a target link required for the target test service is generated based on the sub-link and / or steps. Determine the target link as the current test link, determine the i-th node in the current test link as the target node, identify the type of the target node. If the type of the target node is a step, execute the actions included in the target node, complete the test of the step, and re-determine the (i + 1)-th node as the target node, and continue to execute identifying the type of the target node and subsequent steps until all nodes in the target link are executed; if the type of the target node is a sub-link, re-determine the target node as the current test link, and execute taking the i-th node in the current test link as the target node and subsequent steps. Thus, the target link constructed by combining steps and sub-links can complete the test by traversing, realizing the reuse of the same step in multiple test processes. When a certain step needs to be updated, the links constructed based on this step will all be updated correspondingly, not only reducing the maintenance cost but also reducing the possibility of update omission.

[0079] As a possible implementation, the parameter passing rule between the target node and other nodes can be determined, and the actions included in the target node are executed according to the parameter passing rule, so as to implement the actions included in the target node.

[0080] The embodiments of the present application do not specifically limit the specific content of the parameter passing rule, and several ways are taken as examples for illustration below.

[0081] The first type: When the target node has a strong correlation with other nodes, for example, when the target node needs to be executed after other nodes, at this time, the parameter passing rule is to determine the input parameters of the target node according to the input parameters or output parameters of other nodes. For example, Figure 4 As shown in the figure, this figure is a schematic diagram of a parameter passing rule provided by an embodiment of the present application. The target node is step b, and the other node is step a. Step b is executed after step a, and there is a strong correlation between the two. At this time, the input parameter (input) of step b can be the input parameter of step a or the output parameter (output) of step a. Refer to Figure 5 , this figure is a schematic diagram of a parameter passing rule provided by an embodiment of the present application. For example, the input parameter of the bankCode step (target node) is determined according to the "output.card" (output parameter) of the "Loan@thanos@datacreate@getRandUserInfo" step (other node).

[0082] The second type: When the target node and other nodes belong to a sub-link in the target link, that is, the nodes in the target sub-link, at this time, the parameter passing rule is to determine the input parameters of the target node and other nodes according to the input parameter of the target sub-link, that is, the input parameter of the target sub-link can be passed through to the nodes within the target sub-link.

[0083] The embodiments of the present application do not specifically limit the manner in which the nodes within the target sub-link obtain parameters. For example, the input parameter of the target sub-link is actively passed to the target node and other nodes. For example, Figure 6 As shown in the figure, this figure is a schematic diagram of a parameter passing rule provided by an embodiment of the present application. The target sub-link is link A, step a is the other node, and step b is the target node. Both step a and step b are nodes within link A. Another example is that the target node and other nodes actively obtain the input parameter of the target sub-link when needed, as Figure 7 shown.

[0084] As a possible implementation manner, the test platform actively passes the input parameter of the target sub-link to the target node and other nodes by default, so that there is no need for the target node and other nodes to actively initiate acquisition operations. The target sub-link issues the input parameter according to the acquisition operation, thereby reducing the interaction between the target node, other nodes and the target sub-link, and reducing the pressure on the server where the test platform is located. For example, as Figure 8 shown, when the user configures the own parameter "projectId" of the target sub-link on the test platform, the test platform will actively pass the input parameter of the target sub-link to the target node and other nodes on behalf of the user.

[0085] Further, if the input parameters of the target node and other nodes sometimes need to be passed through the target sub-link and sometimes do not need to be passed through the target sub-link, the input parameters of the target node and / or other nodes can be set to actively obtain the input parameters of the target sub-link, so as to enable the target node and other nodes to obtain the input parameters of the target sub-link only when needed. As Figure 9 shown, the input parameter (#1.productId) of a certain step (Loan@thanos@datacreate@flexDayCut) in the target sub-link is obtained from the input parameter (productIdJXJZZD) of the link.

[0086] Thus, the input parameters of the target sub-link will be default passed to the nodes within the target sub-link. If a node does not need this parameter, it can be obtained from the specified parameters of the target sub-link to overwrite the node that previously received the default transmission of the target sub-link.

[0087] The third type: The parameters of the nodes within the target sub-link can also be determined according to the parameters of other nodes within the target sub-link. At this time, the parameter passing rule is to determine the input parameters of the target node according to the input parameters or output parameters of other nodes. As Figure 10 shown, this figure is a schematic diagram of a parameter passing rule provided by an embodiment of the present application. Link A is the target sub-link, step a / C link is other nodes, and step b or D link is the target node. For example, as Figure 11 shown, the input parameter (#1.productId) of the target node (Loan@thanos@datacreate@bindPassPhone) within the target sub-link is obtained from the output parameter (#0.output.phone) of other nodes (Loan@thanos@auth@userauth) within the target sub-link.

[0088] The fourth type: The parameters of the target node within the target sub-link can be passed to the target sub-link. Similarly, the parameters of other nodes within the target sub-link can be passed to the target sub-link, and the target sub-link determines the output parameters according to the received parameters, where the parameters include output parameters and input parameters. As Figure 12 shown, this figure is a schematic diagram of a parameter passing rule provided by an embodiment of the present application. Link A is the target sub-link, step a is other nodes, and link B is the target node. For example, as Figure 13 shown, the output parameter (prcId) of the target sub-link is obtained from the output parameter (#4.output.prcId) of the step (Loan@thanos@datacreate@newUserauth) within the target sub-link.

[0089] The fifth type: Determine the input parameters of the target node and other nodes according to the pre-set global variables. AsFigure 13 As shown in the figure, this is a schematic diagram of a parameter passing rule provided by an embodiment of the present application. The global variable is M, step a is other nodes, and step b is the target node.

[0090] Thus, by constructing a parameter passing rule, including but not limited to step-to-step parameter passing, in-link parameter passing, parameter passing between links, global parameter passing, etc. Perform the actions included in the target node according to the parameter passing rule, so as to implement the actions included in the target node.

[0091] In addition to the provided test method, an embodiment of the present application also provides a test device, such as Figure 14 As shown in the figure, it includes: an acquisition unit 1401, a determination unit 1402, an identification unit 1403, a first execution unit 1404, and a second execution unit 1405;

[0092] The acquisition unit 1401 is used to acquire a target link corresponding to a target test service. The target link includes multiple nodes, and the types of the nodes include steps and sub-links. The sub-link is determined according to the smallest unit of multiple identical steps included in multiple test services;

[0093] The determination unit 1402 is used to determine the target link as the current test link, and determine the i-th node in the current test link as the target node;

[0094] The identification unit 1403 is used to identify the type of the target node;

[0095] The first execution unit 1404 is used to, if the type of the target node is a step, execute the actions included in the target node, re-determine the (i + 1)-th node as the target node, execute the identification of the type of the target node and subsequent steps until all the nodes in the target link are identified;

[0096] The second execution unit 1405 is used to, if the type of the target node is a sub-link, re-determine the target node as the current test link, use the j-th node in the current test link as the target node, execute the identification of the type of the target node and subsequent steps until all the nodes in the target link are identified.

[0097] As a possible implementation, the acquisition unit 1401 is used to:

[0098] Acquire the nodes required for the target test service and the sequence relationship between the nodes;

[0099] Generate a target link according to the nodes and the sequence relationship.

[0100] As a possible implementation manner, the first execution unit 1404 is configured to:

[0101] Determine the parameter passing rule between the target node and other nodes;

[0102] Execute the actions included in the target node according to the parameter passing rule.

[0103] As a possible implementation manner, the target node and the other nodes are nodes with a strong correlation relationship, and the parameter passing rule is to determine the input parameter of the target node according to the input parameter or output parameter of the other nodes.

[0104] As a possible implementation manner, the target node and the other nodes belong to the nodes in the target sub-link, and the parameter passing rule is to determine the input parameters of the target node and the other nodes according to the input parameter of the target sub-link.

[0105] As a possible implementation manner, the device further includes a transmission unit, configured to:

[0106] Actively transmit the input parameter of the target sub-link to the target node and the other nodes; or,

[0107] The target node and the other nodes actively obtain the input parameter of the target sub-link.

[0108] As a possible implementation manner, the device further includes an update unit, configured to:

[0109] Update the parameter passing rule, and the updated parameter passing rule is to determine the input parameter of the target node according to the input parameter or output parameter of the other nodes.

[0110] As a possible implementation manner, the determining unit is configured to:

[0111] Determine the output parameter of the target sub-link according to the parameters of the target node and the parameters of the other nodes, where the parameters include output parameters and input parameters.

[0112] As a possible implementation manner, the parameter passing rule is to determine the input parameter of the target node and the input parameter of the other nodes according to a pre-set global variable.

[0113] As can be seen from the above technical solution, instead of generating a test script for each test service, a sub-link is generated based on the smallest units of multiple steps required by multiple test services, and a target link required for the target test service is generated based on the sub-link and / or steps. The target link is determined as the current test link, the i-th node in the current test link is determined as the target node, the type of the target node is identified. If the type of the target node is a step, the actions included in the target node are executed to complete the test of this step, and the (i + 1)-th node is re-determined as the target node, and the type of the target node and subsequent steps are continued to be executed until all nodes in the target link are executed; if the type of the target node is a sub-link, the target node is re-determined as the current test link, and the i-th node in the current test link is used as the target node and subsequent steps are executed. Thus, the target link constructed by combining steps and sub-links can complete the test by traversal, realizing the reuse of the same step in multiple test processes. When a certain step needs to be updated, the links constructed based on this step will all be updated correspondingly, not only reducing the maintenance cost but also reducing the possibility of omission in updating.

[0114] An embodiment of the present application also provides a computer device. Refer to Figure 15 , which shows the structure diagram of a computer device provided by an embodiment of the present application. As Figure 15 shown, the device includes a memory 1510 and a processor 1520:

[0115] The memory 1510 is used to store program codes and transmit the program codes to the processor;

[0116] The processor 1520 is used to execute any one of the test methods provided by the above embodiments according to the instructions in the program codes.

[0117] An embodiment of the present application provides a computer-readable storage medium, which is used to store a computer program, and the computer program is used to execute any one of the test methods provided by the above embodiments.

[0118] Each embodiment in this specification is described in a progressive manner. For the same or similar parts among the embodiments, reference can be made to each other, and the key points of each embodiment are the differences from other embodiments. In particular, for the apparatus embodiments, since they are basically similar to the method embodiments, they are described relatively simply, and reference can be made to the relevant parts of the method embodiments for the relevant content. The apparatus embodiments described above are merely illustrative, and the units and modules described as separate components may or may not be physically separated. In addition, some or all of the units and modules can be selected according to actual needs to achieve the purpose of the solution of this embodiment. A person of ordinary skill in the art can understand and implement it without creative work.

[0119] The above is only the specific implementation manner of the present application. It should be noted that for those of ordinary skill in the art in this technical field, without departing from the principle of the present application, several improvements and refinements can be made, and these improvements and refinements should also be regarded as the protection scope of the present application.

Claims

1. A testing method, characterized in that, The method includes: Obtaining a target link corresponding to a target test service, where the target link includes multiple nodes, and the types of the nodes include steps and sub-links, and the sub-links are determined based on the smallest units of multiple identical steps included in multiple test services; Determining the target link as the current test link, and determining the i-th node in the current test link as the target node; Identifying the type of the target node; If the type of the target node is a step, performing the actions included in the target node, re-determining the (i + 1)-th node as the target node, performing the identifying the type of the target node and subsequent steps until all nodes in the target link are identified; If the type of the target node is a sub-link, re-determining the target node as the current test link, taking the j-th node in the current test link as the target node, performing the identifying the type of the target node and subsequent steps until all nodes in the target link are identified; The obtaining the target link corresponding to the target test service includes: Obtaining the nodes required for the target test service and the sequence relationship between the nodes; Generating a target link according to the nodes and the sequence relationship; The performing the actions included in the target node includes: Determining the parameter passing rule between the target node and other nodes; Performing the actions included in the target node according to the parameter passing rule.

2. The method according to claim 1, wherein The target node and the other nodes are nodes with a strong correlation relationship, and the parameter passing rule is to determine the input parameter of the target node according to the input parameter or output parameter of the other nodes.

3. The method according to claim 1, characterized in that The target node and the other nodes belong to the nodes in the target sub-link, and the parameter passing rule is to determine the input parameters of the target node and the other nodes according to the input parameter of the target sub-link.

4. The method according to claim 3, wherein The method further includes: The input parameter of the target sub-link is actively passed to the target node and the other nodes; or, The target node and the other nodes actively obtain the input parameter of the target sub-link.

5. The method according to claim 3, wherein The method further includes: Updating the parameter passing rule, and the updated parameter passing rule is to determine the input parameter of the target node according to the input parameter or output parameter of the other nodes.

6. The method according to claim 3, wherein The method further includes: Determining the output parameter of the target sub-link according to the parameter of the target node and the parameter of the other nodes, where the parameter includes the output parameter and the input parameter.

7. The method according to claim 1, wherein The parameter passing rule is to determine the input parameter of the target node and the input parameter of the other nodes according to a preset global variable.

8. A testing device, characterized in that, The device includes: an obtaining unit, a determining unit, an identifying unit, a first execution unit, and a second execution unit; The obtaining unit is configured to obtain a target link corresponding to a target test service, where the target link includes multiple nodes, and the types of the nodes include steps and sub-links, and the sub-links are determined based on the smallest units of multiple identical steps included in multiple test services; The determining unit is configured to determine the target link as the current test link, and determine the i-th node in the current test link as the target node; The identifying unit is configured to identify the type of the target node; The first execution unit is configured to, if the type of the target node is a step, execute the actions included in the target node, re-determine the (i + 1)-th node as the target node, and execute the steps of identifying the type of the target node and subsequent steps until all the nodes in the target link are identified; The second execution unit is configured to, if the type of the target node is a sub-link, re-determine the target node as the current test link, use the j-th node in the current test link as the target node, and execute the steps of identifying the type of the target node and subsequent steps until all the nodes in the target link are identified; The obtaining unit is specifically configured to: Obtain the nodes required for the target test service and the sequential relationship between the nodes; Generate a target link according to the nodes and the sequential relationship; The first execution unit is specifically configured to: Determine the parameter transfer rule between the target node and other nodes; Execute the actions included in the target node according to the parameter transfer rule.

9. A computer device, characterized in that, The device includes a processor and a memory: The memory is used to store program codes and transmit the program codes to the processor; The processor is used to execute the method according to any one of claims 1-7 based on the instructions in the program codes.

10. A computer-readable storage medium, characterized in that, The computer-readable storage medium is used to store a computer program, and the computer program is used to execute the method according to any one of claims 1-7.

Citation Information

Patent Citations

  • Automatic test case generation method and system based on scene method

    CN110597730A

  • Process engine test method, process engine testing device, computer equipment and storage medium

    CN111176992A