CN114490408A - Test case generation method, device, equipment, storage medium and product - Google Patents

Test case generation method, device, equipment, storage medium and product Download PDF

Info

Publication number
CN114490408A
CN114490408A CN202210125236.2A CN202210125236A CN114490408A CN 114490408 A CN114490408 A CN 114490408A CN 202210125236 A CN202210125236 A CN 202210125236A CN 114490408 A CN114490408 A CN 114490408A
Authority
CN
China
Prior art keywords
transaction
service
test case
branch
point
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Pending
Application number
CN202210125236.2A
Other languages
Chinese (zh)
Inventor
刘成博
周荣林
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Agricultural Bank of China
Original Assignee
Agricultural Bank of China
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 Agricultural Bank of China filed Critical Agricultural Bank of China
Priority to CN202210125236.2A priority Critical patent/CN114490408A/en
Publication of CN114490408A publication Critical patent/CN114490408A/en
Pending legal-status Critical Current

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F11/00Error detection; Error correction; Monitoring
    • G06F11/36Preventing errors by testing or debugging software
    • G06F11/3668Software testing
    • G06F11/3672Test management
    • G06F11/3684Test management for test design, e.g. generating new test cases

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 invention discloses a test case generation method, a test case generation device, test case generation equipment, a test case storage medium and a test case product. The method comprises the following steps: acquiring operation behavior data information when a set number of users transact online functional services; determining at least one service transaction path corresponding to the online functional service according to the operation behavior data information; and generating a test case for the online functional service test according to each service transaction path. By the technical scheme, the invention realizes that a more comprehensive test case is provided for the on-line functional service during testing, and the influence of the user behaviors of different users on the test case can be considered from multiple aspects.

Description

