CN114610619A - Method, device and equipment for testing business process and storage medium - Google Patents

Method, device and equipment for testing business process and storage medium Download PDF

Info

Publication number
CN114610619A
CN114610619A CN202210242228.6A CN202210242228A CN114610619A CN 114610619 A CN114610619 A CN 114610619A CN 202210242228 A CN202210242228 A CN 202210242228A CN 114610619 A CN114610619 A CN 114610619A
Authority
CN
China
Prior art keywords
service
test
stage
flow
business
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
CN202210242228.6A
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.)
Ping An Puhui Enterprise Management Co Ltd
Original Assignee
Ping An Puhui Enterprise Management Co Ltd
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 Ping An Puhui Enterprise Management Co Ltd filed Critical Ping An Puhui Enterprise Management Co Ltd
Priority to CN202210242228.6A priority Critical patent/CN114610619A/en
Publication of CN114610619A publication Critical patent/CN114610619A/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
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F11/00Error detection; Error correction; Monitoring
    • G06F11/36Preventing errors by testing or debugging software
    • G06F11/3668Software testing
    • G06F11/3672Test management
    • G06F11/3688Test management for test execution, e.g. scheduling of test suites
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F11/00Error detection; Error correction; Monitoring
    • G06F11/36Preventing errors by testing or debugging software
    • G06F11/3668Software testing
    • G06F11/3672Test management
    • G06F11/3692Test management for test results analysis

Landscapes

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

Abstract

The invention relates to the field of testing, and discloses a method, a device, equipment and a storage medium for testing a business process. The method comprises the following steps: receiving a test request to acquire a target test case containing a flow stage identifier and a flow test parameter from a test case set; acquiring the service logic which comprises the class name and the function name and corresponds to each flow stage according to the flow stage identification; calling a unit test interface in a test environment, taking a class name and a function name of a next flow stage and flow test parameters or reverse parameters of a current flow stage as input parameters of the unit test interface to carry out unit test, and obtaining and outputting the reverse parameters of the next flow stage until the reverse parameters of each flow stage are obtained; and comparing preset standard values of the counter participation of each process stage to determine an abnormal process stage and a non-abnormal process stage. The invention calls stage by stage through the specific class method provided by the test environment so as to test the unit of the service interface, thereby improving the test efficiency.

Description

