CN112835804B - Test case processing method, device, electronic equipment and medium - Google Patents

Test case processing method, device, electronic equipment and medium Download PDF

Info

Publication number
CN112835804B
CN112835804B CN202110207438.7A CN202110207438A CN112835804B CN 112835804 B CN112835804 B CN 112835804B CN 202110207438 A CN202110207438 A CN 202110207438A CN 112835804 B CN112835804 B CN 112835804B
Authority
CN
China
Prior art keywords
test
path
determining
event
case
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.)
Active
Application number
CN202110207438.7A
Other languages
Chinese (zh)
Other versions
CN112835804A (en
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.)
Industrial and Commercial Bank of China Ltd ICBC
Original Assignee
Industrial and Commercial Bank of China Ltd ICBC
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 Industrial and Commercial Bank of China Ltd ICBC filed Critical Industrial and Commercial Bank of China Ltd ICBC
Priority to CN202110207438.7A priority Critical patent/CN112835804B/en
Publication of CN112835804A publication Critical patent/CN112835804A/en
Application granted granted Critical
Publication of CN112835804B publication Critical patent/CN112835804B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

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/3692Test management for test results analysis

Landscapes

  • Engineering & Computer Science (AREA)
  • Theoretical Computer Science (AREA)
  • Computer Hardware Design (AREA)
  • Quality & Reliability (AREA)
  • Physics & Mathematics (AREA)
  • General Engineering & Computer Science (AREA)
  • General Physics & Mathematics (AREA)
  • Debugging And Monitoring (AREA)

Abstract

The embodiment of the disclosure provides a test case processing method, a device, electronic equipment and a medium, which can be applied to the financial field or other fields. The method comprises the following steps: acquiring a trigger request for an operation event; responding to a trigger request, acquiring M operation sets aiming at operation events, wherein each operation set comprises at least two event nodes, each event node comprises an identifier of an icon and an operation aiming at the icon, and M is more than or equal to 1; analyzing M operation sets to obtain N test paths, wherein each test path at least comprises an event node with a node type of starting execution and an event node with a node type of ending execution, and N is more than or equal to 1; according to each test path in the N test paths, a test case aiming at the test path is generated.

Description