Test case generation method, device, equipment, storage medium and product
Technical Field
The embodiment of the invention relates to the technical field of computer testing, in particular to a method, a device, equipment, a storage medium and a product for generating a test case.
Background
The software testing method mainly comprises the steps of equivalence class division, boundary value analysis, error speculation, causal graphs, scene methods and the like.
At present, most enterprises adopt a scenario method to test and design, and the scenario method is to test the combined use condition of a plurality of functions by simulating the scenario when a user operates software.
However, the scenario method relies on deep understanding of software business and requirements by testers, and it is difficult to ensure design quality of test cases and conformity of actual business scenarios under the condition that more and more business processes with single software functions are more and more complicated.
Disclosure of Invention
The embodiment of the invention provides a test case generation method, a test case generation device, a test case generation storage medium and a test case generation product, and aims to realize the accuracy and the universality of a test case when an online functional service test is realized.
In a first aspect, an embodiment of the present invention provides a test case generation method, including:
acquiring operation behavior data information when a set number of users transact online functional services;
determining at least one service transaction path corresponding to the online functional service according to the operation behavior data information;
and generating a test case for the online functional service test according to each service transaction path.
In a second aspect, an embodiment of the present invention further provides a test case generating device, where the device includes:
the acquisition module is used for acquiring operation behavior data information when a set number of users transact the online functional service;
the determining module is used for determining at least one service handling path corresponding to the online functional service according to the operation behavior data information;
and the generating module is used for generating a test case for the online functional service test according to each service handling path.
In a third aspect, an embodiment of the present invention further provides an electronic device, where the electronic device includes:
at least one processor; and
a memory communicatively coupled to the at least one processor; wherein the content of the first and second substances,
the memory stores a computer program executable by the at least one processor, and the computer program is executed by the at least one processor to enable the at least one processor to execute the test case generation method according to any embodiment of the present invention.
In a fourth aspect, an embodiment of the present invention further provides a computer-readable storage medium, where the computer-readable storage medium stores computer instructions, and the computer instructions are configured to, when executed, enable a processor to implement the test case generation method according to any embodiment of the present invention.
In a fifth aspect, an embodiment of the present invention further provides a computer program product, where the computer program product includes a computer program, and when the computer program is executed by a processor, the computer program implements the test case generation method according to any embodiment of the present invention.
According to the technical scheme of the embodiment of the invention, the operation behavior data information when a set number of users handle the online functional service is obtained, at least one service handling path corresponding to the online functional service is determined according to each operation behavior data information, and the test case for testing the online functional service is generated according to each service handling path, so that the problem that a test system cannot consider the influence of the user behaviors of different users on the test case from multiple aspects and screen out the service handling paths of the online functional service in a targeted manner is solved, the more comprehensive test case is provided for the online functional service during testing, and the influence of the user behaviors of different users on the test case can be considered from multiple aspects.
It should be understood that the statements in this section do not necessarily identify key or critical features of the embodiments of the present invention, nor do they necessarily limit the scope of the invention. Other features of the present invention will become apparent from the following description.
Drawings
In order to more clearly illustrate the technical solutions in the embodiments of the present invention, the drawings needed to be used in the description of the embodiments will be briefly introduced below, and it is obvious that the drawings in the following description are only some embodiments of the present invention, and it is obvious for those skilled in the art to obtain other drawings based on these drawings without creative efforts.
FIG. 1 is a flowchart of a test case generation method according to an embodiment of the present invention;
FIG. 2 is a flowchart of a test case generation method according to a second embodiment of the present invention;
FIG. 3 is a flowchart of a method for building a business handling tree according to a second embodiment of the present invention;
FIG. 4 is a diagram of a service handling tree according to a second embodiment of the present invention;
fig. 5 is a schematic structural diagram of a test case generating apparatus according to a third embodiment of the present invention;
fig. 6 is a schematic structural diagram of an electronic device according to a fourth embodiment of the present invention.
Detailed Description
The present invention will be described in further detail with reference to the accompanying drawings and examples. It is to be understood that the specific embodiments described herein are merely illustrative of the invention and are not limiting of the invention. It should be further noted that, for the convenience of description, only some of the structures related to the present invention are shown in the drawings, not all of the structures.
Example one
Fig. 1 is a flowchart of a test case generation method according to an embodiment of the present invention, where this embodiment is applicable to a case where a required test case is generated when a functional application of a client-oriented software system is tested, and the method may be executed by a test case generation apparatus according to an embodiment of the present invention, where the apparatus may be implemented in a software and/or hardware manner and is generally integrated in a computer device, where the computer device may be a mobile terminal or a server. The client-oriented software system can be regarded as a type of software system with a client as an operation subject, the client can implement online business handling by operating the client-oriented software system, and the client-oriented software system can record the operation behavior of the client and provide business services.
It should be noted that, in the prior art, there is a scheme for testing a software system, which generates a test case by obtaining a behavior of a user, but does not analyze all possible transaction links of the software system, and since it only focuses on the related operations of a single user, it is not possible to consider the influence of user behaviors of different users on the test case from multiple aspects, and it is also not possible to screen out a service transaction path of an online functional service in a targeted manner.
In order to solve the above problem, an embodiment of the present invention provides a test case generation method, so as to consider the accuracy and the universality of a test case.
As shown in fig. 1, the method specifically includes the following steps:
and S110, acquiring operation behavior data information when a set number of users transact the online functional service.
The online functional service can be regarded as one functional service in a client-oriented software system, and for the client-oriented software system facing the banking service, the online functional services of deposit, withdrawal, transfer, inquiry and the like can be integrated for the user to handle the banking service online.
For the user, the user can transact the corresponding online functional service by installing the application software client on the corresponding terminal. In this embodiment, the operation behavior data information of the user when transacting the online functional service may be collected in a point burying manner, and in order to better generate the test case of the online functional service, the operation behavior data information of a certain number of users needs to be collected in this embodiment. The operation behavior data information of the user may include: user identification, access time, access page, access interface, transaction return state and other data information. Meanwhile, the operation behavior data information obtained by the embodiment may be stored in the execution device in association with the relevant user.
And S120, determining at least one service handling path corresponding to the on-line functional service according to the operation behavior data information.
The service transaction path may be understood as a service path through which a user passes when transacting an online functional service. In this embodiment, after obtaining the operation behavior data information of a plurality of users, the data information is sorted, different users can be distinguished according to the user identifiers, different users correspond to different service transaction paths, and then the service transaction condition of the user on the timeline can be obtained according to the access time corresponding to the user access page. Although one user corresponds to one service transaction path, the same path can correspond to a plurality of different users, so that the service transaction paths corresponding to all the users need to be summarized, repeated paths are removed, and at least one service transaction path corresponding to the on-line functional service is obtained.
For a user, the user only needs to operate at an application software client according to the self service handling needs, when the service is switched from one service to another service, the service is changed, the client records the current user identification, access time, access page, access interface, transaction return state and the like of the user, the operation behavior data information of each user is stored in an execution device, all users handling the online functional service are obtained by searching the users handling the online functional service in the operation behavior data information, then the service handling paths of the users are called, and the repeated paths are removed, so that at least one service handling path corresponding to the online functional service is obtained.
And S130, generating a test case for the online functional service test according to each service handling path.
The test case of the on-line functional service test can be regarded as a service handling path information of the on-line functional service, and the operation behavior data information of each user handling the on-line functional service can be regarded as the test case of the on-line functional service test. However, there may be multiple service transaction paths corresponding to the online functional service, and the same service transaction path may correspond to multiple different users, so that the operation behavior data information of one user needs to be selected from all users that conform to the service transaction path, and used as the test case. As mentioned above, the application software client may obtain all users transacting the online functional service by searching the user transacting the online functional service included in the operation behavior data information, and then generate at least one service transaction path corresponding to the online functional service. Then, similarly, the application software client may also find all users under a certain service handling path in reverse, and obtain operation behavior data information of one of the users as a test case for functional service testing under the service handling path line.
According to the technical scheme of the embodiment, the operation behavior data information when a set number of users handle the online functional service is obtained, at least one service handling path corresponding to the online functional service is determined according to the operation behavior data information, and finally, the test case for testing the online functional service is generated according to each service handling path. The method and the device can generate a plurality of handling paths, can generate corresponding test cases corresponding to the plurality of handling paths, realize that more comprehensive test cases are provided for on-line functional services during testing, and can consider the influence of user behaviors of different users on the test cases from multiple aspects.
Example two
Fig. 2 is a flowchart illustrating a test case generating method according to a second embodiment of the present invention, which is further optimized based on the first embodiment. As shown in fig. 2, the test case generation method provided in this embodiment specifically includes the following steps:
s210, acquiring operation behavior data information when a set number of users transact the online functional service.
Illustratively, a certain number of users are selected, and then the operation of the certain number of users when handling a service is monitored, so as to obtain the operation behavior data information of the certain number of users when handling a service.
S220, searching the transaction point association table, and acquiring a service transaction point set corresponding to the online functional service transaction.
Optionally, the service transaction point set includes: a transaction starting point, a key transaction point, a mandatory transaction point, an optional transaction point, and a transaction ending point of the online functional service.
The transaction point association table can be understood as the integration of the service transaction points of all functional services in the software system, and when a developer designs the software system, a plurality of functional services are predefined, preprocessed and associated information is collected and integrated to form the transaction point association table. In the process of collecting and integrating the associated information, pages except a key transaction point and a transaction end point in an actual transaction link of a user are defaulted to be unnecessary access points, a necessary page in the actual transaction link of the user is set to be the necessary transaction point, the necessary access points may be several necessary pages in the transaction, the key transaction points also belong to the necessary transaction points, but the key transaction point must be unique in the transaction, and in order to ensure the uniqueness of the key transaction point, the key transaction point needs to be ensured to be one step which is farthest from a completion page in all the necessary access points of a transaction path, namely the necessary access point which is closest to an entrance of the transaction path, so that the first necessary page in the transaction process can be taken as the key transaction point, and the transaction end point can also be set in advance by setting the transaction completion page.
The transaction point association table may include two columns of information, one column being the functional service name and the other column being the set of service transaction points corresponding to the functional service name. In this embodiment, by querying the transaction point association table, a service transaction point set corresponding to the online functional service transaction can be obtained. In addition, the software system can screen and label each functional service, can obtain the transaction points associated with the functional service through screening, can obtain the attributes of each transaction point through labeling, and distinguish whether different transaction points belong to the transaction starting point, the key transaction point, the necessary transaction point, the unnecessary transaction point or the transaction end point of the functional service.
And S230, constructing a service handling tree of the online functional service by combining the service handling point sets according to the operation behavior data information.
The service transaction tree of the online functional service can be understood as that a service transaction point of the online functional service is constructed in a branch tree form. The branch tree is composed of nodes and branches, each node corresponds to one service handling point of the online functional service, the last service handling point of one service handling point is used as one branch of the node, and if one service handling point does not have the last service handling point, the corresponding node has no branch.
In this embodiment, after the operation behavior data information and the service transaction point set are obtained when the online function service is obtained, the last service transaction point of each service transaction point is obtained, and a service transaction tree is constructed.
Exemplarily, fig. 3 is a flowchart of a method for building a service handling tree according to a second embodiment of the present invention. According to the data information of each operation behavior, a service handling tree of the online functional service is constructed by combining the service handling point sets, and the method comprises the following steps:
s2301, selecting a transaction end point in the service transaction point set as a root node, and taking the root node as a current node.
The root node is unique, that is, the transaction end point in the transaction point set, and the current node is not fixed, and can be understood as a node corresponding to the current service transaction point, and the last service transaction point of the current service transaction point is taken as a branch of the current node, so as to establish a first step of a service transaction tree, and the root node is taken as the current node, and all the last service transaction points of the transaction end point are searched.
S2302, traversing the operation behavior data information, determining candidate transaction nodes pre-associated with the current node, and determining the branch weight of a branch formed by the connection of the current node and the candidate transaction nodes.
Each candidate transaction node which is pre-associated with the current node may be understood as a branch node of the current node, or may be considered as a node corresponding to a previous service transaction point of the current service transaction node, each candidate transaction node is used as a branch of the current node, the current node may have one or more branches, or may not have a branch, and the branch weight refers to a percentage of the number of users corresponding to each candidate transaction node in the number of users of the current node.
After traversing each operation behavior data message, the embodiment determines each candidate transaction node pre-associated with the current node, and determines the branch weight of each candidate transaction node.
Further, traversing each operation behavior data information, determining each candidate transaction node pre-associated with the current node, and determining the branch weight of the branch formed by the connection of the current node and each candidate transaction node, includes:
traversing each operation behavior data message, and determining a transaction node corresponding to a previous hop of a current node when each user transacts business as a candidate transaction node;
and counting the number of users corresponding to each candidate transaction node, and taking the ratio of the number of the users to the set number as the branch weight of the branch formed by connecting the corresponding candidate transaction node with the current node.
S2303, judging whether a new candidate transaction node is determined, if so, executing S2304; if not, go to S2305.
It should be noted that after determining each candidate transaction node of the current node, it is necessary to determine whether to determine a new candidate transaction node, and if a new candidate transaction node exists, each candidate transaction node is respectively used as a new current node; and if no new candidate transaction node exists, constructing a service transaction tree of the online functional service based on each node and branch.
S2304, the candidate transacted nodes are respectively set as new current nodes, and the process returns to S2302.
And when judging that a new candidate transacted node exists, taking each candidate transacted node as a new current node, judging whether the new current node has a candidate transacted node again, returning to the step of S2302 until the new candidate transacted node does not exist, ending the loop, and jumping to the step of S2305.
S2305, based on each node and branch, forming a service handling tree of the online functional service.
And when judging that no new candidate transaction node exists, constructing a service transaction tree of the online functional service based on each node and branch.
It can be understood that, after the service transaction point set is constructed, in this embodiment, a transaction end point in the service transaction point set is used as a root node, the root node is used as a current node to perform backtracking, each operation behavior data information in the memory is traversed, all previous nodes of the transaction end point are searched, all previous nodes are used as each branch node of the root node, then, the proportion of the user number of each branch node in the current node is calculated, and the percentage of the user number of each branch node to the total number of the users of the current node is used as the branch weight of each branch node. Then, each node in the branch nodes is respectively used as a new current node, each previous node corresponding to the current node is searched, each previous node is used as a new branch node, and the respective percentage of each new branch node in the new current node is calculated and used as the weight of each new branch node. And repeating the operation until the determined candidate transaction nodes are empty, generating a service transaction tree of the online functional service, and obtaining the branch proportion of each branch node to the previous node.
Fig. 4 is a schematic diagram of a service transaction tree according to a second embodiment of the present invention, taking the service transaction tree diagram provided in fig. 4 as an example, a previous node of the transaction end node E is an unnecessary transaction point N1 and an unnecessary transaction point N2, and the sum of the numbers of users of the unnecessary transaction points N1 and N2 is the number of users of the transaction end node E, where the branch weight occupied by the unnecessary transaction point N1 is 85%, and the branch weight occupied by the unnecessary transaction point N2 is 15%.
S240, according to the branch weight of each branch on the service handling tree, determining a service handling key path and a service handling exploration path.
Exemplarily, determining a service handling critical path and a service handling exploration path according to the branch weight of each branch in the service handling tree includes:
determining branch labels of all branches according to the branch weights of all branches on the business handling tree and combining label determination conditions;
traversing the service handling tree, searching the branch labels as key labels, and forming at least one service handling key path by each branch passing through the key handling point;
and traversing the service handling tree, searching the branch labels as the exploration labels, and forming at least one service handling exploration path by each branch passing through the key handling point.
The service handling critical path refers to a path where the service handling path is a critical handling point and labels of nodes on the path are critical. The process of exploring the path refers to that a business processes the path to a key processing point and a path with a label of exploring exists on the path. Counting is carried out from the root node, branch nodes with the branch weight exceeding 80% in each branch are marked as keys, and if no branch exceeding 80% appears in a certain layer, the highest branch node and the next highest branch node are selected according to the sequence from high to low in percentage and are marked as keys. Counting from the root node, marking the branch nodes with the branch weight not more than 20% in each branch as exploration, and if the branches with the branch weight more than 20% in a certain layer appear, marking the branch node with the lowest occupation ratio as exploration. There may be cases where the labels of some nodes are both key labels and probe labels.
It can be understood that, in this embodiment, after the service handling tree is constructed, according to the branch weight of each branch on the service handling tree, each branch node is labeled, a path that passes through a key handling point and has a label on each node on the path as a key path for service handling is taken as a service handling search path, and a path that passes through the key handling point and has a label on the path as a search path for service handling is taken as a path for service handling search.
Taking the service processing tree diagram provided in fig. 4 as an example (part of labels are not shown), the branch node of the unnecessary processing point N1 is not required to be processed by the processing point N3 and the key processing point K, the branch weight of the unnecessary processing point N3 is 40%, the branch weight of the key processing point K is 60%, in the current branch layer, although the branch weight does not exceed 80% or 20%, the highest and next highest branch nodes are selected according to the order of the percentage from high to low, the unnecessary processing point N3 and the key processing point K are marked as keys, the branch node with the lowest percentage is taken and the unnecessary processing point N3 is marked as exploration.
And S250, generating a regression flow test case for the online functional service test according to each service transaction key path, and/or generating an exploration flow test case for the online functional service test according to each service transaction exploration path.
After determining the service handling critical path and the service handling exploration path, the embodiment acquires one of the critical paths as a regression flow test case of the online functional service test, and acquires one of the exploration paths as an exploration flow test case of the online functional service test.
Taking the business transaction tree diagram provided in fig. 4 as an example, the transaction starting point S1/S3 → the key transaction point K → the optional transaction point N1 → the transaction ending point E are regression flow test cases, and the transaction starting point S2 → the key transaction point K → the optional transaction point N1 → the transaction ending point E are exploration flow test cases. And taking the test cases under the other paths as waste test cases.
The embodiment of the invention acquires the operation behavior data information when a set number of users handle the on-line functional service, determines at least one service handling path corresponding to the on-line functional service according to the operation behavior data information, and finally generates the test case for testing the on-line functional service according to the service handling paths. According to the method and the device, the generation of the user behavior test case is processed in a differentiated mode, the necessary degree of each operation point is distinguished obviously, and detailed steps are provided for screening the link points. The invention takes the effective path collected by the user behavior as the analysis basis, can still adopt the method to generate a new key path set after the transaction path is modified by changing the software system version, and has more credibility compared with the experience definition by taking the production data as the support. The invention can effectively eliminate the noise data generated by the misoperation of the user under the condition of large data volume by taking the effective path of the user behavior acquisition as the analysis basis. The forward and reverse regression cases and the exploration cases are manually covered through the combed transaction paths, the regression cases generated by the key paths are still used as the main cases in normal tests, and the exploration cases can be selectively covered according to the situations. The significance of exploring paths and cases is mainly two: firstly, the test team is helped to fully cover the test scene, and the tester knows the transaction paths of a few customers, so that the design of test cases in the future is facilitated. Meanwhile, the exploration of the paths and the cases can help business personnel to know the transaction paths of all customers more, and certain reference and help are provided in the optimization of transaction requirements of a product manager.
EXAMPLE III
Fig. 5 is a schematic structural diagram of a test case generation apparatus according to an embodiment of the present invention. The embodiment may be applicable to a case of generating a required test case when testing a functional application of a client-oriented software system, where the apparatus may be implemented in a software and/or hardware manner, and the apparatus may be integrated in any device providing a function of generating a test case, as shown in fig. 5, where the apparatus for generating a test case specifically includes:
an obtaining module 310, configured to obtain operation behavior data information when a set number of users transact online functional services;
a determining module 320, configured to determine at least one service transaction path corresponding to the online functional service according to each operation behavior data information;
the generating module 330 is configured to generate a test case for the online functional service test according to each service transaction path.
Optionally, the determining module 320 may specifically include:
the system comprises an acquisition unit, a processing unit and a processing unit, wherein the acquisition unit is used for searching a processing point association table and acquiring a service processing point set corresponding to the on-line functional service processing;
the building unit is used for building a service handling tree of the on-line functional service by combining the service handling point set according to the operation behavior data information;
and the determining unit is used for determining the business handling key path and the business handling exploration path according to the branch weight of each branch on the business handling tree.
Optionally, the building unit may specifically include:
the sub-unit is used for selecting a transaction end point in the service transaction point set as a root node and taking the root node as a current node;
the determining subunit is used for traversing the data information of each operation behavior, determining each candidate transaction node which is pre-associated with the current node, and determining the branch weight of a branch formed by the connection of the current node and each candidate transaction node;
and taking each candidate transaction node as a new current node, and returning to continuously execute the determination operation of the candidate transaction nodes and the branch weights until the determined candidate transaction nodes generate the service transaction tree of the online functional service for the vacancy.
Optionally, the determining subunit may be specifically configured to:
traversing each operation behavior data message, and determining a transaction node corresponding to a previous hop of a current node when each user transacts business as a candidate transaction node;
and counting the number of users corresponding to each candidate transaction node, and taking the ratio of the number of the users to the set number as the branch weight of the branch formed by connecting the corresponding candidate transaction node with the current node.
Optionally, the determining unit is further specifically configured to:
determining branch labels of all branches according to the branch weights of all branches on the business handling tree and combining label determination conditions;
traversing the service handling tree, searching the branch labels as key labels, and forming at least one service handling key path by each branch passing through the key handling point;
and traversing the service handling tree, searching the branch labels as the exploration labels, and forming at least one service handling exploration path by each branch passing through the key handling point.
Optionally, the generating module 330 is specifically configured to:
generating a regression flow test case for testing the on-line functional service according to each service handling critical path; and/or the presence of a gas in the gas,
and generating an exploration flow test case for the online functional service test according to each service transaction exploration path.
The product can execute the method provided by any embodiment of the invention, and has corresponding functional modules and beneficial effects of the execution method.
The embodiment of the invention obtains the operation behavior data information when a set number of users handle the online functional service, determines at least one service handling path corresponding to the online functional service according to each operation behavior data information, and generates the test case for testing the online functional service according to each service handling path, thereby realizing providing more comprehensive test cases for the online functional service during testing, and being capable of considering the influence of the user behaviors of different users on the test case from multiple aspects.
Example four
FIG. 6 illustrates a schematic structural diagram of an electronic device 10 that may be used to implement an embodiment of the present invention. Electronic devices are intended to represent various forms of digital computers, such as laptops, desktops, workstations, personal digital assistants, servers, blade servers, mainframes, and other appropriate computers. The electronic device may also represent various forms of mobile devices, such as personal digital assistants, cellular phones, smart phones, wearable devices (e.g., helmets, glasses, watches, etc.), and other similar computing devices. The components shown herein, their connections and relationships, and their functions, are meant to be exemplary only, and are not meant to limit implementations of the inventions described and/or claimed herein.
As shown in fig. 6, the electronic device 10 includes at least one processor 11, and a memory communicatively connected to the at least one processor 11, such as a Read Only Memory (ROM)12, a Random Access Memory (RAM)13, and the like, wherein the memory stores a computer program executable by the at least one processor, and the processor 11 can perform various suitable actions and processes according to the computer program stored in the Read Only Memory (ROM)12 or the computer program loaded from a storage unit 18 into the Random Access Memory (RAM) 13. In the RAM 13, various programs and data necessary for the operation of the electronic apparatus 10 can also be stored. The processor 11, the ROM 12, and the RAM 13 are connected to each other via a bus 14. An input/output (I/O) interface 15 is also connected to bus 14.
A number of components in the electronic device 10 are connected to the I/O interface 15, including: an input unit 16 such as a keyboard, a mouse, or the like; an output unit 17 such as various types of displays, speakers, and the like; a storage unit 18 such as a magnetic disk, optical disk, or the like; and a communication unit 19 such as a network card, modem, wireless communication transceiver, etc. The communication unit 19 allows the electronic device 10 to exchange information/data with other devices via a computer network such as the internet and/or various telecommunication networks.
Processor 11 may be a variety of general and/or special purpose processing components having processing and computing capabilities. Some examples of processor 11 include, but are not limited to, a Central Processing Unit (CPU), a Graphics Processing Unit (GPU), various specialized Artificial Intelligence (AI) computing chips, various processors running machine learning model algorithms, a Digital Signal Processor (DSP), and any suitable processor, controller, microcontroller, or the like. The processor 11 executes the above-described methods and processes, for example, to implement the test case generation method provided by the above-described embodiment of the present invention:
acquiring operation behavior data information when a set number of users transact online functional services;
determining at least one service handling path corresponding to the on-line functional service according to the operation behavior data information;
and generating a test case for the online functional service test according to each service transaction path.
In some embodiments, the test case generation method may be implemented as a computer program tangibly embodied in a computer-readable storage medium, such as storage unit 18. In some embodiments, part or all of the computer program may be loaded and/or installed onto the electronic device 10 via the ROM 12 and/or the communication unit 19. When the computer program is loaded into RAM 13 and executed by processor 11, one or more steps of the test case generation method described above may be performed. Alternatively, in other embodiments, the processor 11 may be configured to perform the test case generation method by any other suitable means (e.g., by means of firmware).
Various implementations of the systems and techniques described here above may be implemented in digital electronic circuitry, integrated circuitry, Field Programmable Gate Arrays (FPGAs), Application Specific Integrated Circuits (ASICs), Application Specific Standard Products (ASSPs), system on a chip (SOCs), load programmable logic devices (CPLDs), computer hardware, firmware, software, and/or combinations thereof. These various embodiments may include: implemented in one or more computer programs that are executable and/or interpretable on a programmable system including at least one programmable processor, which may be special or general purpose, receiving data and instructions from, and transmitting data and instructions to, a storage system, at least one input device, and at least one output device.
A computer program for implementing the methods of the present invention may be written in any combination of one or more programming languages. These computer programs may be provided to a processor of a general purpose computer, special purpose computer, or other programmable data processing apparatus, such that the computer programs, when executed by the processor, cause the functions/acts specified in the flowchart and/or block diagram block or blocks to be performed. A computer program can execute entirely on a machine, partly on a machine, as a stand-alone software package partly on a machine and partly on a remote machine or entirely on a remote machine or server.
In the context of the present invention, a computer-readable storage medium may be a tangible medium that can contain, or store a computer program for use by or in connection with an instruction execution system, apparatus, or device. A computer readable storage medium may include, but is not limited to, an electronic, magnetic, optical, electromagnetic, infrared, or semiconductor system, apparatus, or device, or any suitable combination of the foregoing. Alternatively, the computer readable storage medium may be a machine readable signal medium. More specific examples of a machine-readable storage medium would include an electrical connection based on one or more wires, a portable computer diskette, a hard disk, a Random Access Memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM or flash memory), an optical fiber, a portable compact disc read-only memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination of the foregoing.
To provide for interaction with a user, the systems and techniques described here can be implemented on an electronic device having: a display device (e.g., a CRT (cathode ray tube) or LCD (liquid crystal display) monitor) for displaying information to a user; and a keyboard and a pointing device (e.g., a mouse or a trackball) by which a user can provide input to the electronic device. Other kinds of devices may also be used to provide for interaction with a user; for example, feedback provided to the user can be any form of sensory feedback (e.g., visual feedback, auditory feedback, or tactile feedback); and input from the user may be received in any form, including acoustic, speech, or tactile input.
The systems and techniques described here can be implemented in a computing system that includes a back-end component (e.g., as a data server), or that includes a middleware component (e.g., an application server), or that includes a front-end component (e.g., a user computer having a graphical user interface or a web browser through which a user can interact with an implementation of the systems and techniques described here), or any combination of such back-end, middleware, or front-end components. The components of the system can be interconnected by any form or medium of digital data communication (e.g., a communication network). Examples of communication networks include: local Area Networks (LANs), Wide Area Networks (WANs), blockchain networks, and the internet.
The computing system may include clients and servers. A client and server are generally remote from each other and typically interact through a communication network. The relationship of client and server arises by virtue of computer programs running on the respective computers and having a client-server relationship to each other. The server can be a cloud server, also called a cloud computing server or a cloud host, and is a host product in a cloud computing service system, so that the defects of high management difficulty and weak service expansibility in the traditional physical host and VPS service are overcome.
It should be understood that various forms of the flows shown above may be used, with steps reordered, added, or deleted. For example, the steps described in the present invention may be executed in parallel, sequentially, or in different orders, and are not limited herein as long as the desired results of the technical solution of the present invention can be achieved.
The above-described embodiments should not be construed as limiting the scope of the invention. It should be understood by those skilled in the art that various modifications, combinations, sub-combinations and substitutions may be made in accordance with design requirements and other factors. Any modification, equivalent replacement, and improvement made within the spirit and principle of the present invention should be included in the protection scope of the present invention.