Business process testing method, device, equipment and storage medium
Technical Field
The present invention relates to the field of testing, and in particular, to a method, an apparatus, a device, and a storage medium for testing a business process.
Background
In the process of business testing, a test environment provides a packaged data packet under normal conditions, a business process is tested through a provided service interface, and a verification mode generally comprises a database drop and a log printed by a log file.
In the existing service flow testing method, when the abnormal logic is too complex and the service flow to be tested is too long, the abnormal logic does not fall into the data table and the log, and at this time, the abnormal logic cannot be positioned, and the executed flow node cannot be twisted, and only can be retested again to gradually position the abnormality, so that the testing efficiency is low.
Disclosure of Invention
The invention mainly aims to solve the problem that the existing service flow testing method is low in testing efficiency.
The first aspect of the present invention provides a method for testing a business process, including:
receiving a service flow test request sent by a terminal, and acquiring a target service test case from a preset service test case set according to the service flow test request, wherein the target service test case comprises a flow stage identifier corresponding to each flow stage in a service flow to be tested and a flow test parameter preset by a user;
acquiring business logic corresponding to each process stage of the business process to be tested according to the process stage identification, wherein the business logic comprises a class name and a function name;
calling a unit test interface in a test environment, taking a class name and a function name corresponding to a first flow stage of the business flow to be tested and the flow test parameters as input parameters of the unit test interface to perform unit test, obtaining and outputting reverse parameters of a current flow stage, taking the class name and the function name corresponding to a next flow stage and the reverse parameters of the current flow stage as the input parameters of the unit test interface to perform unit test, obtaining and outputting the reverse parameters of the next flow stage until the reverse parameters of each flow stage are obtained;
and comparing the preset standard values of the counter participation of each process stage to determine an abnormal process stage and a non-abnormal process stage in the business process to be tested.
Optionally, in a first implementation manner of the first aspect of the present invention, before the receiving a service flow test request sent by a terminal and obtaining a target service test case from a preset service test case set according to the service flow test request, the method further includes:
receiving a service test request sent by a terminal, and determining at least one process node sequence corresponding to a service to be tested according to a service name parameter carried in the service test request, wherein the service to be tested consists of at least one service process, the service processes are independent from each other, and each service process corresponds to one process node sequence;
and constructing a corresponding test case based on each flow node sequence corresponding to the service to be tested, and generating a service test case set for expressing the test logic of the service to be tested according to the constructed test case.
Optionally, in a second implementation manner of the first aspect of the present invention, the constructing a corresponding test case based on each flow node sequence corresponding to the service to be tested, and generating the service test case set used for representing the test logic of the service to be tested according to the constructed test case includes:
constructing a directed acyclic graph for representing service logic based on a plurality of process nodes and an arrangement sequence thereof contained in each process node sequence corresponding to the service to be tested, wherein the directed acyclic graph comprises a plurality of primitive nodes and directed edges connecting the primitive nodes, each primitive node corresponds to each process node, and the directed edges are used for indicating an execution sequence of the process nodes;
and traversing paths of the directed acyclic graph based on the primitive organization structure of the directed acyclic graph, determining each traversed path as a primitive test case, and generating a service test case set for expressing the test logic of the service to be tested according to the determined test cases.
Optionally, in a third implementation manner of the first aspect of the present invention, before the obtaining, according to the flow stage identifier, a service logic corresponding to each flow stage of the service flow to be tested, the method further includes:
receiving a service test request, and acquiring a shared program file corresponding to a plurality of application scenes and pointed by the service to be tested according to the service test request, wherein the shared program file comprises candidate service logics shared under the application scenes and application scene information of the candidate service logics;
and matching the application scenario information in the service test request with the application scenario information of the candidate service logic to determine a target service logic from the candidate service logic, wherein the target service logic comprises the service logic corresponding to each process stage of the service process to be tested.
Optionally, in a fourth implementation manner of the first aspect of the present invention, the method further includes:
receiving a program increasing request of a new application scene sent by a terminal;
and based on the program adding request, adding the service logic for testing under the new application scene and the application scene information corresponding to the service logic in the common program file to update the common program file.
Optionally, in a fifth implementation manner of the first aspect of the present invention, the method further includes:
calculating the difference ratio between the preset standard values of the counter participation of each abnormal process stage in the business process to be tested;
and acquiring an abnormal grade comparison relation preset by a user from a database, and determining the abnormal grade of each abnormal process stage according to the abnormal grade comparison relation.
Optionally, in a sixth implementation manner of the first aspect of the present invention, the method further includes:
generating a service test report based on a preset test report template and service test result data, and performing persistent storage on the service test report, wherein the service test result data comprises the abnormal process stages, the non-abnormal process stages and the abnormal grade of each abnormal process stage.
A second aspect of the present invention provides a device for testing a business process, including:
the system comprises a test case acquisition module, a service flow test module and a service flow test module, wherein the test case acquisition module is used for receiving a service flow test request sent by a terminal and acquiring a target service test case from a preset service test case set according to the service flow test request, and the target service test case comprises flow stage identifications corresponding to flow stages in a service flow to be tested and flow test parameters preset by a user;
a service logic obtaining module, configured to obtain, according to the flow stage identifier, a service logic corresponding to each flow stage of the service flow to be tested, where the service logic includes a class name and a function name;
the unit testing module is used for calling a unit testing interface in a testing environment, taking the class name and the function name corresponding to the first flow stage of the business flow to be tested and the flow testing parameters as the input parameters of the unit testing interface to carry out unit testing, obtaining and outputting the inverse parameters of the current flow stage, taking the class name and the function name corresponding to the next flow stage and the inverse parameters of the current flow stage as the input parameters of the unit testing interface to carry out unit testing, obtaining and outputting the inverse parameters of the next flow stage until the inverse parameters of each flow stage are obtained;
and the abnormal positioning module is used for comparing the anti-participation preset standard values of all the process stages to determine an abnormal process stage and a non-abnormal process stage in the business process to be tested.
Optionally, in a first implementation manner of the second aspect of the present invention, the test apparatus further includes a test case constructing module, where the test case constructing module specifically includes:
the system comprises a sequence determining unit, a service testing unit and a service testing unit, wherein the sequence determining unit is used for receiving a service testing request sent by a terminal and determining at least one process node sequence corresponding to a service to be tested according to a service name parameter carried in the service testing request, the service to be tested consists of at least one service process, the service processes are mutually independent, and each service process corresponds to one process node sequence;
and the case generating unit is used for constructing a corresponding test case based on each flow node sequence corresponding to the service to be tested and generating a service test case set used for expressing the test logic of the service to be tested according to the constructed test case.
Optionally, in a second implementation manner of the second aspect of the present invention, the use case generating unit is specifically configured to:
constructing a directed acyclic graph for representing service logic based on a plurality of process nodes and an arrangement sequence thereof contained in each process node sequence corresponding to the service to be tested, wherein the directed acyclic graph comprises a plurality of primitive nodes and directed edges connecting the primitive nodes, each primitive node corresponds to each process node, and the directed edges are used for indicating an execution sequence of the process nodes;
and traversing paths of the directed acyclic graph based on the primitive organization structure of the directed acyclic graph, determining each traversed path as a primitive test case, and generating a service test case set for expressing the test logic of the service to be tested according to the determined test cases.
Optionally, in a third implementation manner of the second aspect of the present invention, the testing apparatus further includes a service logic determining module, where the service logic determining module specifically includes:
the system comprises a shared program acquisition unit, a service test unit and a service test unit, wherein the shared program acquisition unit is used for receiving a service test request and acquiring a shared program file corresponding to a plurality of application scenes and pointed by a service to be tested according to the service test request, and the shared program file comprises candidate service logics shared under the application scenes and application scene information of the candidate service logics;
and the scene matching unit is used for matching the application scene information in the service test request with the application scene information of the candidate service logic so as to determine a target service logic from the candidate service logic, wherein the target service logic comprises the service logic corresponding to each process stage of the service process to be tested.
Optionally, in a fourth implementation manner of the second aspect of the present invention, the service logic determining module specifically includes:
the system comprises a shared program acquisition unit, a service test unit and a service test unit, wherein the shared program acquisition unit is used for receiving a service test request and acquiring a shared program file corresponding to a plurality of application scenes and pointed by a service to be tested according to the service test request, and the shared program file comprises candidate service logics shared under the application scenes and application scene information of the candidate service logics;
a scene matching unit, configured to match application scene information in the service test request with application scene information of the candidate service logic, so as to determine a target service logic from the candidate service logic, where the target service logic includes service logics corresponding to each process stage of the service flow to be tested;
the shared program updating unit is used for receiving a program increasing request of a new application scene sent by the terminal; and based on the program adding request, adding the service logic for testing under the new application scene and the application scene information corresponding to the service logic in the common program file to update the common program file.
Optionally, in a fifth implementation manner of the second aspect of the present invention, the abnormality positioning module specifically includes:
the difference ratio calculating unit is used for calculating the difference ratio between the preset standard values of the counter participation of each abnormal process stage in the business process to be tested;
and the grade determining unit is used for acquiring an abnormal grade comparison relation preset by a user from a database and determining the abnormal grade of each abnormal process stage according to the abnormal grade comparison relation.
Optionally, in a sixth implementation manner of the second aspect of the present invention, the abnormality positioning module specifically includes:
the difference ratio calculating unit is used for calculating the difference ratio between the preset standard values of the counter participation of each abnormal process stage in the business process to be tested;
the level determining unit is used for acquiring an abnormal level comparison relation preset by a user from a database and determining the abnormal level of each abnormal process stage according to the abnormal level comparison relation;
and the test report generating unit is used for generating a service test report based on a preset test report template and service test result data, and persistently storing the service test report, wherein the service test result data comprises the abnormal flow stages, the non-abnormal flow stages and the abnormal grade of each abnormal flow stage.
A third aspect of the present invention provides a device for testing a service flow, including: a memory and at least one processor, the memory having instructions stored therein; the at least one processor calls the instructions in the memory to enable the test equipment of the business process to execute the test method of the business process.
A fourth aspect of the present invention provides a computer-readable storage medium having stored therein instructions, which, when run on a computer, cause the computer to execute the above-mentioned method for testing a business process.
According to the technical scheme provided by the invention, the business logic corresponding to each process stage is obtained, the specific class name, function name and initial test parameter or anti-parameter are taken as the input parameters of the unit test interface to carry out unit test on each process stage, so that the anti-parameter of each process stage is obtained, and the anti-parameter standard values are directly compared to determine the abnormal process stage, so that the test efficiency is higher.
Drawings
FIG. 1 is a schematic diagram of a first embodiment of a method for testing a business process according to an embodiment of the present invention;
FIG. 2 is a diagram of a second embodiment of a method for testing a business process according to an embodiment of the present invention;
FIG. 3 is a diagram of a third embodiment of a method for testing a business process according to an embodiment of the present invention;
FIG. 4 is a diagram of a fourth embodiment of a method for testing a business process according to an embodiment of the present invention;
FIG. 5 is a schematic diagram of an embodiment of a test apparatus for business process in the embodiment of the present invention;
FIG. 6 is a schematic diagram of another embodiment of a test apparatus for business process in the embodiment of the present invention;
FIG. 7 is a diagram of an embodiment of a test apparatus for a business process in an embodiment of the present invention.
Detailed Description
The embodiment of the invention provides a method, a device, equipment and a storage medium for testing a business process, and the testing efficiency is higher.
The terms "first," "second," "third," "fourth," and the like in the description and in the claims, as well as in the drawings, if any, are used for distinguishing between similar elements and not necessarily for describing a particular sequential or chronological order. It will be appreciated that the data so used may be interchanged under appropriate circumstances such that the embodiments described herein may be practiced otherwise than as specifically illustrated or described herein. Furthermore, the terms "comprises," "comprising," or "having," and any variations thereof, are intended to cover non-exclusive inclusions, such that a process, method, system, article, or apparatus that comprises a list of steps or elements is not necessarily limited to those steps or elements expressly listed, but may include other steps or elements not expressly listed or inherent to such process, method, article, or apparatus.
For convenience of understanding, a specific flow of the embodiment of the present invention is described below, and referring to fig. 1, an embodiment of a method for testing a service flow in the embodiment of the present invention includes:
101. receiving a service flow test request sent by a terminal, and acquiring a target service test case from a preset service test case set according to the service flow test request, wherein the target service test case comprises a flow stage identifier corresponding to each flow stage in a service flow to be tested and a flow test parameter preset by a user;
it can be understood that the request test object of the business process test request is a business process, and at least one business process can be included under each specific business, and the processes are independent of each other. Specifically, the service may be an application service, for example, a commercial application software on an operating system, and the service process constitutes a functional module in the commercial application software, for example, a login function, and the process simply includes a plurality of process stages, such as acquiring user input, sending to a server, receiving by the server, checking and matching a database, and returning a matching result, and may be distinguished by process stage identifiers.
The type of the test request includes, but is not limited to, a function test, a performance test, and the like, and this embodiment does not limit this. The design stage of the test case is an indispensable link before testing, under the ordinary condition, a test engineer designs the test case which meets the test standard and covers the test scene comprehensively according to the service scene and the service requirement, and the test case usually comprises input flow test parameters; the business test case set is a test case set designed for a certain business service, each test case in the set corresponds to a business process under the business service, and after the server completes the test of the target business process based on the test standard of the target test case, regression testing needs to be performed on other business processes under the business service, so that the test of the whole business service can be completed.
102. Acquiring business logic corresponding to each process stage of the business process to be tested according to the process stage identifier, wherein the business logic comprises a class name and a function name;
it can be understood that the process stage identifier is used to distinguish each stage in the service process, and the specific identification form is not limited in this embodiment. The service logic, namely the corresponding service program code segment, is obtained by writing by a developer according to service requirements by using a machine language, the object-oriented machine language generally comprises a class (class), a function (function), a variable (variable) and the like, the class is uniquely identified by a class name, the function is uniquely identified by a function name, and the variable is uniquely identified by a variable name; there may be some differences in the characteristics of different machine languages.
103. Calling a unit test interface in a test environment, taking a class name and a function name corresponding to a first flow stage of a business flow to be tested and flow test parameters as input parameters of the unit test interface to perform unit test, obtaining and outputting inverse parameters of a current flow stage, taking the class name and the function name corresponding to a next flow stage and the inverse parameters of the current flow stage as input parameters of the unit test interface to perform unit test, obtaining and outputting the inverse parameters of the next flow stage until the inverse parameters of each flow stage are obtained;
it can be understood that, in the test environment, the business service is a white-box model, and the server can extract the business logic such as the specific detailed function logic of the business process and the definition description in the class body, so as to perform the unit test according to the type or the function module of the business process. When the unit test involves the test of a plurality of process stages, the server takes the process test parameters, class names and function names which accord with the test standard in the test case as initial input parameters of the initial business process, outputs the back parameters of each stage, takes the back parameters as the input parameters (namely input) of the next stage to test again and output the back parameters, and sequentially calls the back parameters in a cascade manner until the back parameters of each process stage of the business process are obtained.
Optionally, there may be a case where data is dependent between different business processes, for example, the B process may be executed only depending on output data of the a process, and at this time, a corresponding process test parameter for input is not specified in the business test case of the latter, after the back parameter of the final process stage is output by the pre-business process, the server takes the back parameter as input of the post-business process to continue testing the post-business process, and the testing process of each stage of the post-business process is the same as above.
104. And comparing the preset standard values of the counter participation of each process stage to determine an abnormal process stage and a non-abnormal process stage in the business process to be tested.
It can be understood that the back parameter of each process stage, i.e. the actual value of the business process stage, is the expected ideal value, and the reason value can be flexibly adjusted according to business requirements. The server compares the actual value obtained by the test with the expected ideal value, if the actual value reaches the ideal value, the server determines that the process stage is normal, otherwise, the server determines that the process stage is an abnormal process stage. Optionally, the server may further set a downward confidence value for the ideal value, and when the actual value reaches the downward confidence value of the ideal value, it may also be determined that it is a normal flow stage.
In this embodiment, unit testing is performed on each process stage by acquiring a service logic corresponding to each process stage and taking a specific class name, a function name, and an initial test parameter or an anti-parameter as an input parameter of a unit test interface, so as to obtain an anti-parameter of each process stage, and further directly comparing anti-parameter reference values to determine an abnormal process stage, so that the testing efficiency is higher.
Referring to fig. 2, a second embodiment of the method for testing a service process according to the embodiment of the present invention includes:
201. receiving a service test request sent by a terminal, and determining at least one process node sequence corresponding to a service to be tested according to a service name parameter carried in the service test request, wherein the service to be tested consists of at least one service process, the service processes are independent from each other, and each service process corresponds to one process node sequence;
202. constructing a directed acyclic graph for representing service logic based on a plurality of process nodes and an arrangement sequence thereof contained in each process node sequence corresponding to a service to be tested, wherein the directed acyclic graph comprises a plurality of primitive nodes and directed edges connecting the primitive nodes, each primitive node corresponds to each process node, and the directed edges are used for indicating the execution sequence of the process nodes;
it is understood that a Directed Acyclic Graph (DAG) refers to a Directed Graph that cannot go from a vertex back to the vertex through several edges, which is a special data structure used to describe expressions that contain common children. Because the approval operation comprises a plurality of processes containing common process nodes, the server adopts the directed acyclic graph structure to describe the logic of the whole service. The directed acyclic graph may be stored in a text containing business process logic or other existing forms in a form of a two-dimensional array by using an adjacent matrix representation, the two-dimensional array corresponds to the adjacent matrix, and the specific storage form is not limited in this embodiment. In the embodiment, the server adopts the directed acyclic graph to express the service logic, so that sharing of common service process nodes is realized, and further, the data storage space is reduced.
203. Traversing paths of the directed acyclic graph based on a primitive organization structure of the directed acyclic graph, determining each traversed path as a primitive test case, and generating a service test case set for expressing test logic of a service to be tested according to the determined test cases;
the directed acyclic graph is a primitive organization structure, the structure is strong and clear, and the server can realize rapid traversal of the path according to the characteristic of the directed acyclic graph, so that the efficiency of generating the primitive test case is improved. It should be noted that in this embodiment, a Depth First Search (DFS) is used to perform path traversal on the directed acyclic graph, that is, after all primitive nodes on one flow path are traversed, an access traversal is performed on primitive nodes of another flow path. It should be noted that the conventional test case is described in a structured text form, and usually, a tester designs the test case according to experience or obtains corresponding data based on a preset test case template and loads the data into the test case template to automatically generate the test case. Optionally, when the test case is subsequently changed, only the corresponding node and/or the directed edge need to be determined and modified, so that the change is more convenient.
204. Receiving a service flow test request sent by a terminal, and acquiring a target service test case from a preset service test case set according to the service flow test request, wherein the target service test case comprises a flow stage identifier corresponding to each flow stage in a service flow to be tested and a flow test parameter preset by a user;
205. acquiring business logic corresponding to each process stage of the business process to be tested according to the process stage identifier, wherein the business logic comprises a class name and a function name;
206. calling a unit test interface in a test environment, taking a class name and a function name corresponding to a first flow stage of a business flow to be tested and flow test parameters as input parameters of the unit test interface to perform unit test, obtaining and outputting inverse parameters of a current flow stage, taking the class name and the function name corresponding to a next flow stage and the inverse parameters of the current flow stage as input parameters of the unit test interface to perform unit test, obtaining and outputting the inverse parameters of the next flow stage until the inverse parameters of each flow stage are obtained;
207. and comparing the preset standard values of the counter participation of each process stage to determine an abnormal process stage and a non-abnormal process stage in the business process to be tested.
Wherein, the steps 204-207 are similar to the steps 102-104 described above, and detailed description thereof is omitted here.
In the embodiment, the process of constructing the test case is described in detail, and the test case is constructed through the primitive structure, so that the expression is clearer, the storage space is saved, and meanwhile, the adjustment and the modification of the test case are facilitated.
Referring to fig. 3, a third embodiment of the method for testing a service flow according to the embodiment of the present invention includes:
301. receiving a service process test request sent by a terminal, and acquiring a target service test case from a preset service test case set according to the service process test request, wherein the target service test case comprises process stage identifiers corresponding to each process stage in a service process to be tested and process test parameters preset by a user;
step 301 is similar to the step 101, and is not described herein again.
302. Receiving a service test request, and acquiring a shared program file corresponding to a plurality of application scenes and pointed by a service to be tested according to the service test request, wherein the shared program file comprises candidate service logics shared under the application scenes and application scene information of the candidate service logics;
it is understood that the service test request may be sent by the terminal, or may be sent by other devices or modules, for example, in an embodiment, under a test framework, the test framework includes some normal service modules, for example, a service module a, a service module B, and a service module C, the service module C may receive the service test request sent by the service module a, if a corresponding test program is matched, the test process is performed according to the test program in the service module C, and if the corresponding test program is not matched, the service test request may be forwarded to the service module B as before, wherein, for example, if the target application is an application dedicated to provide a safe, convenient, and professional online payment service for internet users and businesses, the information included in the service test request may be bank card number information, and business card number information, Information of the user, type information of the bank, amount of money, and the single number.
The shared program file refers to a program file shared under multiple application scenarios, and the program file may include candidate service logic, and the candidate service logic may be used to test a target application corresponding to the service test request. In an embodiment, the common program file may be a general stub program, and the stub program may be a stub program of an application scenario, such as an application scenario of an online tax payment, a bank deposit, a payment remittance, an external card, and a payment, and the stub program may be used for performing a business test in the application scenario.
The scene information of the candidate service logic is information for representing or identifying the scene where the candidate service logic is located, and each application scene has the corresponding scene information of the candidate service logic.
303. Matching application scene information in the service test request with application scene information of candidate service logics to determine a target service logic from the candidate service logics, wherein the target service logic comprises service logics corresponding to each process stage of a service process to be tested;
it can be understood that the application scenario information of the service test request is information characterizing or identifying a scenario in which the service is located, and may include, for example, information such as a scenario identifier. Obviously, the service test request may include scene information of one or more application scenes, such as scene information in the service request forwarding scene, scene information in the service modification scene, and scene information in the service interruption scene, and the like, and the scene information may be matched with the scene information in the common program file corresponding to the multiple application scenes, when a test service logic corresponding to the application scene information in the service test request is matched, a test is performed according to the test service logic, otherwise, the service test request is forwarded to another place.
The scene information of the candidate service logic can be used for matching with the scene information of the target application included in the service test request, when the scene information of the candidate service logic is matched with the scene information of the target application, the target service logic for testing the service is determined from the candidate service logic, and the target service logic tests the service.
Optionally, the common program file may be a general stub program, the general stub program may support different service requests according to flexible configuration, different application scenarios may have different logics, and the configuration may be easy, and rules may be newly added, for example, a new application scenario may be added, which may be implemented by adding a service logic of a test service in the new application scenario and scenario information corresponding to the service logic, so that the common program file may be updated without starting.
304. Acquiring business logic corresponding to each process stage of the business process to be tested according to the process stage identification, wherein the business logic comprises a class name and a function name;
305. calling a unit test interface in a test environment, taking a class name and a function name corresponding to a first flow stage of a business flow to be tested and flow test parameters as input parameters of the unit test interface to perform unit test, obtaining and outputting inverse parameters of a current flow stage, taking the class name and the function name corresponding to a next flow stage and the inverse parameters of the current flow stage as input parameters of the unit test interface to perform unit test, obtaining and outputting the inverse parameters of the next flow stage until the inverse parameters of each flow stage are obtained;
306. and comparing the preset standard values of the counter participation of each process stage to determine an abnormal process stage and a non-abnormal process stage in the business process to be tested.
The steps 304-306 are similar to the steps performed in the steps 102-104, and detailed description thereof is omitted here.
In this embodiment, a process of obtaining a corresponding service test logic in a corresponding scene according to a service test request is described in detail, and the service logic is distinguished in detail according to different scenes, so that the accuracy and flexibility of the test are improved.
Referring to fig. 4, a fourth embodiment of the method for testing a service flow according to the embodiment of the present invention includes:
401. receiving a service flow test request sent by a terminal, and acquiring a target service test case from a preset service test case set according to the service flow test request, wherein the target service test case comprises a flow stage identifier corresponding to each flow stage in a service flow to be tested and a flow test parameter preset by a user;
402. acquiring business logic corresponding to each process stage of the business process to be tested according to the process stage identifier, wherein the business logic comprises a class name and a function name;
403. calling a unit test interface in a test environment, taking a class name and a function name corresponding to a first flow stage of a business flow to be tested and flow test parameters as input parameters of the unit test interface to perform unit test, obtaining and outputting inverse parameters of a current flow stage, taking the class name and the function name corresponding to a next flow stage and the inverse parameters of the current flow stage as input parameters of the unit test interface to perform unit test, obtaining and outputting the inverse parameters of the next flow stage until the inverse parameters of each flow stage are obtained;
404. comparing preset standard values of the anti-participation of each process stage to determine an abnormal process stage and a non-abnormal process stage in the business process to be tested;
wherein, the steps 401-404 are similar to the execution steps of the steps 101-104, and detailed description thereof is omitted here.
405. Calculating the difference ratio between the anti-participation preset standard values of each abnormal process stage in the business process to be tested;
it is understood that the difference ratio may be a difference between a proportion of the normal process node in the abnormal test case and a proportion of the normal process node in the test standard, and when the difference ratio is of a numerical type, the difference ratio is obtained by dividing a difference between the standard value and the actual value (i.e., the back parameter) by the standard value, and when the difference ratio is of a non-numerical type, the server may determine a score corresponding to the actual value according to a preset score comparison relationship, and further divide the score by a score corresponding to the standard value to obtain the difference ratio.
406. Acquiring an abnormal grade comparison relation preset by a user from a database, and determining the abnormal grade of each abnormal process stage according to the abnormal grade comparison relation;
407. and generating a service test report based on a preset test report template and service test result data, and performing persistent storage on the service test report, wherein the service test result data comprises an abnormal flow stage, a non-abnormal flow stage and an abnormal grade of each abnormal flow stage.
It can be understood that the service test report is used for visualizing the test result data, the persistent storage can be conveniently viewed at any time, and the specific persistent storage mode is not limited in this embodiment. The developer can quickly evaluate the performance of the business service according to the report and position the defects of the business service to carry out version iteration, thereby improving the business quality.
In this embodiment, the process of processing the test result data is described in detail, the actual value is compared with the standard value to determine the abnormal grade, and the test result data is made into a service test report, so that the abnormal defect is conveniently located and reproduced, and the test efficiency is improved.
With reference to fig. 5, the method for testing a service flow in the embodiment of the present invention is described above, and a device for testing a service flow in the embodiment of the present invention is described below, where an embodiment of the device for testing a service flow in the embodiment of the present invention includes:
the test case obtaining module 501 is configured to receive a service flow test request sent by a terminal, and obtain a target service test case from a preset service test case set according to the service flow test request, where the target service test case includes a flow stage identifier corresponding to each flow stage in a service flow to be tested and a flow test parameter preset by a user;
a service logic obtaining module 502, configured to obtain, according to the process stage identifier, a service logic corresponding to each process stage of the service process to be tested, where the service logic includes a class name and a function name;
a unit test module 503, configured to invoke a unit test interface in a test environment, use the class name and function name corresponding to the first flow stage of the service flow to be tested and the flow test parameters as the input parameters of the unit test interface to perform unit test, obtain and output the inverse parameters of the current flow stage, use the class name and function name corresponding to the next flow stage and the inverse parameters of the current flow stage as the input parameters of the unit test interface to perform unit test, obtain and output the inverse parameters of the next flow stage until the inverse parameters of each flow stage are obtained;
an exception positioning module 504, configured to compare the preset standard values of the counter participation of each process stage to determine an abnormal process stage and a non-abnormal process stage in the business process to be tested.
In this embodiment, the business logic corresponding to each process stage is obtained, and the specific class name, function name, and initial test parameter or anti-parameter are used as the input parameters of the unit test interface to perform the unit test on each process stage, so as to obtain the anti-parameter of each process stage, and further directly compare the anti-parameter standard values to determine the abnormal process stage, so that the test efficiency is higher. .
Referring to fig. 6, another embodiment of the test apparatus for business process in the embodiment of the present invention includes:
the test case obtaining module 501 is configured to receive a service flow test request sent by a terminal, and obtain a target service test case from a preset service test case set according to the service flow test request, where the target service test case includes a flow stage identifier corresponding to each flow stage in a service flow to be tested and a flow test parameter preset by a user;
a service logic acquiring module 502, configured to acquire, according to the process stage identifier, a service logic corresponding to each process stage of the service process to be tested, where the service logic includes a class name and a function name;
a unit test module 503, configured to invoke a unit test interface in a test environment, use the class name and function name corresponding to the first flow stage of the service flow to be tested and the flow test parameters as the input parameters of the unit test interface to perform unit test, obtain and output the inverse parameters of the current flow stage, use the class name and function name corresponding to the next flow stage and the inverse parameters of the current flow stage as the input parameters of the unit test interface to perform unit test, obtain and output the inverse parameters of the next flow stage until the inverse parameters of each flow stage are obtained;
an exception positioning module 504, configured to compare the preset standard values of the counter participation of each process stage to determine an abnormal process stage and a non-abnormal process stage in the business process to be tested.
The anomaly locating module 504 specifically includes:
a difference ratio calculation unit 5041, configured to calculate a difference ratio between the preset standard values of the counter participation of each abnormal process stage in the business process to be tested;
the grade determining unit 5042 is configured to obtain an abnormal grade comparison relationship preset by a user from a database, and determine an abnormal grade of each abnormal process stage according to the abnormal grade comparison relationship;
the test report generating unit 5043 is configured to generate a service test report based on a preset test report template and service test result data, and persistently store the service test report, where the service test result data includes the abnormal process stage, the non-abnormal process stage, and an abnormal level of each abnormal process stage.
In the embodiment of the invention, the modularized design ensures that hardware of each part of the testing device of the business process is concentrated on realizing a certain function, the performance of the hardware is realized to the maximum extent, and meanwhile, the modularized design also reduces the coupling between the modules of the device, thereby being more convenient to maintain.
Fig. 5 and fig. 6 describe the test apparatus of the service flow in the embodiment of the present invention in detail from the perspective of the modular functional entity, and the test apparatus of the service flow in the embodiment of the present invention is described in detail from the perspective of the hardware processing.
Fig. 7 is a schematic structural diagram of a testing apparatus for business process according to an embodiment of the present invention, where the testing apparatus 700 for business process may have relatively large differences due to different configurations or performances, and may include one or more processors (CPUs) 710 (e.g., one or more processors) and a memory 720, one or more storage media 730 (e.g., one or more mass storage devices) for storing applications 733 or data 732. Memory 720 and storage medium 730 may be, among other things, transient storage or persistent storage. The program stored on the storage medium 730 may include one or more modules (not shown), each of which may include a series of instruction operations in the test equipment 700 for a business process. Further, the processor 710 may be configured to communicate with the storage medium 730, and execute a series of instruction operations in the storage medium 730 on the test equipment 700 of the business process.
The business process test apparatus 700 may also include one or more power supplies 740, one or more wired or wireless network interfaces 750, one or more input-output interfaces 760, and/or one or more operating systems 731, such as Windows Server, Mac OS X, Unix, Linux, FreeBSD, and the like. Those skilled in the art will appreciate that the configuration of the test equipment for a business process illustrated in FIG. 7 does not constitute a limitation of the test equipment for a business process, and may include more or fewer components than illustrated, or some components may be combined, or a different arrangement of components.
The invention further provides a test device of the business process, which includes a memory and a processor, where the memory stores computer readable instructions, and when the computer readable instructions are executed by the processor, the processor executes the steps of the test method of the business process in the above embodiments.
The present invention also provides a computer-readable storage medium, which may be a non-volatile computer-readable storage medium, and may also be a volatile computer-readable storage medium, having stored therein instructions, which, when run on a computer, cause the computer to perform the steps of the method for testing a business process.
It is clear to those skilled in the art that, for convenience and brevity of description, the specific working processes of the above-described systems, apparatuses and units may refer to the corresponding processes in the foregoing method embodiments, and are not described herein again.
The integrated unit, if implemented in the form of a software functional unit and sold or used as a stand-alone product, may be stored in a computer readable storage medium. Based on such understanding, the technical solution of the present invention may be embodied in the form of a software product, which is stored in a storage medium and includes instructions for causing a computer device (which may be a personal computer, a server, or a network device) to execute all or part of the steps of the method according to the embodiments of the present invention. And the aforementioned storage medium includes: a U-disk, a portable hard disk, a read-only memory (ROM), a Random Access Memory (RAM), a magnetic disk, an optical disk, or other various media capable of storing program codes.
The above-mentioned embodiments are only used for illustrating the technical solutions of the present invention, and not for limiting the same; although the present invention has been described in detail with reference to the foregoing embodiments, it will be understood by those of ordinary skill in the art that: the technical solutions described in the foregoing embodiments may still be modified, or some technical features may be equivalently replaced; and such modifications or substitutions do not depart from the spirit and scope of the corresponding technical solutions of the embodiments of the present invention.

