CN117112424A - Method, device, equipment, medium and product for generating test case - Google Patents

Method, device, equipment, medium and product for generating test case Download PDF

Info

Publication number
CN117112424A
CN117112424A CN202311092513.5A CN202311092513A CN117112424A CN 117112424 A CN117112424 A CN 117112424A CN 202311092513 A CN202311092513 A CN 202311092513A CN 117112424 A CN117112424 A CN 117112424A
Authority
CN
China
Prior art keywords
node
test
flow chart
target
flow
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
CN202311092513.5A
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.)
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 CN202311092513.5A priority Critical patent/CN117112424A/en
Publication of CN117112424A publication Critical patent/CN117112424A/en
Pending legal-status Critical Current

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
    • YGENERAL TAGGING OF NEW TECHNOLOGICAL DEVELOPMENTS; GENERAL TAGGING OF CROSS-SECTIONAL TECHNOLOGIES SPANNING OVER SEVERAL SECTIONS OF THE IPC; TECHNICAL SUBJECTS COVERED BY FORMER USPC CROSS-REFERENCE ART COLLECTIONS [XRACs] AND DIGESTS
    • Y02TECHNOLOGIES OR APPLICATIONS FOR MITIGATION OR ADAPTATION AGAINST CLIMATE CHANGE
    • Y02PCLIMATE CHANGE MITIGATION TECHNOLOGIES IN THE PRODUCTION OR PROCESSING OF GOODS
    • Y02P90/00Enabling technologies with a potential contribution to greenhouse gas [GHG] emissions mitigation
    • Y02P90/30Computing systems specially adapted for manufacturing

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 application provides a method, a device, computer equipment, a storage medium and a computer program product for generating test cases, which can be used in the software testing field, the financial science and technology field or other related fields; the method comprises the following steps: acquiring a target flow chart corresponding to a target service; carrying out path analysis on the target flow chart to obtain at least one test path; acquiring test data corresponding to each test path, and performing node maintenance on target flow nodes on each test path based on each test data; the target flow node is a flow node except a start node and an end node in the test path; and generating test cases corresponding to the test paths based on the target flow nodes after node maintenance. The application can reduce the workload of the test case and the test script of the manual design flow and improve the design efficiency and the accuracy of the test case.

Description