Test case processing method, device, electronic equipment and medium
Technical Field
The embodiment of the disclosure relates to the technical field of computers, and more particularly relates to a test case processing method, a device, electronic equipment and a medium.
Background
Before the application program of the mobile terminal is on line, testing is usually required to be performed so as to ensure that the application program can normally run. The last test link of the application program before being on line is a regression test, and the test link plays an important role. In the related art, it is generally implemented by manually testing static test cases.
In the process of implementing the disclosed concept, the inventor finds that at least the following problems exist in the related art: the test quality using the related art is not high.
Disclosure of Invention
In view of this, embodiments of the present disclosure provide a method, an apparatus, an electronic device, and a medium for processing a test case.
One aspect of an embodiment of the present disclosure provides a test case processing method, including: acquiring a trigger request for an operation event; responding to the triggering request, obtaining M operation sets aiming at the operation events, wherein each operation set comprises at least two event nodes, each event node comprises an icon identifier and an operation aiming at the icon, and M is more than or equal to 1; analyzing the M operation sets to obtain N test paths, wherein each test path at least comprises an event node with a node type of starting execution and an event node with a node type of ending execution, and N is more than or equal to 1; generating test cases for the test paths according to each of the N test paths
According to an embodiment of the present disclosure, the parsing the M operation sets to obtain N test paths includes: analyzing the M operation sets to obtain the N test paths and path weights corresponding to each test path; the method further comprises the following steps: determining the execution sequence of the test cases according to the path weight corresponding to the test path; and executing the N test cases according to the execution sequence of the N test cases.
According to an embodiment of the present disclosure, further comprising: for each test path in the N test paths, determining a case type to which a test case corresponding to the test path belongs according to an execution type to which an event node included in the test path belongs, wherein the case type comprises a manual test case or an automatic test case.
According to an embodiment of the present disclosure, the determining, according to an execution type to which the event node included in the test path belongs, a case type to which a test case corresponding to the test path belongs includes: under the condition that the test path comprises a target node, determining the case type of the test case corresponding to the test path as the manual test case, wherein the target node is used for representing an event node of which the execution type is manually executed; and under the condition that the test path does not comprise the target node, determining the case type of the test case corresponding to the test path as the automatic test case.
According to an embodiment of the present disclosure, the parsing the M operation sets to obtain N test paths and path weights corresponding to each of the test paths includes: determining the occurrence times of each event node pair in the M operation sets, wherein each event node pair comprises a first event node and a second event node, and the second event node is the next event node of the first event node; determining the N test paths according to the M operation sets; determining each event node pair included in the test path for each of the N test paths; carrying out weighted summation on the occurrence times of each event node pair to obtain a summation result; and determining the summation result as a path weight corresponding to the test path.
According to an embodiment of the present disclosure, determining the N test paths according to the M operation sets includes: analyzing the M operation sets to generate a directed graph; and determining the N test paths according to the directed graph.
According to an embodiment of the present disclosure, the determining the execution order of the test cases according to the path weight corresponding to the test path includes: determining the priorities of N test cases according to the N path weights; and determining the execution sequence of the N test cases according to the priorities of the N test cases.
According to an embodiment of the present disclosure, determining the priorities of the N test cases according to the N path weights includes: sorting the N path weights according to the sizes of the path weights to obtain sorting results; and determining the priorities of the N test cases according to the sorting result.
According to an embodiment of the present disclosure, the sorting the N path weights according to the size of the path weights to obtain a sorting result includes: determining a case type of a test case corresponding to the test path for each of the N test paths, wherein the case type comprises a manual test case or an automatic test case; determining a similar case set, wherein the similar case set comprises the same case type of the test case; and sorting the path weights corresponding to the similar case sets according to the path weights for each similar case set to obtain a sorting result. The determining the priorities of the N test cases according to the sorting result includes: determining the priority of the test cases included in the similar case set according to the sorting result; determining the execution sequence of the N test cases according to the priorities of the N test cases, including: determining the execution sequence of the test cases included in the similar case set according to the priorities of the test cases included in the similar case set; the executing the N test cases according to the execution sequence of the N test cases includes: and executing the test cases included in the similar case set according to the execution sequence of the test cases included in the similar case set.
Another aspect of an embodiment of the present disclosure provides a test case processing apparatus, the apparatus comprising: the acquisition module is used for acquiring a trigger request aiming at an operation event; the response module is used for responding to the triggering request and obtaining M operation sets aiming at the operation events, wherein each operation set comprises at least two event nodes, each event node comprises an icon identifier and an operation aiming at the icon, and M is more than or equal to 1; the analysis module is used for analyzing the M operation sets to obtain N test paths, wherein each test path at least comprises an event node with a node type of starting execution and an event node with a node type of ending execution, and N is more than or equal to 1; and the generating module is used for generating a test case aiming at the test paths according to each of the N test paths.
Another aspect of an embodiment of the present disclosure provides an electronic device, including: one or more processors; and a memory for storing one or more programs, wherein the one or more programs, when executed by the one or more processors, cause the one or more processors to implement the method as described above.
Another aspect of the disclosed embodiments provides a computer-readable storage medium storing computer-executable instructions that, when executed, are configured to implement a method as described above.
According to the embodiment of the disclosure, by acquiring a trigger request for an operation event, responding to the trigger request, acquiring M operation sets for the operation event, wherein each operation set comprises at least two event nodes, each event node comprises an identifier of an icon and an operation for the icon, M is more than or equal to 1, analyzing the M operation sets to obtain N test paths, each test path at least comprises an event node with a node type of starting execution and an event node with a node type of ending execution, N is more than or equal to 1, and generating a test case for the test path according to each test path in the N test paths. Because the test cases generated by the operation set aiming at the operation event are acquired through automatic analysis, and the operation set is changed according to the change of the product function, the test cases generated by adopting the method are dynamically changed, not statically unchanged, namely dynamic test cases. Because the dynamic test cases can be changed according to the change of the product functions, the mode of testing the dynamic test cases can meet the requirement of testing the current product functions, so that the problems of the application program products can be found, the technical problem of low testing quality of the related technology is at least partially overcome, and the testing quality is further improved.
Drawings
The above and other objects, features and advantages of the present disclosure will become more apparent from the following description of embodiments thereof with reference to the accompanying drawings in which:
fig. 1 schematically illustrates an exemplary system architecture to which a test case processing method may be applied, according to an embodiment of the present disclosure;
fig. 2 schematically illustrates a flow chart of a test case processing method according to an embodiment of the present disclosure;
FIG. 3 schematically illustrates a schematic diagram of a startup node according to an embodiment of the present disclosure;
FIG. 4 schematically illustrates a schematic diagram of an end node according to an embodiment of the present disclosure;
fig. 5 schematically illustrates a flow chart of another test case processing method according to an embodiment of the present disclosure;
FIG. 6 schematically illustrates a schematic diagram of a set of operations according to an embodiment of the present disclosure;
FIG. 7 schematically illustrates a schematic diagram of a directed graph, in accordance with an embodiment of the present disclosure;
fig. 8 schematically illustrates a block diagram of a test case processing device according to an embodiment of the present disclosure; and
fig. 9 schematically illustrates a block diagram of an electronic device adapted to implement a test case processing method in accordance with an embodiment of the present disclosure.
Detailed Description
Hereinafter, embodiments of the present disclosure will be described with reference to the accompanying drawings. It should be understood that the description is only exemplary and is not intended to limit the scope of the present disclosure. In the following detailed description, for purposes of explanation, numerous specific details are set forth in order to provide a thorough understanding of the embodiments of the present disclosure. It may be evident, however, that one or more embodiments may be practiced without these specific details. In addition, in the following description, descriptions of well-known structures and techniques are omitted so as not to unnecessarily obscure the concepts of the present disclosure.
The terminology used herein is for the purpose of describing particular embodiments only and is not intended to be limiting of the disclosure. The terms "comprises," "comprising," and/or the like, as used herein, specify the presence of stated features, steps, operations, and/or components, but do not preclude the presence or addition of one or more other features, steps, operations, or components.
All terms (including technical and scientific terms) used herein have the same meaning as commonly understood by one of ordinary skill in the art unless otherwise defined. It should be noted that the terms used herein should be construed to have meanings consistent with the context of the present specification and should not be construed in an idealized or overly formal manner.
Where expressions like at least one of "A, B and C, etc. are used, the expressions should generally be interpreted in accordance with the meaning as commonly understood by those skilled in the art (e.g.," a system having at least one of A, B and C "shall include, but not be limited to, a system having a alone, B alone, C alone, a and B together, a and C together, B and C together, and/or A, B, C together, etc.). Where a formulation similar to at least one of "A, B or C, etc." is used, in general such a formulation should be interpreted in accordance with the ordinary understanding of one skilled in the art (e.g. "a system with at least one of A, B or C" would include but not be limited to systems with a alone, B alone, C alone, a and B together, a and C together, B and C together, and/or A, B, C together, etc.).
In the related art, it is generally implemented by manually testing static test cases, where the static test cases refer to test cases generated by manually empirically listing some main business processes according to the business processes. Wherein the static behavior is constant in that these test cases are typically not updated for a long time.
In the process of implementing the disclosed concept, the inventor finds that, because the product functions are continuously updated, corresponding to the business processes corresponding to the product functions also change, and the static test cases are unchanged for a longer period of time, in other words, the static test cases cannot change along with the change of the product functions, so if the static test cases are tested in a manner of testing the static test cases, because the static test cases are not modified correspondingly according to the change of the product functions, the manner of testing the static test cases is difficult to meet the requirement of testing the current product functions, and therefore, the problems of the application program products are difficult to find, so that the test quality of the test in a manner of testing the static test cases is not high.
In order to solve the problem of low test quality in the related art, the inventor proposes a scheme for automatically testing dynamic test cases. The dynamic test cases refer to test cases generated by automatically analyzing and acquiring an operation set aiming at operation events. The dynamic behavior is characterized in that the operation set is generated according to the operation set aiming at the operation event, and the operation set is changed according to the change of the product function, so that the test cases generated in the way are dynamically changed, not statically unchanged. Because the dynamic test cases can be changed according to the change of the product functions, the mode of testing the dynamic test cases can meet the requirement of testing the current product functions, so that the problems of the application program products can be found, and the testing quality is improved.
Specifically, the embodiment of the disclosure provides a test case processing method, a device and an electronic apparatus capable of applying the method, and the test case processing method, the device and the electronic apparatus of the embodiment of the disclosure may be applied to the financial field, and may also be applied to any field other than the financial field, and the application fields of the test case processing method, the device and the electronic apparatus of the embodiment of the disclosure are not limited. The method comprises an operation set acquisition process, an operation set analysis process and a test case generation process. In the process of acquiring operation sets, acquiring a trigger request for an operation event, and responding to the trigger request, acquiring M operation sets for the operation event, wherein each operation set comprises at least two event nodes, and each event node comprises an identifier of an icon and an operation for the icon. In the operation set analysis process, analyzing M operation sets to obtain N test paths, wherein each test path at least comprises an event node with a node type of starting execution and an event node with a node type of ending execution. In the test case generation process, a test case for the test path is generated according to each of the N test paths.
Fig. 1 schematically illustrates an exemplary system architecture 100 to which test case processing methods may be applied, according to embodiments of the present disclosure. It should be noted that fig. 1 is only an example of a system architecture to which embodiments of the present disclosure may be applied to assist those skilled in the art in understanding the technical content of the present disclosure, but does not mean that embodiments of the present disclosure may not be used in other devices, systems, environments, or scenarios.
As shown in fig. 1, a system architecture 100 according to this embodiment may include terminal devices 101, 102, 103, a network 104, and a server 105. The network 104 is used as a medium for providing a communication link between the terminal devices 10l, 102, 103 and the server 105. The network 104 may include various connection types, such as wired and/or wireless communication links, and the like.
The user may interact with the server 105 via the network 104 using the terminal devices 101, 102, 103 to receive or send messages or the like. Various communication client applications may be installed on the terminal devices 101, 102, 103, such as banking applications, shopping applications, web browser applications, search applications, instant messaging tools, mailbox clients and/or social platform software, to name a few.
The terminal devices 101, 102, 103 may be a variety of electronic devices having a display screen and supporting web browsing, including but not limited to smartphones, tablets, laptop and desktop computers, and the like.
The server 105 may be a server providing various services, such as a background management server (by way of example only) providing support for controls operated by the user with the terminal devices 101, 102, 103. The background management server may analyze and process the received data such as the trigger request for the operation event, and feed back the processing result (for example, acquiring the operation set for the operation event in response to the trigger request) to the terminal device.
It should be noted that, the test case processing method provided by the embodiments of the present disclosure may be generally performed by the terminal device 101, 102, or 103, or may be performed by other terminal devices different from the terminal device 101, 102, or 103. Accordingly, the test case processing apparatus provided by the embodiments of the present disclosure may be generally provided in the terminal device 101, 102, or 103, or in another terminal device different from the terminal device 101, 102, or 103.
For example, the operation set may be originally stored in any one of the terminal devices 101, 102, or 103 (for example, but not limited to, the terminal device 101), or stored on an external storage device and may be imported into the terminal device 101. The terminal device 101 may then locally perform the test case processing method provided by the embodiments of the present disclosure, or send the operation set to other terminal devices, servers, or server clusters, and perform the test case processing method provided by the embodiments of the present disclosure by the other terminal devices, servers, or server clusters that receive the image to be processed.
Alternatively, the test case processing methods provided by embodiments of the present disclosure may also be performed by the server 105. Accordingly, the test case processing device provided by the embodiments of the present disclosure may also be provided in the server 105. The test case processing methods provided by the embodiments of the present disclosure may also be performed by a server or cluster of servers other than server 105 and capable of communicating with terminal devices 101, 102, 103 and/or server 105. Accordingly, the test case processing apparatus provided by the embodiments of the present disclosure may also be provided in a server or server cluster that is different from the server 105 and is capable of communicating with the terminal devices 101, 102, 103 and/or 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.
Meanwhile, in the related art, because the static test cases are manually tested, the number of the manually tested test cases is small in a preset time period, and therefore the test efficiency of manually tested static test cases is low.
In addition, the dynamic test case is automatically tested, so that the test efficiency is improved.
Fig. 2 schematically illustrates a flow chart of a test case processing method according to an embodiment of the present disclosure.
As shown in fig. 2, the method includes operations S210 to S240.
In operation S210, a trigger request for an operation event is acquired.
According to an embodiment of the present disclosure, an operation event may represent an event in which an operation for an icon is generated during the use of a certain function of an application by an operator. The icons may include controls. The operator may include a user's finger, mouse, capacitive pen, or other operator. The trigger request may be generated according to an operation of the operation body with an icon for starting a certain function of the application program. Operations may include clicking, sliding, or entering.
For example, as for a login function of an application, the trigger request may be triggered by the operator clicking on a login control of a login page.
In operation S220, M operation sets for operation events are acquired in response to the trigger request, wherein each operation set includes at least two event nodes, each event node includes an identifier of an icon and an operation for the icon, and M is greater than or equal to 1.
According to the embodiment of the disclosure, after a trigger request for an operation event is acquired, M operation sets for the operation event may be acquired by using a source code embedded point method, that is, when the operation event is triggered, corresponding data provided by a software development kit is called in a preset function to acquire the M operation sets for the operation event.
According to an embodiment of the present disclosure, each operation set may include at least one event node of which a node type is start execution and one event node of which a node type is end execution, and further, the operation set may include at least one event node of which a node type is intermediate execution. The event node with the node type of starting execution may be referred to as a starting node, the event node with the node type of ending execution may be referred to as an ending node, and the event node with the node type of intermediate execution may be referred to as an intermediate node. The initiator node is an event node that is a root node and has no parent node. An end node is an event node that has only a parent node and no child nodes. An intermediate node is an event node that has both parent and child nodes. Each event node includes an identification of the icon and an operation on the icon, wherein the identification may be used to characterize the icon. I.e. an event node can be understood as an operation of an operator on an icon. Illustratively, an event node includes a click operation for a control identified as identification 1. Wherein, the mark is marked as 1, and the operation is the clicking operation for the control.
By way of example, fig. 3 schematically illustrates a schematic diagram of a startup node according to an embodiment of the present disclosure. Fig. 4 schematically illustrates a schematic diagram of an end node according to an embodiment of the present disclosure. The operational event for which fig. 3 and 4 are directed is an event of transferring money through a mobile banking. Wherein the start node in fig. 3 characterizes the operation of clicking the login control by the user. The end node in fig. 4 characterizes the operation of the user clicking on the determination control.
According to an embodiment of the present disclosure, the different event nodes included in each operation set are generated in accordance with the business logic of the operation event. The two adjacent event nodes have a front-back relationship, and the front-back relationship is represented by the fact that the next event node in the two adjacent event nodes is the next event node of the previous event node according to the occurrence sequence of the event nodes. Wherein two adjacent event nodes may be referred to as an event node pair. The event node pair includes a first event node and a second event node, the second event node being a next event node to the first event node. The first event node is the previous event node in the two adjacent event nodes, and the second event node is the next event node in the two adjacent event nodes.
In operation S230, M operation sets are parsed to obtain N test paths, where each test path includes at least one event node with a node type of starting execution and one event node with a node type of ending execution, and N is greater than or equal to 1.
According to the embodiment of the disclosure, after obtaining M operation sets, the M operation sets may be parsed to obtain N test paths, where a start node and an end node of each of the N test paths are start nodes and end nodes existing in the M operation sets. That is, if the M operation sets include P startup end node pairs, the N test paths are test paths formed with the P startup end node pairs as startup nodes and end nodes. Wherein, P is more than or equal to 1 and less than or equal to M. N may be equal to, less than or greater than M. Each test path comprises at least two event nodes and a connecting line between every two adjacent event nodes, wherein the connecting line is a connecting line with directivity, i.e. the connecting line between every two adjacent event nodes is that the previous event node points to the next event node. In addition, each measurement path may include an event node (i.e., an intermediate node) whose node type is intermediate execution, in addition to an event node (i.e., a start node) whose node type is start execution and an event node (i.e., an end node) whose node type is end execution.
According to an embodiment of the present disclosure, there may be an identical operation set among the M operation sets, the identical operation set refers to including identical event nodes and the context between the event nodes is identical. The same operation set corresponds to the same test path.
In operation S240, a test case for the test path is generated according to each of the N test paths.
According to an embodiment of the present disclosure, a test case for each test path is generated from the links between each event node and every two adjacent event nodes in the test path. Since the test path is for an operational event, the test case is for an operational event.
According to the technical scheme of the embodiment of the disclosure, by acquiring a trigger request for an operation event, responding to the trigger request, acquiring M operation sets for the operation event, wherein each operation set comprises at least two event nodes, each event node comprises an identifier of an icon and an operation for the icon, M is more than or equal to 1, analyzing the M operation sets to obtain N test paths, each test path at least comprises an event node with a node type of starting execution and an event node with a node type of ending execution, N is more than or equal to 1, and according to each test path in the N test paths, a test case for the test path is generated. Because the test cases generated by the operation set aiming at the operation event are acquired through automatic analysis, and the operation set is changed according to the change of the product function, the test cases generated by adopting the method are dynamically changed, not statically unchanged, namely dynamic test cases. Because the dynamic test cases can be changed according to the change of the product functions, the mode of testing the dynamic test cases can meet the requirement of testing the current product functions, so that the problems of the application program products can be found, the technical problem of low testing quality of the related technology is at least partially overcome, and the testing quality is further improved.
According to an embodiment of the present disclosure, parsing M operation sets, resulting in N test paths, may include the following operations.
And analyzing the M operation sets to obtain N test paths and path weights corresponding to each test path.
The method may further include the following operations.
And determining the execution sequence of the test cases according to the path weight corresponding to the test path. And executing the N test cases according to the execution sequence of the N test cases.
According to the embodiment of the disclosure, since the importance of different test cases is different, the test case with higher importance can be executed first, and the test case with lower importance can be executed later, so that the importance degree of the test case can be determined, and the execution sequence of the test cases can be determined according to the importance degree of the test case.
According to embodiments of the present disclosure, the importance of a test path may be characterized by a path weight. Because each test path corresponds to one test case, the importance of the test case can be represented by the path weight. Based on this, the execution sequence of the test cases can be determined according to the path weight corresponding to the test path. The execution sequence of the test cases with equal path weights can be determined according to actual conditions. For example, the execution order is determined randomly.
According to an embodiment of the disclosure, analyzing the M operation sets to obtain N test paths and path weights corresponding to each test path may include determining a number of occurrences of each event node pair in the M operation sets, where each event node pair includes a first event node and a second event node, the second event node is a next event node of the first event node, determining, for each test path in the N test paths, each event node pair included in the test path, performing weighted summation on the number of occurrences of each event node pair to obtain a summation result, and determining the summation result as a path weight corresponding to the test path.
Because in the related art, the number of the manual test cases is small in the preset time period, the test efficiency of the manual test is low. In the embodiment of the disclosure, the dynamic test case is automatically tested, so that the test efficiency is improved.
According to an embodiment of the present disclosure, the method may further include the following operations.
For each test path in the N test paths, determining the case type of the test case corresponding to the test path according to the execution type of the event node included in the test path, wherein the case type comprises a manual test case or an automatic test case.
According to embodiments of the present disclosure, since there are scenarios where automatic testing is difficult to simulate, such as fingerprint verification, face brushing, code scanning, etc., it is necessary to determine the case type to which the test case belongs in order to conduct the targeted test.
The test cases may be classified into artificial test cases or automatic test cases according to whether artificial participation is required, wherein the test cases requiring artificial participation are called artificial test cases, and the test cases requiring artificial participation are called automatic test cases. Whether or not manual participation in the test is generally required may be determined according to an execution type to which the event node included in the test path belongs, i.e., if the test case includes an event node whose execution type is manually executed, it may be determined that manual participation in the test is required. If the test case does not include an event node of the execution type that is manually executed, it may be determined that no human participation in the test is required.
According to the embodiment of the disclosure, determining, according to an execution type to which an event node included in a test path belongs, a case type to which a test case corresponding to the test path belongs may include the following operations.
Under the condition that the test path comprises the target node, determining the case type of the test case corresponding to the test path as a manual test case, wherein the target node is used for representing the event node of which the execution type is manually executed. And under the condition that the test path does not comprise the target node, determining the case type of the test case corresponding to the test path as an automatic test case.
According to the embodiment of the disclosure, the event nodes can be classified into manually executed event nodes or event nodes without manual execution according to the execution type to which the event nodes belong. The event node with the execution type being manual execution is called a target node.
If the test path includes the target node according to the execution type to which the event node belongs, it may be determined that the case type to which the test case corresponding to the test path belongs is an artificial test case. If the test path does not include the target node according to the node type to which the event node belongs, it may be determined that the case type to which the test case corresponding to the test path belongs is an automatic test case.
By determining whether the test path includes the target node, the test cases corresponding to the test path are classified as manual test cases or automatic test cases so that the test can be performed in a targeted manner later. If the manual test case exists, the test mode of manual test and automatic test is adopted, so that the test efficiency is improved compared with the test mode of manual test in the related art.
According to an embodiment of the present disclosure, parsing M operation sets to obtain N test paths and path weights corresponding to each test path may include the following operations.
The number of occurrences of each event node pair in the M operation sets is determined, wherein each event node pair comprises a first event node and a second event node, and the second event node is the next event node of the first event node. And determining N test paths according to the M operation sets. For each of the N test paths, a respective pair of event nodes included in the test path is determined. And carrying out weighted summation on the occurrence times of each event node pair to obtain a summation result. And determining the summation result as a path weight corresponding to the test path.
According to an embodiment of the present disclosure, after obtaining M operation sets, the number of occurrences of each event node pair included in the M operation sets may be determined, that is, for each event node pair, the number of occurrences may be increased by one for each occurrence of the event node pair. For each test path in the N test paths, determining each event node pair included in the test path, carrying out weighted summation on the occurrence times of each event node pair included in the test path to obtain a summation result, and determining the summation result as a path weight corresponding to the test path.
According to an embodiment of the present disclosure, each event node pair includes two adjacent event nodes having a context, namely a first event node and a second event node, the second event node being the next event node to the first event node. Two event node pairs are different event node pairs if they include the same event node but the context of the event nodes is different.
According to an embodiment of the present disclosure, determining N test paths from M sets of operations may include the following operations.
And analyzing M operation sets to generate a directed graph. And determining N test paths according to the directed graph.
According to embodiments of the present disclosure, M sets of operations may be parsed to generate a directed graph that includes T event node pairs and a connection between a first event node and a second event node in each event node pair. The direction of the connection line which is directionally embodied between the first event node and the second event node is that the first event node points to the second event node, and T is more than or equal to 1. In the directed graph, N test paths are obtained along the direction that the first event node points to the second event node.
According to an embodiment of the present disclosure, determining an execution order of test cases according to path weights corresponding to test paths may include the following operations.
And determining the priority of the N test cases according to the N path weights. And determining the execution sequence of the N test cases according to the priorities of the N test cases.
According to embodiments of the present disclosure, the greater the path weight corresponding to a test path, the higher the priority of the test case corresponding to that test path. The higher the priority of the test cases, the earlier the execution order of the test cases.
According to an embodiment of the present disclosure, determining the priorities of the N test cases according to the N path weights may include the following operations.
And sorting the N path weights according to the size of the path weights to obtain a sorting result. And determining the priority of the N test cases according to the sequencing result.
According to the embodiment of the disclosure, the N path weights are ranked according to the size of the path weights, and a ranking result of the N path weights according to the size of the path weights is obtained. If the sorting result is that the N path weights are sorted according to the order of the path weights from big to small, the higher the priority of the corresponding test cases is, the lower the priority of the corresponding test cases is after the sorting of the path weights is. If the sorting result is that the N path weights are sorted according to the order of the path weights from small to large, the higher the priority of the corresponding test cases is, and the lower the priority of the corresponding test cases is.
According to the embodiment of the disclosure, the sorting of the N path weights according to the size of the path weights, to obtain a sorting result, may include the following operations.
For each test path in the N test paths, determining the case type of the test case corresponding to the test path, wherein the case type comprises a manual test case or an automatic test case. And determining a homogeneous case set, wherein the homogeneous case set comprises the same case type to which the test cases belong. And ordering the path weights corresponding to the similar case sets according to the sizes of the path weights aiming at each similar case set to obtain an ordering result.
Determining the priority of the N test cases based on the ranking results may include the following operations. And determining the priority of the test cases included in the similar case set according to the sorting result.
Determining the execution order of the N test cases according to the priorities of the N test cases may include the following operations. And determining the execution sequence of the test cases included in the similar case set according to the priorities of the test cases included in the similar case set.
Executing the N test cases according to the execution order of the N test cases may include the following operations. And executing the test cases included in the similar case set according to the execution sequence of the test cases included in the similar case set.
According to the embodiment of the disclosure, since the test cases can be classified into automatic test cases or manual test cases, and the automatic test cases and the manual test cases can be generally executed in parallel, when determining the execution sequence of the test cases, a similar case set can be determined, and the path weights corresponding to the similar case set are ranked according to the size of the path weights, so as to obtain a ranking result. And determining the execution sequence of each test case in the similar case set according to the sequencing result.
For each test case, the case type to which the test case belongs is determined, whereby the N test cases can be divided into an automatic test case set and a manual test case set. And aiming at the automatic test case set, sorting path weights corresponding to the automatic test case set according to the size of the path weights to obtain a first sorting result, determining the priority of each test case in the automatic test case set according to the first sorting result, and determining the execution sequence of each test case in the automatic test case set according to the priority of each test case in the automatic test case set.
And aiming at the manual test case set, sorting path weights corresponding to the manual test case set according to the size of the path weights to obtain a second sorting result, determining the priority of each test case in the manual test case set according to the second sorting result, and determining the execution sequence of each test case in the manual test case set according to the priority of each test case in the manual test case set.
According to the embodiment of the disclosure, for the automatic test case set, an automatic test tool can be configured to test sequentially according to the size of the path weight. Aiming at the manual test case set, the test can be sequentially carried out according to the size of the path weight in a limited test time, so that the correctness of the main branch of the product can be ensured to the greatest extent.
Fig. 5 schematically illustrates a flow chart of another test case processing method according to an embodiment of the present disclosure.
As shown in fig. 5, the method includes operations S501 to S519.
In operation S501, a trigger request for an operation event is acquired.
In operation S502, M operation sets for operation events are acquired in response to a trigger request.
In operation S503, the M operation sets are parsed, and a directed graph is generated, where the directed graph includes T event node pairs.
In operation S504, N test paths are determined according to the directed graph.
In operation S505, a test case for a test path is generated according to each of the N test paths.
In operation S506, for each of the N test paths, a respective event node pair included in the test path is determined.
In operation S507, the number of occurrences of each event node pair is weighted and summed to obtain a summation result.
In operation S508, the result of the summation is determined as a path weight corresponding to the test path.
In operation S509, for each of the N test paths, determining whether the test path includes a target node; if yes, executing operation S510; if not, operation S511 is performed.
In operation S510, it is determined that the case type to which the test case corresponding to the test path belongs is a manual test case, and operation 512 is performed.
In operation S511, it is determined that the case type to which the test case corresponding to the test path belongs is an automatic test case, and operation S516 is performed.
In operation S512, the path weights corresponding to the artificial case set are ranked according to the size of the path weights, so as to obtain a first ranking result.
In operation S51 3, the priorities of the test cases included in the artificial case set are determined according to the first sorting result.
In operation S514, an execution order of the test cases included in the artificial case set is determined according to the priorities of the test cases included in the artificial case set.
In operation S515, the test cases included in the artificial case set are executed according to the execution order of the test cases included in the artificial case set.
In operation S516, the path weights corresponding to the automatic case set are ranked according to the size of the path weights, so as to obtain a second ranking result.
In operation S517, the priorities of the test cases included in the automatic case set are determined according to the second sorting result.
In operation S518, an execution order of the test cases included in the automatic case set is determined according to the priorities of the test cases included in the automatic case set.
In operation S519, the test cases included in the automatic case set are executed according to the execution order of the test cases included in the automatic case set.
Fig. 6 schematically illustrates a schematic diagram of a set of operations according to an embodiment of the present disclosure, according to an embodiment of the present disclosure. Fig. 6 includes 3 operation sets, namely an operation set 1, an operation set 2 and an operation set 3, wherein the operation set 1 includes n1 (event node 1), n2 (event node 2), n3 (event node 3) and n4 (event node 4), n1 is a start node, n4 is an end node, n2 and n3 are intermediate nodes, and n3 is a target node. The operation set 2 includes n5 (event node 5), n2 (event node 2), n6 (event node 6), and n4 (event node 4), n5 being a start node, n4 being an end node, and n2 and n6 being intermediate nodes. The operation set 3 includes n5 (event node 5), n2 (event node 2), n6 (event node 6), and n7 (event node 7), n5 being a start node, n7 being an end node, and n2 and n6 being intermediate nodes.
Fig. 7 schematically illustrates a schematic diagram of a directed graph, according to an embodiment of the present disclosure. Fig. 7 is a directed graph generated from the operation set included in fig. 6, and 7 event node pairs are included in fig. 7, wherein event node pair 1 includes n1 (first event node) and n2 (second event node), event node pair 2 includes n2 (first event node) and n3 (second event node), event node pair 3 includes n3 (first event node) and n4 (second event node), event node pair 4 includes n5 (first event node) and n2 (second event node), event node pair 5 includes n2 (first event node) and n6 (second event node), event node pair 6 includes n6 (first event node) and n4 (second event node), and event node pair 7 includes n6 (first event node) and n7 (second event node).
In conjunction with fig. 6, the number of occurrences of each event node pair in fig. 7 is determined, where the number of occurrences of event node pair 1 is 1, the number of occurrences of event node pair 2 is 1, the number of occurrences of event node pair 3 is 1, the number of occurrences of event node pair 4 is 2, the number of occurrences of event node pair 5 is 2, the number of occurrences of event node pair 6 is 1, and the number of occurrences of event node pair 7 is 1.
According to the directed graph of fig. 7, 7 test paths are determined, for each test path, the occurrence times of each event node pair included in the test path are added to obtain a summation result, and the summation result is determined as a path weight corresponding to the test path. Determining whether the test path includes a target node, determining a test case including the target node as an artificial test case, and determining a test case not including the target node as an automatic test case, the results of which are shown in table 1 below.
TABLE 1
As shown in table 1, the manual test case set includes test case 1 and test case 3, and the automatic test case set includes test case 2, test case 4, test case 5, and test case 6. For the artificial test case set, since the path weight of test case 3 is greater than the path weight of test case 1, the test cases are sequentially executed in the order of test case 3 and test case 1. For the automatic test case set, since the path weights of test case 4 and test case 6 are equal, the path weights of test case 2 and test case 5 are equal, and the path weights of test case 4 and test case 6 are greater than the path weights of test case 2 and test case 5, the execution order of test case 4 and test case 6 precedes test case 2 and test case 5. The execution sequence of the test cases with equal path weights can be determined according to actual conditions. For example, the execution order is determined randomly.
According to the technical scheme of the embodiment of the disclosure, by adopting the scheme of automatically testing the dynamic test cases, wherein the test cases have corresponding path weights, and the test cases are divided into automatic test cases or manual test cases according to whether the test paths comprise target nodes, the automatic test case set is realized, and the automatic test tools can be configured to test sequentially according to the size of the path weights. Aiming at the manual test case set, the test can be sequentially carried out according to the size of the path weight in a limited test time, so that the test quality and the test efficiency are improved, and the correctness of the main branch of the product is ensured to the greatest extent.
Fig. 8 schematically illustrates a block diagram of a test case processing device according to an embodiment of the present disclosure.
As shown in fig. 8, the test case processing apparatus 800 includes an acquisition module 810, a response module 820, a parsing module 830, and a generation module 840.
The acquisition module 810, the response module 820, the parsing module 830, and the generation module 840 may be communicatively coupled.
The acquiring module 810 is configured to acquire a trigger request for an operation event.
And the response module 820 is used for responding to the trigger request and acquiring M operation sets aiming at operation events, wherein each operation set comprises at least two event nodes, each event node comprises an identifier of an icon and an operation aiming at the icon, and M is more than or equal to 1.
The parsing module 830 is configured to parse the M operation sets to obtain N test paths, where each test path includes at least one event node with a node type of starting execution and one event node with a node type of ending execution, and N is greater than or equal to 1.
A generating module 840 is configured to generate a test case for the test path according to each of the N test paths.
According to the technical scheme of the embodiment of the disclosure, by acquiring a trigger request for an operation event, responding to the trigger request, acquiring M operation sets for the operation event, wherein each operation set comprises at least two event nodes, each event node comprises an identifier of an icon and an operation for the icon, M is more than or equal to 1, analyzing the M operation sets to obtain N test paths, each test path at least comprises an event node with a node type of starting execution and an event node with a node type of ending execution, N is more than or equal to 1, and according to each test path in the N test paths, a test case for the test path is generated. Because the test cases generated by the operation set aiming at the operation event are acquired through automatic analysis, and the operation set is changed according to the change of the product function, the test cases generated by adopting the method are dynamically changed, not statically unchanged, namely dynamic test cases. Because the dynamic test cases can be changed according to the change of the product functions, the mode of testing the dynamic test cases can meet the requirement of testing the current product functions, so that the problems of the application program products can be found, the technical problem of low testing quality of the related technology is at least partially overcome, and the testing quality is further improved.
According to an embodiment of the present disclosure, parsing module 830 includes a parsing sub-module.
The analysis submodule is used for analyzing the M operation sets to obtain N test paths and path weights corresponding to the test paths.
The test case processing device 800 also includes a first determination module and an execution module.
And the first determining module is used for determining the execution sequence of the test cases according to the path weight corresponding to the test path.
And the execution module is used for executing the N test cases according to the execution sequence of the N test cases.
According to an embodiment of the present disclosure, the test case processing device 800 further includes a second determination module.
The second determining module is configured to determine, for each test path in the N test paths, a case type to which a test case corresponding to the test path belongs according to an execution type to which an event node included in the test path belongs, where the case type includes a manual test case or an automatic test case.
According to an embodiment of the present disclosure, the second determination module includes a first determination sub-module and a second determination sub-module.
The first determining submodule is used for determining that the case type of the test case corresponding to the test path is a manual test case under the condition that the test path comprises a target node, wherein the target node is used for representing an event node of which the execution type is manually executed. And the second determining submodule is used for determining that the case type of the test case corresponding to the test path is an automatic test case under the condition that the test path does not comprise the target node.
According to an embodiment of the present disclosure, the parsing sub-module includes a first determining unit, a second determining unit, a third determining unit, an obtaining unit, and a fourth determining unit.
And the first determining unit is used for determining the occurrence times of each event node pair in the M operation sets, wherein each event node pair comprises a first event node and a second event node, and the second event node is the next event node of the first event node. And the second determining unit is used for determining N test paths according to the M operation sets. And a third determining unit, configured to determine, for each of the N test paths, each event node pair included in the test path. And the obtaining unit is used for carrying out weighted summation on the occurrence times of each event node pair to obtain a summation result. And a fourth determining unit for determining the summation result as a path weight corresponding to the test path.
According to an embodiment of the present disclosure, the first determination unit includes a parsing sub-unit and a first determination sub-unit. And the analysis subunit is used for analyzing the M operation sets and generating a directed graph. And the first determining subunit is used for determining N test paths according to the directed graph.
According to an embodiment of the present disclosure, the first determination module comprises a third determination sub-module and a fourth determination sub-module.
And the third determining submodule is used for determining the priorities of N test cases according to the N path weights. And the fourth determining submodule is used for determining the execution sequence of the N test cases according to the priorities of the N test cases.
According to an embodiment of the present disclosure, the fourth determination submodule includes a sorting unit and a fifth determination unit.
And the sorting unit is used for sorting the N path weights according to the sizes of the path weights to obtain a sorting result. And the fifth determining unit is used for determining the priority of the N test cases according to the sorting result.
According to an embodiment of the present disclosure, the sorting unit comprises a second determining subunit, a third determining subunit and an obtaining subunit. And the second determining subunit is used for determining the case type of the test case corresponding to the test path according to each test path in the N test paths, wherein the case type comprises a manual test case or an automatic test case. And the third determining subunit is used for determining the similar case set, wherein the similar case set comprises the same case type of the test cases. The obtaining subunit is configured to sort, for each similar case set, the path weights corresponding to the similar case sets according to the sizes of the path weights, so as to obtain a sorting result.
The third determination submodule includes a sixth determination unit. And the sixth determining unit is used for determining the priority of the test cases included in the similar case set according to the sorting result.
The fourth determination submodule includes a seventh determination unit. And the seventh determining unit is used for determining the execution sequence of the test cases included in the homogeneous case set according to the priorities of the test cases included in the homogeneous case set.
The execution module includes an execution sub-module. And the execution sub-module is used for executing the test cases included in the similar case set according to the execution sequence of the test cases included in the similar case set.
Any number of modules, sub-modules, units, sub-units, or at least some of the functionality of any number of the sub-units according to embodiments of the present disclosure may be implemented in one module. Any one or more of the modules, sub-modules, units, sub-units according to embodiments of the present disclosure may be implemented as split into multiple modules. Any one or more of the modules, sub-modules, units, sub-units according to embodiments of the present disclosure may be implemented at least in part as hardware circuitry, such as a field programmable gate array (Field Programmable Gate Array, FPGA), a programmable logic array (Programmable Logic Arrays, PLA), a system on a chip, a system on a substrate, a system on a package, an application specific integrated circuit (Application Specific Integrated Circuit, ASIC), or in any other reasonable manner of hardware or firmware that integrates or encapsulates circuitry, or in any one of or a suitable combination of three of software, hardware, and firmware. Alternatively, one or more of the modules, sub-modules, units, sub-units according to embodiments of the present disclosure may be at least partially implemented as computer program modules, which when executed, may perform the corresponding functions.
For example, any of the acquisition module 810, the response module 820, the parsing module 830, and the generation module 840 may be combined in one module/sub-module/unit/sub-unit or any of the modules/sub-modules/units/sub-units may be split into a plurality of modules/sub-modules/units/sub-units. Alternatively, at least some of the functionality of one or more of these modules/sub-modules/units/sub-units may be combined with at least some of the functionality of other modules/sub-modules/units/sub-units and implemented in one module/sub-module/unit/sub-unit. According to embodiments of the present disclosure, at least one of the acquisition module 810, the response module 820, the parsing module 830, and the generation module 840 may be implemented at least in part as hardware circuitry, such as a Field Programmable Gate Array (FPGA), a Programmable Logic Array (PLA), a system on a chip, a system on a substrate, a system on a package, an Application Specific Integrated Circuit (ASIC), or may be implemented in hardware or firmware in any other reasonable way of integrating or packaging circuitry, or in any one of or a suitable combination of three of software, hardware, and firmware. Alternatively, at least one of the acquisition module 810, the response module 820, the parsing module 830 and the generation module 840 may be at least partially implemented as a computer program module, which when executed may perform the corresponding functions.
It should be noted that, in the embodiment of the present disclosure, the test case processing apparatus portion corresponds to the test case processing method portion in the embodiment of the present disclosure, and the description of the test case processing apparatus portion specifically refers to the test case processing method portion and is not described herein.
Fig. 9 schematically shows a block diagram of an electronic device adapted to implement the method described above, according to an embodiment of the disclosure. The electronic device shown in fig. 9 is merely an example, and should not impose any limitations on the functionality and scope of use of embodiments of the present disclosure.
As shown in fig. 9, an electronic device 900 according to an embodiment of the present disclosure includes a processor 901 that can perform various appropriate actions and processes according to a program stored in a Read-Only Memory (ROM) 902 or a program loaded from a storage portion 908 into a random access Memory (Random Access Memory, RAM) 903. The processor 901 may include, for example, a general purpose microprocessor (e.g., a CPU), an instruction set processor and/or an associated chipset and/or a special purpose microprocessor (e.g., an Application Specific Integrated Circuit (ASIC)), or the like. Processor 901 may also include on-board memory for caching purposes. Processor 901 may include a single processing unit or multiple processing units for performing the different actions of the method flows according to embodiments of the present disclosure.
In the RAM 903, various programs and data necessary for the operation of the electronic device 900 are stored. The processor 901, the ROM 902, and the RAM 903 are connected to each other by a bus 904. The processor 901 performs various operations of the method flow according to the embodiments of the present disclosure by executing programs in the ROM 902 and/or the RAM 903. Note that the program may be stored in one or more memories other than the ROM 902 and the RAM 903. The processor 901 may also perform various operations of the method flow according to embodiments of the present disclosure by executing programs stored in the one or more memories.
According to an embodiment of the disclosure, the electronic device 900 may also include an input/output (I/O) interface 905, the input/output (I/O) interface 905 also being connected to the bus 904. The electronic device 900 may also include one or more of the following components connected to the I/O interface 905: an input section 906 including a keyboard, a mouse, and the like; an output portion 907 including a display such as a Cathode Ray Tube (CRT), a liquid crystal display (Liquid Crystal Display, LCD), and a speaker; a storage portion 908 including a hard disk or the like; and a communication section 909 including a network interface card such as a LAN card, a modem, or the like. The communication section 909 performs communication processing via a network such as the internet. The drive 910 is also connected to the I/O interface 905 as needed. A removable medium 911 such as a magnetic disk, an optical disk, a magneto-optical disk, a semiconductor memory, or the like is installed as needed on the drive 910 so that a computer program read out therefrom is installed into the storage section 908 as needed.
According to embodiments of the present disclosure, the method flow according to embodiments of the present disclosure may be implemented as a computer software program. For example, embodiments of the present disclosure include a computer program product comprising a computer program embodied on a computer readable storage medium, the computer program comprising program code for performing the method shown in the flowcharts. In such an embodiment, the computer program may be downloaded and installed from the network via the communication portion 909 and/or installed from the removable medium 911. The above-described functions defined in the system of the embodiments of the present disclosure are performed when the computer program is executed by the processor 901. The systems, devices, apparatus, modules, sub-modules, units, sub-units, etc. described above may be implemented by computer program modules according to embodiments of the disclosure.
The present disclosure also provides a computer-readable storage medium that may be embodied in the apparatus/device/system described in the above embodiments; or may exist alone without being assembled into the apparatus/device/system. The computer-readable storage medium carries one or more programs which, when executed, implement methods in accordance with embodiments of the present disclosure.
According to embodiments of the present disclosure, the computer-readable storage medium may be a non-volatile computer-readable storage medium. Examples may include, but are not limited to: 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, a portable compact disc read-Only Memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination of the foregoing. In the context of this disclosure, a computer-readable storage medium may be any tangible medium that can contain, or store a program for use by or in connection with an instruction execution system, apparatus, or device.
For example, according to embodiments of the present disclosure, the computer-readable storage medium may include ROM 902 and/or RAM 903 and/or one or more memories other than ROM 902 and RAM 903 described above.
Embodiments of the present disclosure also include a computer program product comprising a computer program comprising program code for performing the methods provided by the embodiments of the present disclosure, when the computer program product is run on an electronic device, for causing the electronic device to implement the test case processing methods provided by the embodiments of the present disclosure.
The above-described functions defined in the system/apparatus of the embodiments of the present disclosure are performed when the computer program is executed by the processor 901. The systems, apparatus, modules, units, etc. described above may be implemented by computer program modules according to embodiments of the disclosure.
In one embodiment, the computer program may be based on a tangible storage medium such as an optical storage device, a magnetic storage device, or the like. In another embodiment, the computer program may also be transmitted, distributed, and downloaded and installed in the form of a signal on a network medium, via communication portion 909, and/or installed from removable medium 911. The computer program may include program code that may be transmitted using any appropriate network medium, including but not limited to: wireless, wired, etc., or any suitable combination of the foregoing.
According to embodiments of the present disclosure, program code for performing computer programs provided by embodiments of the present disclosure may be written in any combination of one or more programming languages, and in particular, such computer programs may be implemented in high-level procedural and/or object-oriented programming languages, and/or assembly/machine languages. Programming languages include, but are not limited to, such as Java, c++, python, "C" or similar programming languages. The program code may execute entirely on the user's computing device, partly on the user's device, partly on a remote computing device, or entirely on the remote computing device or server. In the case of remote computing devices, the remote computing device may be connected to the user computing device through any kind of network, including a local area network (Local Area Network, LAN) or wide area network (Wide Area Networks, WAN), or may be connected to an external computing device (e.g., connected through the internet using an internet service provider).
The flowcharts and block diagrams in the figures illustrate the architecture, functionality, and operation of possible implementations of systems, methods and computer program products according to various embodiments of the present disclosure. In this regard, each block in the flowchart or block diagrams may represent a module, segment, or portion of code, which comprises one or more executable instructions for implementing the specified logical function(s). It should also be noted that, in some alternative implementations, the functions noted in the block may occur out of the order noted in the figures. For example, two blocks shown in succession may, in fact, be executed substantially concurrently, or the blocks may sometimes be executed in the reverse order, depending upon the functionality involved. It will also be noted that each block of the block diagrams or flowchart illustration, and combinations of blocks in the block diagrams or flowchart illustration, can be implemented by special purpose hardware-based systems which perform the specified functions or acts, or combinations of special purpose hardware and computer instructions. Those skilled in the art will appreciate that the features recited in the various embodiments of the disclosure and/or in the claims may be combined in various combinations and/or combinations, even if such combinations or combinations are not explicitly recited in the disclosure. In particular, the features recited in the various embodiments of the present disclosure and/or the claims may be variously combined and/or combined without departing from the spirit and teachings of the present disclosure. All such combinations and/or combinations fall within the scope of the present disclosure.
The embodiments of the present disclosure are described above. However, these examples are for illustrative purposes only and are not intended to limit the scope of the present disclosure. Although the embodiments are described above separately, this does not mean that the measures in the embodiments cannot be used advantageously in combination. The scope of the disclosure is defined by the appended claims and equivalents thereof. Various alternatives and modifications can be made by those skilled in the art without departing from the scope of the disclosure, and such alternatives and modifications are intended to fall within the scope of the disclosure.

Claims (11)

1. A test case processing method, comprising:
acquiring a trigger request for an operation event;
responding to the trigger request, obtaining M operation sets aiming at the operation event, wherein each operation set comprises at least two event nodes, each event node comprises an identifier of an icon and an operation aiming at the icon, and M is more than or equal to 1;
analyzing the M operation sets to obtain N test paths, wherein each test path at least comprises an event node with a node type of starting execution and an event node with a node type of ending execution, and N is more than or equal to 1; and
Generating a test case aiming at the test paths according to each test path in the N test paths;
the analyzing the M operation sets to obtain N test paths includes: analyzing the M operation sets to obtain the N test paths and path weights corresponding to each test path;
the analyzing the M operation sets to obtain N test paths and path weights corresponding to each test path includes: determining the occurrence times of each event node pair in the M operation sets, wherein each event node pair comprises a first event node and a second event node, and the second event node is the next event node of the first event node; determining the N test paths according to the M operation sets; determining each event node pair included in each test path in the N test paths; carrying out weighted summation on the occurrence times of each event node pair to obtain a summation result; and determining the summation result as a path weight corresponding to the test path.
2. The method of claim 1, the method further comprising:
Determining the execution sequence of the test cases according to the path weight corresponding to the test path; and
and executing the test cases according to the execution sequence.
3. The method of claim 1, further comprising:
for each test path in the N test paths, determining a case type to which a test case corresponding to the test path belongs according to an execution type to which an event node included in the test path belongs, wherein the case type comprises a manual test case or an automatic test case.
4. The method of claim 3, wherein the determining, according to the execution type to which the event node included in the test path belongs, a case type to which the test case corresponding to the test path belongs includes:
under the condition that the test path comprises a target node, determining the case type of the test case corresponding to the test path as the manual test case, wherein the target node is used for representing an event node of which the execution type is manually executed;
and under the condition that the test path does not comprise the target node, determining the case type of the test case corresponding to the test path as the automatic test case.
5. The method of claim 1, wherein the determining the N test paths from the M sets of operations comprises:
analyzing the M operation sets to generate a directed graph; and
and determining the N test paths according to the directed graph.
6. The method of claim 2, wherein the determining the order of execution of the test cases according to path weights corresponding to the test paths comprises:
determining the priorities of N test cases according to the N path weights; and
and determining the execution sequence of the N test cases according to the priorities of the N test cases.
7. The method of claim 6, wherein the determining the priorities of the N test cases based on the N path weights comprises:
sorting the N path weights according to the size of the path weights to obtain a sorting result; and
and determining the priority of the N test cases according to the sorting result.
8. The method of claim 7, wherein the ranking the N path weights according to the size of the path weights to obtain a ranking result comprises:
Determining a case type of a test case corresponding to each test path in the N test paths, wherein the case type comprises a manual test case or an automatic test case;
determining a similar case set, wherein the similar case set comprises the same case type of the test cases; and
aiming at each similar case set, sorting path weights corresponding to the similar case sets according to the sizes of the path weights to obtain sorting results;
the determining the priorities of the N test cases according to the sorting result includes:
determining the priority of the test cases included in the similar case set according to the sorting result;
the determining the execution sequence of the N test cases according to the priorities of the N test cases comprises the following steps:
determining the execution sequence of the test cases included in the similar case set according to the priorities of the test cases included in the similar case set;
said executing said test cases according to said execution order, comprising:
and executing the test cases included in the similar case set according to the execution sequence of the test cases included in the similar case set.
9. A test case processing apparatus comprising:
the acquisition module is used for acquiring a trigger request aiming at an operation event;
the response module is used for responding to the trigger request and obtaining M operation sets aiming at the operation event, wherein each operation set comprises at least two event nodes, each event node comprises an icon identifier and an operation aiming at the icon, and M is more than or equal to 1;
the analysis module is used for analyzing the M operation sets to obtain N test paths, wherein each test path at least comprises an event node with a node type of starting execution and an event node with a node type of ending execution, and N is more than or equal to 1; and
the generating module is used for generating a test case aiming at each test path in the N test paths according to each test path in the N test paths;
the analysis module comprises an analysis sub-module which is used for analyzing the M operation sets to obtain the N test paths and path weights corresponding to each test path;
the analysis submodule comprises a first determining unit, a second determining unit, a third determining unit, an obtaining unit and a fourth determining unit; the first determining unit is configured to determine a number of occurrences of each event node pair in the M operation sets, where each event node pair includes a first event node and a second event node, and the second event node is a next event node of the first event node; the second determining unit is configured to determine the N test paths according to the M operation sets; the third determining unit is configured to determine, for each of the N test paths, each of the event node pairs included in the test path; the obtaining unit is used for carrying out weighted summation on the occurrence times of each event node pair to obtain a summation result; and the fourth determining unit is configured to determine the summation result as a path weight corresponding to the test path.
10. An electronic device, comprising:
one or more processors;
a memory for storing one or more programs,
wherein the one or more programs, when executed by the one or more processors, cause the one or more processors to implement the method of any of claims 1-8.
11. A computer readable storage medium having stored thereon executable instructions which when executed by a processor cause the processor to implement the method of any of claims 1 to 8.
CN202110207438.7A 2021-02-24 2021-02-24 Test case processing method, device, electronic equipment and medium Active CN112835804B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202110207438.7A CN112835804B (en) 2021-02-24 2021-02-24 Test case processing method, device, electronic equipment and medium

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202110207438.7A CN112835804B (en) 2021-02-24 2021-02-24 Test case processing method, device, electronic equipment and medium

Publications (2)

Publication Number Publication Date
CN112835804A CN112835804A (en) 2021-05-25
CN112835804B true CN112835804B (en) 2024-02-02

Family

ID=75933210

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202110207438.7A Active CN112835804B (en) 2021-02-24 2021-02-24 Test case processing method, device, electronic equipment and medium

Country Status (1)

Country Link
CN (1) CN112835804B (en)

Citations (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN107301129A (en) * 2017-06-28 2017-10-27 百度在线网络技术(北京)有限公司 Method and apparatus for generating test case
CN112100071A (en) * 2020-09-16 2020-12-18 腾讯科技(深圳)有限公司 Test case generation method and device, computer equipment and storage medium

Family Cites Families (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
IN2014CH01329A (en) * 2014-03-13 2015-09-18 Infosys Ltd

Patent Citations (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN107301129A (en) * 2017-06-28 2017-10-27 百度在线网络技术(北京)有限公司 Method and apparatus for generating test case
CN112100071A (en) * 2020-09-16 2020-12-18 腾讯科技(深圳)有限公司 Test case generation method and device, computer equipment and storage medium

Also Published As

Publication number Publication date
CN112835804A (en) 2021-05-25

Similar Documents

Publication Publication Date Title
US10909028B1 (en) Multi-version regression tester for source code
CN109951547B (en) Transaction request parallel processing method, device, equipment and medium
CN111198813A (en) Interface testing method and device
CN111782988B (en) Method, apparatus, computer system and storage medium for determining source of application program
CN114817050A (en) Task execution method and device, electronic equipment and computer readable storage medium
CN110245684B (en) Data processing method, electronic device, and medium
CN115357761A (en) Link tracking method and device, electronic equipment and storage medium
CN112965916B (en) Page testing method, page testing device, electronic equipment and readable storage medium
CN113191889A (en) Wind control configuration method, configuration system, electronic device and readable storage medium
CN113362173A (en) Anti-duplication mechanism verification method, anti-duplication mechanism verification system, electronic equipment and storage medium
CN110717992B (en) Method, apparatus, computer system and readable storage medium for scheduling model
CN112835804B (en) Test case processing method, device, electronic equipment and medium
CN111930629A (en) Page testing method and device, electronic equipment and storage medium
CN116661936A (en) Page data processing method and device, computer equipment and storage medium
CN112506781B (en) Test monitoring method, device, electronic equipment, storage medium and program product
CN111338928A (en) Chrome-based browser testing method and device
CN113132400B (en) Business processing method, device, computer system and storage medium
CN111859403B (en) Dependency vulnerability determination method and device, electronic equipment and storage medium
CN113918525A (en) Data exchange scheduling method, system, electronic device, medium, and program product
CN115203178A (en) Data quality inspection method and device, electronic equipment and storage medium
CN111131354B (en) Method and apparatus for generating information
CN113626301A (en) Method and device for generating test script
KR20220003625A (en) Performance detection method, apparatus, electronic device, computer readable medium and computer program product
CN112783753B (en) Testing method and device for stream data processing system
CN110825438B (en) Method and device for simulating data processing of artificial intelligence chip

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
GR01 Patent grant
GR01 Patent grant