Claims (10)

1. A method for testing a business process is characterized in that the method for testing the business process comprises the following steps:
receiving a service flow test request sent by a terminal, and acquiring a target service test case from a preset service test case set according to the service flow test request, wherein the target service test case comprises a flow stage identifier corresponding to each flow stage in a service flow to be tested and a flow test parameter preset by a user;
acquiring business logic corresponding to each process stage of the business process to be tested according to the process stage identification, wherein the business logic comprises a class name and a function name;
calling a unit test interface in a test environment, taking a class name and a function name corresponding to a first flow stage of the business flow to be tested and the flow test parameters as input parameters of the unit test interface to perform unit test, obtaining and outputting reverse parameters of a current flow stage, taking the class name and the function name corresponding to a next flow stage and the reverse parameters of the current flow stage as the input parameters of the unit test interface to perform unit test, obtaining and outputting the reverse parameters of the next flow stage until the reverse parameters of each flow stage are obtained;
and comparing the preset standard values of the counter participation of each process stage to determine an abnormal process stage and a non-abnormal process stage in the business process to be tested.
2. The method for testing a business process according to claim 1, wherein before the receiving the business process test request sent by the terminal and acquiring the target business test case from a preset business test case set according to the business process test request, the method further comprises:
receiving a service test request sent by a terminal, and determining at least one process node sequence corresponding to a service to be tested according to a service name parameter carried in the service test request, wherein the service to be tested consists of at least one service process, the service processes are independent from each other, and each service process corresponds to one process node sequence;
and constructing a corresponding test case based on each flow node sequence corresponding to the service to be tested, and generating a service test case set for expressing the test logic of the service to be tested according to the constructed test case.
3. The business process testing method of claim 2, wherein the constructing a corresponding test case based on each process node sequence corresponding to the business to be tested, and generating the business test case set for representing the test logic of the business to be tested according to the constructed test case comprises:
constructing a directed acyclic graph for representing service logic based on a plurality of process nodes and an arrangement sequence thereof contained in each process node sequence corresponding to the service to be tested, wherein the directed acyclic graph comprises a plurality of primitive nodes and directed edges connecting the primitive nodes, each primitive node corresponds to each process node, and the directed edges are used for indicating an execution sequence of the process nodes;
and traversing paths of the directed acyclic graph based on the primitive organization structure of the directed acyclic graph, determining each traversed path as a primitive test case, and generating a service test case set for expressing the test logic of the service to be tested according to the determined test cases.
4. The method for testing the business process according to claim 1, wherein before the obtaining the business logic corresponding to each process stage of the business process to be tested according to the process stage identifier, the method further comprises:
receiving a service test request, and acquiring a shared program file corresponding to a plurality of application scenes and pointed by the service to be tested according to the service test request, wherein the shared program file comprises candidate service logics shared under the application scenes and application scene information of the candidate service logics;
and matching the application scene information in the service test request with the application scene information of the candidate service logic so as to determine a target service logic from the candidate service logic, wherein the target service logic comprises the service logic corresponding to each process stage of the service process to be tested.
5. The method for testing a business process of claim 4, wherein the method further comprises:
receiving a program increasing request of a new application scene sent by a terminal;
and based on the program adding request, adding the service logic for testing under the new application scenario and the application scenario information corresponding to the service logic in the common program file to update the common program file.
6. The method for testing a business process according to any one of claims 1 to 5, wherein the method further comprises:
calculating the difference ratio between the preset standard values of the counter participation of each abnormal process stage in the business process to be tested;
and acquiring an abnormal grade comparison relation preset by a user from a database, and determining the abnormal grade of each abnormal process stage according to the abnormal grade comparison relation.
7. The method for testing a business process of claim 6, further comprising:
generating a service test report based on a preset test report template and service test result data, and performing persistent storage on the service test report, wherein the service test result data comprises the abnormal process stages, the non-abnormal process stages and the abnormal grade of each abnormal process stage.
8. A test device for a business process is characterized in that the test device for the business process comprises:
the system comprises a test case acquisition module, a service flow test module and a service flow test module, wherein the test case acquisition module is used for receiving a service flow test request sent by a terminal and acquiring a target service test case from a preset service test case set according to the service flow test request, and the target service test case comprises flow stage identifications corresponding to flow stages in a service flow to be tested and flow test parameters preset by a user;
a service logic acquisition module, configured to acquire, according to the process stage identifier, a service logic corresponding to each process stage of the service process to be tested, where the service logic includes a class name and a function name;
the unit testing module is used for calling a unit testing interface in a testing environment, taking a class name and a function name corresponding to a first flow stage of the business flow to be tested and the flow testing parameters as the input parameters of the unit testing interface to carry out unit testing, obtaining and outputting the inverse parameters of the current flow stage, taking the class name and the function name corresponding to the next flow stage and the inverse parameters of the current flow stage as the input parameters of the unit testing interface to carry out unit testing, obtaining and outputting the inverse parameters of the next flow stage until the inverse parameters of each flow stage are obtained;
and the abnormal positioning module is used for comparing the anti-participation preset standard values of all the process stages to determine an abnormal process stage and a non-abnormal process stage in the business process to be tested.
9. A test device for a business process, the test device for a business process comprising: a memory and at least one processor, the memory having instructions stored therein;
the at least one processor invokes the instructions in the memory to cause the test equipment of the business process to perform the method of testing the business process of any of claims 1-7.
10. A computer-readable storage medium having instructions stored thereon, wherein the instructions, when executed by a processor, implement a method of testing a business process according to any one of claims 1-7.
CN202210242228.6A 2022-03-11 2022-03-11 Method, device and equipment for testing business process and storage medium Pending CN114610619A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202210242228.6A CN114610619A (en) 2022-03-11 2022-03-11 Method, device and equipment for testing business process and storage medium

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202210242228.6A CN114610619A (en) 2022-03-11 2022-03-11 Method, device and equipment for testing business process and storage medium