Method, device, equipment, medium and product for generating test case
Technical Field
The present application relates to the field of software testing, and in particular, to a method, an apparatus, a computer device, and a computer program product for generating a test case.
Background
In the process of designing the flow class test cases, the design cases are often carried out according to the service scene graph and the page flow graph of the related service, when the test is designed, a tester selects a method of manually traversing paths to carry out the case design, the traversing paths of the flow graph are often very many, manual combing is easy to miss, accuracy is insufficient, and efficiency is low.
Disclosure of Invention
In view of the foregoing, it is desirable to provide a method, an apparatus, a computer device, a computer-readable storage medium, and a computer program product for generating test cases that can improve the design efficiency and accuracy of the test cases.
In a first aspect, the present application provides a method for generating a test case, where the method includes:
acquiring a target flow chart corresponding to a target service;
carrying out path analysis on the target flow chart to obtain at least one test path;
acquiring test data corresponding to each test path, and performing node maintenance on target flow nodes on each test path based on each test data;
the target flow node is a flow node except a start node and an end node in the test path;
And generating test cases corresponding to the test paths based on the target flow nodes after node maintenance.
In one embodiment, performing path analysis on the target flowchart to obtain at least one test path, including:
acquiring a target analysis mode;
according to a target analysis mode, carrying out path analysis on the target flow chart to obtain at least one test path;
wherein the analysis mode comprises at least one of the following: full flow mode, full path mode, non-full flow mode, basic path mode.
In one embodiment, before obtaining the target flowchart corresponding to the target service, the method further includes:
constructing at least one initial node of the target service association;
performing parameter maintenance on node parameters of the initial nodes, and performing role maintenance on role objects corresponding to the initial nodes to obtain flow nodes of the initial nodes in an initial flow chart of the target service;
drawing the initial flow chart based on each flow node;
and checking the initial flow chart, and taking the initial flow chart passing the checking as a target flow chart of the target service.
In one embodiment, drawing the initial flow chart based on each of the flow nodes includes:
determining the node type of each flow node in the initial flow chart and the association relation among the flow nodes;
and connecting each flow node according to the node type and each association relation to obtain the initial flow chart.
In one embodiment, verifying the initial flow chart includes:
acquiring a preset verification mode;
and verifying the node parameters of each flow node and the association relation between at least two flow nodes in the initial flow chart in the preset verification mode.
In one embodiment, performing node maintenance on the target flow node on each test path based on each test data includes:
based on the test data, filling data into node parameters of a target flow node on the test path;
and determining at least one functional page associated with the test path in the target service based on the test data.
In a second aspect, the present application further provides a device for generating a test case, where the device includes:
The acquisition module is used for acquiring a target flow chart corresponding to the target service;
the analysis module is used for carrying out path analysis on the target flow chart to obtain at least one test path;
the maintenance module is used for acquiring test data corresponding to each test path and carrying out node maintenance on the target flow node on each test path based on each test data;
the target flow node is a flow node except a start node and an end node in the test path;
the generating module is used for generating test cases corresponding to the test paths based on the target flow nodes after node maintenance.
In a third aspect, the present application also provides a computer device. The computer device comprises a memory storing a computer program and a processor implementing the steps of the method of any of the embodiments described above when the computer program is executed by the processor.
In a fourth aspect, the present application also provides a computer-readable storage medium. A computer readable storage medium having stored thereon a computer program which when executed by a processor performs the steps of the method of any of the embodiments described above.
In a fifth aspect, the present application also provides a computer program product. A computer program product comprising a computer program which, when executed by a processor, implements the steps of the method of any of the embodiments described above.
The embodiment of the application has the following beneficial effects:
by applying the embodiment of the application, path analysis is carried out on the target flow chart of the target service to obtain all the test paths, node maintenance is carried out on any flow node on the test paths by combining corresponding test data, and finally, the test case corresponding to each test path is automatically generated based on the maintained flow node. Therefore, the workload of the test cases and test scripts in the manual design process can be effectively reduced, and the generation efficiency and accuracy of the test cases are improved.
Drawings
FIG. 1 is an application environment diagram of a method of generating test cases in one embodiment;
FIG. 2 is a flow diagram of a method of generating test cases in one embodiment;
FIG. 3 is a flow diagram of path analysis in one embodiment;
FIG. 4 is a flowchart of an acquisition mode of a target flowchart in one embodiment;
FIG. 5 is another flow diagram of a method of generating test cases in one embodiment;
FIG. 6 is a block diagram of a device for generating test cases in one embodiment;
fig. 7 is an internal structural diagram of a computer device in one embodiment.
Detailed Description
The present application will be further described in detail with reference to the accompanying drawings, for the purpose of making the objects, technical solutions and advantages of the present application more apparent, and the described embodiments should not be construed as limiting the present application, and all other embodiments obtained by those skilled in the art without making any inventive effort are within the scope of the present application.
In the following description, reference is made to "some embodiments" which describe a subset of all possible embodiments, but it is to be understood that "some embodiments" can be the same subset or different subsets of all possible embodiments and can be combined with one another without conflict.
If a similar description of "first/second" appears in the application document, the following description is added, in which the terms "first/second/third" are merely distinguishing between similar objects and not representing a particular ordering of the objects, it being understood that the "first/second/third" may be interchanged with a particular order or precedence, if allowed, so that embodiments of the application described herein may be practiced otherwise than as illustrated or described herein.
Unless defined otherwise, all technical and scientific terms used herein have the same meaning as commonly understood by one of ordinary skill in the art to which this application belongs. The terminology used herein is for the purpose of describing embodiments of the application only and is not intended to be limiting of the application.
Before describing embodiments of the present application in further detail, the terms and terminology involved in the embodiments of the present application will be described, and the terms and terminology involved in the embodiments of the present application will be used in the following explanation.
1) Flow chart (Flowchart): the idea of using a graphic representation algorithm is an excellent method, and the flowchart is composed of some frames and flow lines, wherein the frames represent various operation types, the characters and symbols in the frames represent the operation contents, and the flow lines represent the operation sequence.
2) The kind of flow chart: business flow chart facing business, system flow chart facing product, page flow chart facing user, time sequence chart facing research and development, and data flow chart facing research and development. The service flow chart is used for identifying service circulation rules, and explicit starting and ending nodes with matters are needed, and explicit responsibility division and corresponding input and output standards are needed. The whole guarantee flow or the matters can be solved through service circulation. The system flow chart is used for abstracting required function points from business rules when a certain function relates to a plurality of subsystems, distinguishing the function points according to product positioning and determining system responsibilities. The page flow chart is used to describe details of the user operation, at this time, it is necessary to understand clearly the user scenario which pages the user operation needs to use, what the jump return logic between these pages is, and which check conditions. A service flow chart for explaining the whole service logic flow direction; a functional flow diagram for determining product functional design logic; the functional flow chart is a business flow chart as a main line, and functional logic (such as filling items, business states, abnormal prompts and the like) of each link is refined; the page flow chart is used for defining the main function of the page and the skip between the pages, and specifically describing the interaction association between the pages.
3) Test cases: a test case in software engineering is a set of conditions or variables from which a tester determines whether an application or software system is working properly. The method of determining whether a software program or system passes a test is called a test criterion.
4) B-side (or class B), business, is typically a system or platform used by an enterprise or a merchant, such as: an enterprise internal ERP management system, a financial management platform and the like; the B-end product is generally relatively obvious in industry characteristics, and more meets the requirements of some specific organizations for the relevant users of enterprises to complete cooperative work under a 'working scene'. The B-end product mainly solves the writing communication requirements of different production relations, and under a centralized organization architecture, the B-end product needs to meet the auxiliary communication between different levels and inside and outside organizations, and functions are modularized. The users of the B-side service may include at least decision makers, administrators, and general users.
Based on the above explanation of nouns and terms involved in the embodiments of the present application, the following describes an application environment of the test case generating method provided by the embodiments of the present application. Referring to fig. 1, fig. 1 is an application environment diagram of a test case generating method provided by an embodiment of the present application, in the application environment, a terminal 400 held by a tester is connected to a server 200 for generating a test case through a network 300, where the network 300 may be a wide area network or a local area network, or a combination of the two, and data transmission is implemented by using a wireless link. In some embodiments, terminal 400 may be, but is not limited to, a notebook computer, tablet computer, desktop computer, smart phone, dedicated messaging device, portable gaming device, smart speaker, smart watch, etc. The server 200 may be an independent physical server, a server cluster or a distributed system formed by a plurality of physical servers, or a cloud server providing cloud services, cloud databases, cloud computing, cloud functions, cloud storage, network services, cloud communication, middleware services, domain name services, security services, basic cloud computing services such as big data and an artificial intelligence platform. The network 300 may be a wide area network or a local area network, or a combination of both. The terminal 400 and the server 200 may be directly or indirectly connected through wired or wireless communication, which is not limited in the embodiment of the present application.
The terminal 400 is configured to receive a test operation of a tester for a target service, and send a generation request of a test case for the target service (such as a B-class service) to the server 200, where the generation request carries a flow chart type and test data.
The server 200 is configured to parse the generation request, and construct at least one initial node associated with the target service based on the type of the flowchart; performing parameter maintenance on node parameters of each initial node, and performing role maintenance on role objects corresponding to each initial node to obtain flow nodes of each initial node in an initial flow chart of a target service; drawing an initial flow chart based on each flow node; checking the initial flow chart, and taking the initial flow chart passing the check as a target flow chart of a target service; acquiring a target analysis mode, and carrying out path analysis on a target flow chart according to the target analysis mode to obtain all test paths; acquiring test data corresponding to each test path, and carrying out node maintenance on target flow nodes on each test path based on each test data; based on each target flow node after node maintenance, generating test cases corresponding to each test path, and sending each test case to the terminal 400, so that the terminal 400 automatically tests the service function of the target service based on the test cases.
The method for generating test cases according to the embodiment of the present application is described below with reference to the server embodiment in fig. 1. Referring to fig. 2, fig. 2 is a flow chart of a method for generating a test case in an embodiment, where the method for generating a test case includes:
step 101, obtaining a target flow chart corresponding to a target service.
In actual implementation, an application program to be tested corresponding to a target service is acquired, and in order to generate at least one test case corresponding to the application program to be tested, a target flow chart corresponding to the target service is required to be acquired first. Since the types of flow diagrams include a variety of types such as business flow diagrams, page flow, and the like. The target service may be a payment service in an online payment scenario, or the like.
Step S102, path analysis is carried out on the target flow chart, and at least one test path is obtained.
In practical implementation, each target flow chart comprises at least one test path, and path analysis (belonging to one mode in flow chart decomposition) is performed on the target flow chart through a preset path analysis mode, so as to obtain all paths included in the target flow chart.
In some embodiments, referring to fig. 3, fig. 3 is a schematic flow chart of path analysis in one embodiment, and step 102 shown in fig. 3 may be implemented by steps 1021 through 1022, which will be described in connection with the steps.
In step 1021, a target analysis method is acquired.
Wherein the analysis mode comprises at least one of the following: full flow mode, full path mode, non-full flow mode, basic path mode.
For the full flow mode, if loops appear in the test paths, each test path only passes through one loop, after passing through the loop, the test path continues to traverse, and if a second loop appears, the process is stopped. For applications where it is desirable to verify a regular path, it is recommended to use this path resolution approach.
For the full path approach, if loops appear in the test path, all loops need to be combined, after passing through the loops, the test path will continue to traverse, and if the same loops appear, the process is stopped. For important applications such as class B products (or applications), it is desirable to generate all test path combinations, and it is recommended to use such a test path parsing scheme.
For the non-full flow mode, if loops appear in the test paths, each test path only passes through one loop, and after passing through the loop, the test paths cannot continue to traverse.
For the basic path mode, if no important node exists, the test path with the highest weight is selected, and if the important node is contained, the test path with the largest quantity of important nodes and the lowest weight is selected.
And step 1022, performing path analysis on the target flow chart according to the target analysis mode to obtain at least one test path.
The flow chart decomposition method based on the target analysis method shown in fig. 3 can be combined with various analysis methods to perform path analysis on the flow chart, so that the accuracy of path analysis is improved.
Step 103, test data corresponding to each test path is obtained, and node maintenance is performed on the target flow nodes on each test path based on each test data.
The target flow node is a flow node except a start node and an end node in the test path.
In actual implementation, at least one piece of test data corresponding to each test path is obtained, node maintenance is carried out on other flow nodes (namely target flow nodes) except the start node and the end node in the test path through the test data, and the flow nodes after maintenance in the test path have a corresponding relation with the test data.
In some embodiments, performing node maintenance on the target flow node on each test path based on each test data includes: based on the test data, filling data into node parameters of the target flow nodes on the test path; based on the test data, at least one functional page associated with the test path in the target service is determined.
In actual implementation, the node parameters of the flow nodes on the test path are subjected to parameter assignment through the test data, the node parameters at least comprise basic parameters such as node names and the like, the level, the flow stage and the like of the flow nodes are further included, and a role object is configured for each flow node.
The node maintenance mode based on the test data can realize the high fit between the test case and the service scene, and is favorable for the expandability of the test case generation method.
Step 104, based on each target flow node after node maintenance, generating test cases corresponding to each test path.
In actual implementation, after node maintenance is performed on each target flow node on the test path through the test data, a test case corresponding to the test path can be generated, and a corresponding test script can be generated.
In some embodiments, referring to fig. 4, fig. 4 is a flowchart of a target flowchart in an embodiment, based on fig. 3, before the target flowchart corresponding to the target service is obtained, steps 201 to 204 may be further performed to obtain the target flowchart.
In step 201, at least one initial node of the target traffic association is constructed.
In actual implementation, a plurality of initial nodes of the flow chart for generating the target service are constructed, wherein the initial nodes at least comprise a start node, at least one intermediate node and an end node. Each initial node may be used as a flow node in a subsequently generated flow chart after node maintenance.
In step 202, parameter maintenance is performed on node parameters of each initial node, and role maintenance is performed on role objects corresponding to each initial node, so as to obtain flow nodes of each initial node in an initial flow chart of a target service.
The node maintenance operations for the initial node may include node parameter maintenance, role maintenance of role objects associated with the node. The node parameter maintenance can provide maintenance of basic parameters and multi-level parameters, wherein the basic parameters consist of parameter names of node parameters included by the node and corresponding dictionary values; the multi-level parameters provide for the selection of a mechanism tree, selecting a particular mechanism. Meanwhile, the setting of the last initial node and the next initial node for the initial node can be also included. Since each flow node in the flow chart is associated with a corresponding character object, maintenance for the character object may be determining a specific hierarchy in the organizational tree to which the character object belongs, and so on.
In step 203, an initial flow chart is drawn based on each flow node.
In actual implementation, after node maintenance is performed on a plurality of initial nodes related to the flow chart to be generated, a plurality of independent flow nodes are obtained. Starting from the initial node, connecting each flow node in turn according to the association relationship (such as father-son relationship and brother relationship of the same level) among the flow nodes until the end node to obtain an initial flow chart of the target service, wherein the initial flow chart comprises at least one path to be tested.
In some embodiments, drawing an initial flow chart based on the flow nodes includes: determining the node type of each flow node in the initial flow chart and the association relation among the flow nodes; and connecting all the flow nodes according to the node types and the association relations to obtain an initial flow chart.
Illustratively, the node type may include at least one of: a start node, an end node, a page node, an active node, a judging node and a logic node. There must be and only one start node in each flow chart, and the start node can only point to one node. At least one end node in each flow chart may allow for multiple end nodes. The page node is the expression object of the bottom page flow chart aiming at the target service. The active nodes are non-leaf nodes in the traffic scene graph, represent one traffic scene, and can be drilled. Judging the node: is a node for describing the judgment condition. Logic node: is a node used to express logical relationships. In the flowchart, the association relationship between the flow nodes in the flowchart is represented by the directional connection lines, and the logic can be described on the directional connection lines. And attributing the processes in the area range associated with the function diagram to the role objects corresponding to the corresponding process nodes.
The drawing mode of the initial flow chart can be used for rapidly drawing the initial flow chart based on the node type of the flow nodes and the association relation among the flow nodes, so that the drawing efficiency of the flow chart is improved.
In step 204, the initial flow chart is checked, and the initial flow chart passing the check is taken as a target flow chart of the target service.
In practical implementation, validity verification is also required to be performed on the obtained initial flow chart, and the initial flow chart passing verification can be used as the target flow chart of the target service. The validity check can be performed manually or automatically according to a preset check mode.
In some embodiments, checking against the initial flow chart may include: acquiring a preset verification mode; and verifying the node parameters of each flow node and the association relation between at least two flow nodes in the initial flow chart in a preset verification mode.
In practical implementation, the preset verification manner may include at least one of the following: there must be and only one start node in each flow chart, and the start node can only point to one node; one or more end nodes are in each flow chart; each flow chart includes at least one test path; when any test path in the flow chart is acquired, if a loop appears in the test path, each test path only passes through one loop, after passing through the loop, the test path can continue to traverse, if a second loop appears, the process is stopped, and the like.
The verification for the initial flow chart can effectively ensure the validity of the initial flow chart, improve the accuracy of the target flow chart, and further improve the accuracy of the test case generation.
In some embodiments, another method for generating a test case is provided, referring to fig. 5, fig. 5 is another flowchart of a method for generating a test case in one embodiment, where an implementation process of the method mainly includes the following modules:
1) And the initialization configuration module is used for realizing parameter maintenance of each flow node in the flow chart and role maintenance corresponding to each flow node. Wherein, the parameter maintenance provides maintenance of basic parameters and multi-level parameters. The basic parameters consist of parameter names and corresponding dictionary values; the multi-level parameters provide for the selection of a mechanism tree, selecting a particular mechanism.
2) And a flow chart module is compiled, wherein the flow chart module is used for drawing the flow chart according to the drawing rule of the flow chart, and the flow chart nodes in the flow chart can comprise the starting node, the ending node, the page node, the active node, the judging node and the logic node. In the process of drawing the flowcharts, the flow nodes with different node types need to meet corresponding rules, for example, each flowchart needs to have only one starting node, and the starting node can only point to one node; at least one termination node in each flow chart may allow for multiple termination nodes; the page node can only be an expression object of the page flow chart; the active nodes can only be non-leaf nodes in the service scene graph, represent one service scene and can be drilled; the judgment node is a node for describing a judgment condition; logical nodes are nodes used to express logical relationships. In addition, the association relation among the flow nodes is characterized by using a directional connecting line, and logic can be described on the directional connecting line; the function chart is used for determining that the flow in the area range associated with the function chart belongs to a certain role.
The flow chart is compiled according to the rules, and the importance level of the flow scene can be maintained.
3) And generating a test path, and after drawing a target flow chart, carrying out path analysis on the target flow chart to obtain all the test paths of the target flow chart. The analysis modes of the test path are four types mentioned above: full flow mode, full path mode, non-full flow mode, basic path mode.
The method for generating the test case has the following effective effects:
1) The efficiency of test case design of the process is improved, the case of the manual design process needs to consider the multi-dimensional situations of user level, user role, process stage and the like, and the combination situation exists, so that the test design efficiency is greatly improved by automatically generating the case.
2) The accuracy of the test cases is improved, when the test cases are designed manually, omission easily occurs due to more scene dimensions, and design omission caused by manual reasons can be avoided by automatically generating the test cases for target services.
3) The normalization of the generated test cases is improved, when the test cases are designed manually, the design content is different from person to person, and the design of the test cases is normalized through an automatic generation method.
4) The generation cost of the test case is reduced, and the investment of manpower, time and resources can be effectively reduced, so that the overall implementation cost is reduced.
Based on the same inventive concept, the embodiment of the application also provides a test case generating device for realizing the test case generating method. The implementation scheme for solving the problem provided by the device is similar to the implementation scheme recorded in the method, so the specific limitation in the embodiment of the generating device for one or more test cases provided below can be referred to the limitation of the generating method for the test cases hereinabove, and will not be repeated here.
In one embodiment, referring to fig. 6, fig. 6 is a block diagram of a structure of a test case generating apparatus in one embodiment, and as shown in fig. 6, there is provided a test case generating apparatus 500, including: an acquisition module 501, an analysis module 502, a maintenance module 503, and a generation module 504, wherein:
the obtaining module 501 is configured to obtain a target flowchart corresponding to a target service.
And the analysis module 502 is configured to perform path analysis on the target flowchart to obtain at least one test path.
A maintenance module 503, configured to obtain test data corresponding to each test path, and perform node maintenance on a target flow node on each test path based on each test data, where the target flow node is a flow node in the test path except for a start node and an end node;
The generating module 504 is configured to generate test cases corresponding to the test paths based on the target flow nodes after node maintenance.
In some embodiments, the analysis module 502 is further configured to: acquiring a target analysis mode; according to a target analysis mode, carrying out path analysis on the target flow chart to obtain at least one test path; wherein the analysis mode comprises at least one of the following: full flow mode, full path mode, non-full flow mode, basic path mode.
In some embodiments, the obtaining module 501 is further configured to: constructing at least one initial node of the target service association; performing parameter maintenance on node parameters of the initial nodes, and performing role maintenance on role objects corresponding to the initial nodes to obtain flow nodes of the initial nodes in an initial flow chart of the target service; drawing the initial flow chart based on each flow node; and checking the initial flow chart, and taking the initial flow chart passing the checking as a target flow chart of the target service.
In some embodiments, the obtaining module 501 is further configured to: determining the node type of each flow node in the initial flow chart and the association relation among the flow nodes; and connecting each flow node according to the node type and each association relation to obtain the initial flow chart.
In some embodiments, the obtaining module 501 is further configured to: acquiring a preset verification mode; and verifying the node parameters of each flow node and the association relation between at least two flow nodes in the initial flow chart in the preset verification mode.
In some embodiments, the maintenance module 503 is further configured to: based on the test data, filling data into node parameters of a target flow node on the test path; and determining at least one functional page associated with the test path in the target service based on the test data.
The modules in the test case generating device may be implemented in whole or in part by software, hardware, or a combination thereof. The above modules may be embedded in hardware or may be independent of a processor in the computer device, or may be stored in software in a memory in the computer device, so that the processor may call and execute operations corresponding to the above modules.
In one embodiment, a computer device is provided, which may be a server, and referring to fig. 7, fig. 7 is an internal structural diagram of the computer device in one embodiment, and the internal structural diagram may be shown in fig. 7. The computer device includes a processor, a memory, an Input/Output interface (I/O), and a communication interface. The processor, the memory and the input/output interface are connected through a system bus, and the communication interface is connected to the system bus through the input/output interface. Wherein the processor of the computer device is configured to provide computing and control capabilities. The memory of the computer device includes a non-volatile storage medium and an internal memory. The non-volatile storage medium stores an operating system, computer programs, and a database. The internal memory provides an environment for the operation of the operating system and computer programs in the non-volatile storage media. The database of the computer device is for storing user data. The input/output interface of the computer device is used to exchange information between the processor and the external device. The communication interface of the computer device is used for communicating with an external terminal through a network connection. The computer program, when executed by a processor, implements a method of generating test cases.
It will be appreciated by those skilled in the art that the structure shown in FIG. 7 is merely a block diagram of some of the structures associated with the present inventive arrangements and is not limiting of the computer device to which the present inventive arrangements may be applied, and that a particular computer device may include more or fewer components than shown, or may combine some of the components, or have a different arrangement of components.
In one embodiment, a computer device is provided comprising a memory and a processor, the memory having stored therein a computer program, the processor when executing the computer program performing the steps of: acquiring a target flow chart corresponding to a target service; carrying out path analysis on the target flow chart to obtain at least one test path; acquiring test data corresponding to each test path, and performing node maintenance on target flow nodes on each test path based on each test data; the target flow node is a flow node except a start node and an end node in the test path; and generating test cases corresponding to the test paths based on the target flow nodes after node maintenance.
In one embodiment, the path analysis performed on the target flowchart by the processor when executing the computer program, obtains at least one test path, including: acquiring a target analysis mode; according to a target analysis mode, carrying out path analysis on the target flow chart to obtain at least one test path; wherein the analysis mode comprises at least one of the following: full flow mode, full path mode, non-full flow mode, basic path mode.
In one embodiment, before the processor executes the target flowchart corresponding to the target service, the method further includes: constructing at least one initial node of the target service association; performing parameter maintenance on node parameters of the initial nodes, and performing role maintenance on role objects corresponding to the initial nodes to obtain flow nodes of the initial nodes in an initial flow chart of the target service; drawing the initial flow chart based on each flow node; and checking the initial flow chart, and taking the initial flow chart passing the checking as a target flow chart of the target service.
In one embodiment, the drawing of the initial flow chart based on each of the flow nodes implemented when the processor executes the computer program includes: determining the node type of each flow node in the initial flow chart and the association relation among the flow nodes; and connecting each flow node according to the node type and each association relation to obtain the initial flow chart.
In one embodiment, verifying the initial flow chart implemented when the processor executes the computer program includes: acquiring a preset verification mode; and verifying the node parameters of each flow node and the association relation between at least two flow nodes in the initial flow chart in the preset verification mode.
In one embodiment, node maintenance for a target flow node on each of the test paths based on each of the test data implemented when the processor executes the computer program comprises: based on the test data, filling data into node parameters of a target flow node on the test path; and determining at least one functional page associated with the test path in the target service based on the test data.
In one embodiment, a computer readable storage medium is provided having a computer program stored thereon, which when executed by a processor, performs the steps of: acquiring a target flow chart corresponding to a target service; carrying out path analysis on the target flow chart to obtain at least one test path; acquiring test data corresponding to each test path, and performing node maintenance on target flow nodes on each test path based on each test data; the target flow node is a flow node except a start node and an end node in the test path; and generating test cases corresponding to the test paths based on the target flow nodes after node maintenance.
In one embodiment, the path analysis of the target flowchart implemented when the computer program is executed by the processor, results in at least one test path, including: acquiring a target analysis mode; according to a target analysis mode, carrying out path analysis on the target flow chart to obtain at least one test path; wherein the analysis mode comprises at least one of the following: full flow mode, full path mode, non-full flow mode, basic path mode.
In one embodiment, before the target flowchart corresponding to the target service is obtained when the computer program is executed by the processor, the method further includes: constructing at least one initial node of the target service association; performing parameter maintenance on node parameters of the initial nodes, and performing role maintenance on role objects corresponding to the initial nodes to obtain flow nodes of the initial nodes in an initial flow chart of the target service; drawing the initial flow chart based on each flow node; and checking the initial flow chart, and taking the initial flow chart passing the checking as a target flow chart of the target service.
In one embodiment, the drawing of the initial flow chart based on each of the flow nodes implemented when the computer program is executed by the processor includes: determining the node type of each flow node in the initial flow chart and the association relation among the flow nodes; and connecting each flow node according to the node type and each association relation to obtain the initial flow chart.
In one embodiment, verifying the initial flow chart, as implemented when the computer program is executed by the processor, includes: acquiring a preset verification mode; and verifying the node parameters of each flow node and the association relation between at least two flow nodes in the initial flow chart in the preset verification mode.
In one embodiment, node maintenance for a target flow node on each of the test paths based on each of the test data implemented when the computer program is executed by the processor comprises: based on the test data, filling data into node parameters of a target flow node on the test path; and determining at least one functional page associated with the test path in the target service based on the test data.
In one embodiment, a computer program product is provided comprising a computer program which, when executed by a processor, performs the steps of: acquiring a target flow chart corresponding to a target service; carrying out path analysis on the target flow chart to obtain at least one test path; acquiring test data corresponding to each test path, and performing node maintenance on target flow nodes on each test path based on each test data; the target flow node is a flow node except a start node and an end node in the test path; and generating test cases corresponding to the test paths based on the target flow nodes after node maintenance.
In one embodiment, the path analysis of the target flowchart implemented when the computer program is executed by the processor, results in at least one test path, including: acquiring a target analysis mode; according to a target analysis mode, carrying out path analysis on the target flow chart to obtain at least one test path; wherein the analysis mode comprises at least one of the following: full flow mode, full path mode, non-full flow mode, basic path mode.
In one embodiment, before the target flowchart corresponding to the target service is obtained when the computer program is executed by the processor, the method further includes: constructing at least one initial node of the target service association; performing parameter maintenance on node parameters of the initial nodes, and performing role maintenance on role objects corresponding to the initial nodes to obtain flow nodes of the initial nodes in an initial flow chart of the target service; drawing the initial flow chart based on each flow node; and checking the initial flow chart, and taking the initial flow chart passing the checking as a target flow chart of the target service.
In one embodiment, the drawing of the initial flow chart based on each of the flow nodes implemented when the computer program is executed by the processor includes: determining the node type of each flow node in the initial flow chart and the association relation among the flow nodes; and connecting each flow node according to the node type and each association relation to obtain the initial flow chart.
In one embodiment, verifying the initial flow chart, as implemented when the computer program is executed by the processor, includes: acquiring a preset verification mode; and verifying the node parameters of each flow node and the association relation between at least two flow nodes in the initial flow chart in the preset verification mode.
It should be noted that, the user information (including but not limited to user equipment information, user personal information, etc.) and the data (including but not limited to data for analysis, stored data, presented data, etc.) related to the present application are information and data authorized by the user or sufficiently authorized by each party, and the collection, use and processing of the related data need to comply with the related laws and regulations and standards of the related country and region.
Those skilled in the art will appreciate that implementing all or part of the above described methods may be accomplished by way of a computer program stored on a non-transitory computer readable storage medium, which when executed, may comprise the steps of the embodiments of the methods described above. Any reference to memory, database, or other medium used in embodiments provided herein may include at least one of non-volatile and volatile memory. The nonvolatile Memory may include Read-Only Memory (ROM), magnetic tape, floppy disk, flash Memory, optical Memory, high density embedded nonvolatile Memory, resistive random access Memory (ReRAM), magnetic random access Memory (MRAM, magnetoresistive Random Access Memory), ferroelectric Memory (FRAM, ferroelectric Random Access Memory), phase change Memory (PCM, phase Change Memory), graphene Memory, and the like. Volatile memory can include random access memory (RAM, random Access Memory,) or external cache memory, and the like. By way of illustration, and not limitation, RAM can take many forms, such as static random access memory (SRAM, static Random Access Memory,) or dynamic random access memory (DRAM, dynamic Random Access Memory), among others. The databases referred to in the embodiments provided herein may include at least one of a relational database and a non-relational database. The non-relational database may include, but is not limited to, a blockchain-based distributed database, and the like. The processor referred to in the embodiments provided in the present application may be a general-purpose processor, a central processing unit, a graphics processor, a digital signal processor, a programmable logic unit, a data processing logic unit based on quantum computing, or the like, but is not limited thereto.
The technical features of the above embodiments may be arbitrarily combined, and all possible combinations of the technical features in the above embodiments are not described for brevity of description, however, as long as there is no contradiction between the combinations of the technical features, they should be considered as the scope of the description.
The foregoing examples illustrate only a few embodiments of the application and are described in detail herein without thereby limiting the scope of the application. It should be noted that it will be apparent to those skilled in the art that several variations and modifications can be made without departing from the spirit of the application, which are all within the scope of the application. Accordingly, the scope of the application should be assessed as that of the appended claims.