Claims (11)

1. A test case generation method is characterized by comprising the following steps:
acquiring operation behavior data information when a set number of users transact online functional services;
determining at least one service handling path corresponding to the online functional service according to the operation behavior data information;
and generating a test case for the online functional service test according to each service transaction path.
2. The method according to claim 1, wherein the determining at least one service transaction path corresponding to the online functional service according to each piece of operation behavior data information includes:
searching a transaction point association table, and acquiring a service transaction point set corresponding to the online functional service transaction;
according to the operation behavior data information, building a service handling tree of the online functional service by combining the service handling point set;
and determining a business handling key path and a business handling exploration path according to the branch weight of each branch on the business handling tree.
3. The method of claim 2, wherein the set of transaction points includes a transaction start point, a key transaction point, a must-go transaction point, an must-go transaction point, and an end transaction point for the online functionality transaction;
the key transaction point is a first compulsory transaction point, and the transaction starting point is an unnecessary transaction point connected with the key transaction point.
4. The method according to claim 2, wherein the building a service transaction tree of the online functional service according to each of the pieces of operational behavior data information and the set of service transaction points includes:
selecting a transaction end point in the service transaction point set as a root node, and taking the root node as a current node;
traversing each piece of operation behavior data information, determining each candidate transaction node which is pre-associated with the current node, and determining the branch weight of a branch formed by the connection of the current node and each candidate transaction node;
and taking each candidate transaction node as a new current node, and returning to continuously execute the determination operation of the candidate transaction nodes and the branch weights until the determined candidate transaction nodes are empty to generate the service transaction tree of the online functional service.
5. The method of claim 4, wherein traversing each of the operational behavior data messages, determining candidate transaction nodes that are pre-associated with the current node, and determining branch weights for branches formed by the current node connecting each of the candidate transaction nodes comprises:
traversing each operation behavior data message, and determining a transaction node corresponding to a previous hop of the current node when each user transacts business as a candidate transaction node;
and counting the number of users corresponding to each candidate transaction node, and taking the ratio of the number of the users to the set number as the branch weight of a branch formed by connecting the corresponding candidate transaction node with the current node.
6. The method of claim 2, wherein determining a business transaction critical path and a business transaction exploration path according to branch weights of branches of the business transaction tree comprises:
determining branch labels of the branches according to the branch weights of the branches on the service handling tree and by combining label determination conditions;
traversing the service handling tree, searching branch labels as key labels, and forming at least one service handling key path by each branch passing through a key handling point;
and traversing the service handling tree, searching the branch labels as the exploration labels, and forming at least one service handling exploration path by each branch passing through the key handling point.
7. The method of claim 2, wherein generating a test case for the online functional business test according to each business transaction path comprises:
generating a regression flow test case for the online functional service test according to each service handling critical path; and/or the presence of a gas in the gas,
and generating an exploration flow test case for the online functional service test according to each service transaction exploration path.
8. A test case generation apparatus, comprising:
the acquisition module is used for acquiring operation behavior data information when a set number of users transact the online functional service;
the determining module is used for determining at least one service handling path corresponding to the online functional service according to the operation behavior data information;
and the generating module is used for generating a test case for the online functional service test according to each service handling path.
9. An electronic device, characterized in that the electronic device comprises:
at least one processor; and
a memory communicatively coupled to the at least one processor; wherein the content of the first and second substances,
the memory stores a computer program executable by the at least one processor to enable the at least one processor to perform the test case generation method of any of claims 1-8.
10. A computer-readable storage medium storing computer instructions for causing a processor to implement the test case generation method of any one of claims 1-8 when executed.
11. A computer program product, characterized in that the computer program product comprises a computer program which, when being executed by a processor, implements the test case generation method according to any one of claims 1-8.
CN202210125236.2A 2022-02-10 2022-02-10 Test case generation method, device, equipment, storage medium and product Pending CN114490408A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202210125236.2A CN114490408A (en) 2022-02-10 2022-02-10 Test case generation method, device, equipment, storage medium and product

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202210125236.2A CN114490408A (en) 2022-02-10 2022-02-10 Test case generation method, device, equipment, storage medium and product