Publications (1)

Publication Number Publication Date
CN114610619A true CN114610619A (en) 2022-06-10

Family

ID=81863808

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202210242228.6A Pending CN114610619A (en) 2022-03-11 2022-03-11 Method, device and equipment for testing business process and storage medium

Country Status (1)

Country Link
CN (1) CN114610619A (en)

Similar Documents

Publication Publication Date Title
CN109117363B (en) Test case generation method and device and server
CN107665171B (en) Automatic regression testing method and device
CN107807982B (en) Consistency checking method and device for heterogeneous database
CN110554958B (en) Graph database testing method, system, device and storage medium
US9483387B1 (en) Tree comparison functionality for services
CN111722839B (en) Code generation method and device, electronic equipment and storage medium
CN112306881B (en) Analog data generation method, device, equipment and storage medium
CN112181804A (en) Parameter checking method, equipment and storage medium
CN110750433A (en) Interface test method and device
CN112148619A (en) Test case suite optimization processing method and device, electronic equipment and storage medium
CN110764999A (en) Automatic testing method and device, computer device and storage medium
CN112612813A (en) Test data generation method and device
US10558557B2 (en) Computer system testing
CN114048129A (en) Automatic testing method, device, equipment and system for software function change
CN110046086B (en) Expected data generation method and device for test and electronic equipment
CN115599359A (en) Code generation method, device, equipment and medium
CN112559525B (en) Data checking system, method, device and server
CN110221933A (en) Aacode defect assists restorative procedure and system
CN111966597B (en) Test data generation method and device
CN114610619A (en) Method, device and equipment for testing business process and storage medium
CN115840560A (en) Management system for software development process
CN109597828A (en) A kind of off-line data checking method, device and server
CN114942905A (en) Migration data verification method, device, equipment and storage medium
CN109840213B (en) Test data creating method, device, terminal and storage medium for GUI test
CN112307088A (en) Method, device and equipment for inquiring state of process node 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