Claims (10)

1. A method for generating test cases, the method comprising:
acquiring a target flow chart corresponding to a target service;
carrying out path analysis on the target flow chart to obtain at least one test path;
acquiring test data corresponding to each test path, and performing node maintenance on target flow nodes on each test path based on each test data;
The target flow node is a flow node except a start node and an end node in the test path;
and generating test cases corresponding to the test paths based on the target flow nodes after node maintenance.
2. The method of claim 1, wherein the performing path analysis on the target flow chart results in at least one test path, comprising:
acquiring a target analysis mode;
according to a target analysis mode, carrying out path analysis on the target flow chart to obtain at least one test path;
wherein the analysis mode comprises at least one of the following: full flow mode, full path mode, non-full flow mode, basic path mode.
3. The method according to claim 1, wherein before the obtaining the target flow chart corresponding to the target service, the method further comprises:
constructing at least one initial node of the target service association;
performing parameter maintenance on node parameters of the initial nodes, and performing role maintenance on role objects corresponding to the initial nodes to obtain flow nodes of the initial nodes in an initial flow chart of the target service;
Drawing the initial flow chart based on each flow node;
and checking the initial flow chart, and taking the initial flow chart passing the checking as a target flow chart of the target service.
4. A method according to claim 3, wherein said drawing said initial flow chart based on each of said flow nodes comprises:
determining the node type of each flow node in the initial flow chart and the association relation among the flow nodes;
and connecting each flow node according to the node type and each association relation to obtain the initial flow chart.
5. A method according to claim 3, wherein said verifying said initial flow chart comprises:
acquiring a preset verification mode;
and verifying the node parameters of each flow node and the association relation between at least two flow nodes in the initial flow chart in the preset verification mode.
6. The method of claim 1, wherein the performing node maintenance on the target flow node on each of the test paths based on each of the test data comprises:
Based on the test data, filling data into node parameters of a target flow node on the test path;
and determining at least one functional page associated with the test path in the target service based on the test data.
7. A test case generating apparatus, the apparatus comprising:
the acquisition module is used for acquiring a target flow chart corresponding to the target service;
the analysis module is used for carrying out path analysis on the target flow chart to obtain at least one test path;
the maintenance module is used for acquiring test data corresponding to each test path and carrying out node maintenance on the target flow node on each test path based on each test data;
the target flow node is a flow node except a start node and an end node in the test path;
the generating module is used for generating test cases corresponding to the test paths based on the target flow nodes after node maintenance.
8. A computer device comprising a memory and a processor, the memory storing a computer program, characterized in that the processor implements the steps of the method of any of claims 1 to 6 when the computer program is executed.
9. A computer readable storage medium, on which a computer program is stored, characterized in that the computer program, when being executed by a processor, implements the steps of the method of any of claims 1 to 6.
10. A computer program product comprising a computer program, characterized in that the computer program, when being executed by a processor, implements the steps of the method of any of claims 1 to 6.
CN202311092513.5A 2023-08-28 2023-08-28 Method, device, equipment, medium and product for generating test case Pending CN117112424A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202311092513.5A CN117112424A (en) 2023-08-28 2023-08-28 Method, device, equipment, medium and product for generating test case

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202311092513.5A CN117112424A (en) 2023-08-28 2023-08-28 Method, device, equipment, medium and product for generating test case

Publications (1)

Publication Number Publication Date
CN117112424A true CN117112424A (en) 2023-11-24

Family

ID=88799728

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202311092513.5A Pending CN117112424A (en) 2023-08-28 2023-08-28 Method, device, equipment, medium and product for generating test case

Country Status (1)

Country Link
CN (1) CN117112424A (en)

Similar Documents

Publication Publication Date Title
CN110032599B (en) Data structure reading and updating method and device, and electronic equipment
CN110597730B (en) Automatic test case generation method and system based on scene method
CN108540351B (en) Automatic testing method for distributed big data service
CN107330014B (en) Data table creating method and device
US11775507B2 (en) Methods and apparatuses for reading and updating data structures, and electronic devices
CN106557307B (en) Service data processing method and system
CN112395339B (en) Intersystem data admission verification method, device, computer equipment and storage medium
CN114238085A (en) Interface testing method and device, computer equipment and storage medium
CN111124883B (en) Test case library introduction method, system and equipment based on tree form
Girbea et al. Efficient address space generation for an OPC UA server
CN117112424A (en) Method, device, equipment, medium and product for generating test case
CN111680478B (en) Report generation method, device, equipment and storage medium based on configuration software
CN114281549A (en) Data processing method and device
CN113868138A (en) Method, system, equipment and storage medium for acquiring test data
CN108074074B (en) Integration device and integration method thereof
US20190377547A1 (en) Data grouping for efficient parallel processing
CN116755684B (en) OAS Schema generation method, device, equipment and medium
CN117408238A (en) Activity task management method, system, electronic device and storage medium
CN116303317A (en) Log processing method and device for lua program interface and computer equipment
CN117370160A (en) Code auditing method, apparatus, computer device, storage medium and program product
CN117743306A (en) Data migration method, device, computer equipment and storage medium
CN116881164A (en) Verification and correction method, device and equipment for test data in financial information system
CN115660875A (en) Account data processing method and device, computer equipment and storage medium
CN116909875A (en) Real-time test data generation method, device, computer equipment and storage medium
CN116756022A (en) Data preparation method, device, computer 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