Publications (1)

Publication Number Publication Date
CN114490408A true CN114490408A (en) 2022-05-13

Family

ID=81478334

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202210125236.2A Pending CN114490408A (en) 2022-02-10 2022-02-10 Test case generation method, device, equipment, storage medium and product

Country Status (1)

Country Link
CN (1) CN114490408A (en)

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN115269437A (en) * 2022-08-24 2022-11-01 上海复深蓝软件股份有限公司 Test case recommendation method and device, computer equipment and storage medium

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN115269437A (en) * 2022-08-24 2022-11-01 上海复深蓝软件股份有限公司 Test case recommendation method and device, computer equipment and storage medium

Similar Documents

Publication Publication Date Title
CN115099175B (en) Method and device for acquiring time sequence netlist, electronic equipment and storage medium
CN114461644A (en) Data acquisition method and device, electronic equipment and storage medium
CN113220573B (en) Test method and device for micro-service architecture and electronic equipment
CN114490408A (en) Test case generation method, device, equipment, storage medium and product
CN115048352B (en) Log field extraction method, device, equipment and storage medium
CN116431505A (en) Regression testing method and device, electronic equipment, storage medium and product
CN116303013A (en) Source code analysis method, device, electronic equipment and storage medium
CN114693116A (en) Method and device for detecting code review validity and electronic equipment
CN115576827A (en) Performance test method, device, equipment and storage medium of business process software
CN115687406A (en) Sampling method, device and equipment of call chain data and storage medium
CN115599687A (en) Method, device, equipment and medium for determining software test scene
CN116016686A (en) Method and device for determining node to be optimized, electronic equipment and medium
CN115599679A (en) Test rule base updating method and device, electronic equipment and storage medium
CN114443493A (en) Test case generation method and device, electronic equipment and storage medium
CN116070601B (en) Data splicing method and device, electronic equipment and storage medium
CN116882724B (en) Method, device, equipment and medium for generating business process optimization scheme
CN113836291B (en) Data processing method, device, equipment and storage medium
CN115374010A (en) Function testing method, device, equipment and storage medium
CN115437955A (en) Project testing method, device, equipment and storage medium
CN117632748A (en) Method and device for determining smoke emission test case, electronic equipment and storage medium
CN118396744A (en) Transaction flow matching method, device, equipment and storage medium
CN117422412A (en) Project management method, device, equipment and storage medium
CN115934550A (en) Test method, test device, electronic equipment and storage medium
CN115600819A (en) Risk assessment method and device, electronic equipment and storage medium
CN116185818A (en) Code testing method and device, electronic equipment and storage medium

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination