CN117194253B - Method and system for generating test data of service scene - Google Patents

Method and system for generating test data of service scene Download PDF

Info

Publication number
CN117194253B
CN117194253B CN202311170659.7A CN202311170659A CN117194253B CN 117194253 B CN117194253 B CN 117194253B CN 202311170659 A CN202311170659 A CN 202311170659A CN 117194253 B CN117194253 B CN 117194253B
Authority
CN
China
Prior art keywords
target
test data
service
service scene
scene
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Active
Application number
CN202311170659.7A
Other languages
Chinese (zh)
Other versions
CN117194253A (en
Inventor
李桂英
肖峰
潘虎
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
E Fund Management Co ltd
Original Assignee
E Fund 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 E Fund Management Co ltd filed Critical E Fund Management Co ltd
Priority to CN202311170659.7A priority Critical patent/CN117194253B/en
Publication of CN117194253A publication Critical patent/CN117194253A/en
Application granted granted Critical
Publication of CN117194253B publication Critical patent/CN117194253B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Classifications

    • 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
    • Y02DCLIMATE CHANGE MITIGATION TECHNOLOGIES IN INFORMATION AND COMMUNICATION TECHNOLOGIES [ICT], I.E. INFORMATION AND COMMUNICATION TECHNOLOGIES AIMING AT THE REDUCTION OF THEIR OWN ENERGY USE
    • Y02D10/00Energy efficient computing, e.g. low power processors, power management or thermal management

Abstract

The invention discloses a method and a system for generating test data of a service scene, wherein the method comprises the steps of determining a target service scene according to a user test requirement, and receiving service scene parameters and a target environment corresponding to the target service scene; determining a current generation mode according to a target service scene and a preset mapping relation; the method comprises the steps that a pre-configured mapping relation is obtained by establishing a corresponding relation between a service scene and a test data generation mode; and mapping out a target address according to the target environment and the current generation mode, and generating test data corresponding to the target service scene to the target environment according to the current generation mode based on the target address and the service scene parameters. And generating test data corresponding to any business scene to the current target environment by any business scene in the selected business scene list and the current target environment. The embodiment realizes the rapid and automatic generation of the test data, supports the generation of the test data in any target environment, and has high flexibility.

Description

Method and system for generating test data of service scene
Technical Field
The present invention relates to the field of service data processing, and in particular, to a method and system for generating test data of a service scenario.
Background
In the financial field, the testing process often requires various types of testing data support, such as account data of different sales institutions, asset data of different financial products, and various transaction limitations of the financial products.
In the prior art, SQL scripts or application interfaces are relied on to generate test data, the precipitability of the mode is very low, the maintainability is poor, the service capability of a generating person and the familiarity degree of the system are relied on, the test work is often carried out in a plurality of different environments, and the test data of the same service scene needs to be generated in different environments, so that very high cost is often required. Firstly, the difference of the test data is not generated by shielding different modes such as SQL script or application interface, and the like, and the specific mode needs to be adopted to generate a plurality of decisions, so that a great deal of manual intervention is needed, and automation cannot be realized. And secondly, the generation of test data in a plurality of different test environments cannot be flexibly supported, and the flexibility is low. Finally, the hot scene cannot be displayed, test data cannot be generated directly according to the hot scene, and the data generating efficiency is low.
Disclosure of Invention
The invention provides a test data generation method and a test data generation system for a service scene, which realize rapid and automatic generation of test data, support generation of test data in any target environment and have high flexibility.
In order to solve the above technical problems, an embodiment of the present invention provides a method for generating test data of a service scenario, including:
Determining a target service scene according to a user test requirement, and receiving service scene parameters and a target environment corresponding to the target service scene; the target environment comprises a smoking test environment, an integrated test environment and a regression verification environment;
Determining a current generation mode according to a target service scene and a preset mapping relation; the method comprises the steps that a pre-configured mapping relation is obtained by establishing a corresponding relation between a service scene and a test data generation mode;
and mapping out a target address according to the target environment and the current generation mode, and generating test data corresponding to the target service scene to the target environment according to the current generation mode based on the target address and the service scene parameters.
According to the embodiment of the invention, a target service scene is determined according to the user test requirement, and the service scene parameters and the target environment corresponding to the target service scene are received; the target environment comprises a smoking test environment, an integrated test environment and a regression verification environment; determining a current generation mode according to a target service scene and a preset mapping relation; the method comprises the steps that a pre-configured mapping relation is obtained by establishing a corresponding relation between a service scene and a test data generation mode; and mapping out a target address according to the target environment and the current generation mode, and generating test data corresponding to the target service scene to the target environment according to the current generation mode based on the target address and the service scene parameters. The flexible generation number scene is provided through parameterization, the generation of test data in any target environment is supported, the generation of test data in various different modes is supported, the generation of test data in various complex scenes is supported, a data demand party does not need to care about a specific data generation mode, and the test data can be generated only by providing a service scene, service scene parameters and target environment. The method has the advantages that the difference of different generation number methods is shielded, various modes such as external service, local function, data block service and the like are supported, a specific generation number mode is not required to be focused, only a business scene is required to be focused, the generation of test data is completed according to a preset mapping relation, the rapid and automatic generation of the test data is realized, the flexibility is high, the switching among different environments is flexibly supported, and the generation cost of the test data cannot be increased due to the environmental difference.
As a preferred scheme, according to the target service scene and the pre-configured mapping relation, determining the current generation mode specifically includes:
Receiving a service scene ID corresponding to a target service scene;
Mapping out a test data generation mode corresponding to the service scene ID according to a pre-configured mapping relation to obtain a current generation mode;
the test data generation mode comprises an external service mode, a local function mode and a data block service mode.
As a preferred scheme, based on the target address and the service scene parameter, test data corresponding to the target service scene is generated to the target environment in a current generation mode, specifically:
When the current generation mode is an external service mode, according to the target address and the service scene parameters, an external interface is called through an HTTP request to generate test data corresponding to a target service scene to a target environment;
When the current generation mode is a local function mode, generating test data corresponding to a target service scene to a target environment by calling a function in a configured JAR packet according to the service scene parameters;
When the current generation mode is a data block service mode, generating test data corresponding to a target service scene to a target environment through a database script according to the target address and the service scene parameters.
As a preferred scheme, according to the target address and the service scene parameter, an external interface is called through an HTTP request to generate test data corresponding to the target service scene to the target environment, specifically:
Based on the HTTP protocol, calling an AP I interface of a target address through an HTTP request, and setting the participation of the AP I interface as a service scene parameter;
If the access parameters of the AP I interface are not null, the external equipment generates and returns test data corresponding to the target service scene according to the appointed access operation codes;
If the access parameters of the AP I interface are null, enabling the external equipment to randomly generate required operation parameters according to a preset algorithm, generating test data corresponding to the target service scene according to the operation parameters operation codes, and returning the test data corresponding to the target service scene to the target environment.
As a preferred solution, according to the service scenario parameters, test data corresponding to the target service scenario is generated to the target environment by calling a function in the configured JAR packet, specifically:
Analyzing key information of the JAR package, positioning a java method according to the key information, setting the participation of the java method as a service scene parameter, calling and operating the java method, and generating test data corresponding to a target service scene to a target environment;
Wherein the key information includes path, package name, class name and method name.
As a preferred scheme, according to the target address and the service scene parameter, test data corresponding to the target service scene is generated to the target environment through the database script, specifically:
Generating test data through a database script, connecting the database through a target address, transmitting service scene parameters into a current database script corresponding to a target service scene, taking the service scene parameters as parameters for executing the current database script, enabling the current database script to be executed according to a preset step sequence, generating the test data corresponding to the target service scene, and returning the test data corresponding to the target service scene to a target environment;
wherein, a database script is packaged into a step, and a plurality of steps are packaged into a service scene.
As a preferred solution, after generating test data corresponding to the target service scene to the target environment according to the target address and the service scene parameter by using the current generation mode, the method further includes:
And adding 1 to the generation times corresponding to the target service scene, sequencing the generation times corresponding to all the service scenes to generate a service scene list, and generating test data corresponding to any service scene to the current target environment according to any service scene in the service scene list selected by the current user and the current target environment.
In order to solve the same technical problem, the embodiment of the present invention further provides a test data generating system for a service scenario, including: the system comprises a business scene management module, an environment management module, a test data generation module and a data display module; the test data generation module is used for executing a test data generation method of the service scene;
the business scene management module is used for managing business scenes, configuring the mapping relation between the business scenes and the test data generation mode, configuring a database script and configuring key information of the JAR package;
The environment management module is used for configuring a target environment and configuration target information required by a test data generation mode, wherein the configuration target information comprises an http target address, a database link address and a database user password;
The data display module is used for displaying each service scene, the parameters of each service scene and the ranking list of the preset number of service scenes.
In order to solve the same technical problems, the embodiment of the invention also provides a computer device, which comprises a processor and a memory, wherein the memory is used for storing a computer program, and the computer program is executed by the processor to realize a test data generation method of a service scene.
To solve the same technical problem, the embodiment of the invention further provides a computer readable storage medium storing a computer program, which when executed by a processor, implements a method for generating test data of a service scenario.
Drawings
Fig. 1: a flow diagram of an embodiment of a method for generating test data of a service scenario provided by the invention;
Fig. 2: a simplified flowchart of generating test data for an embodiment of a test data generating method of a service scenario provided by the present invention;
Fig. 3: establishing a corresponding relation diagram of a service scene and a test data generation mode for one embodiment of the test data generation method of the service scene;
Fig. 4: the invention provides an updating business scene list chart of one embodiment of a test data generation method of a business scene;
Fig. 5: the invention provides a structural schematic diagram of an embodiment of a test data generation system of a service scene.
Detailed Description
The following description of the embodiments of the present invention will be made clearly and completely with reference to the accompanying drawings, in which it is apparent that the embodiments described are only some embodiments of the present invention, but not all embodiments. All other embodiments, which can be made by those skilled in the art based on the embodiments of the invention without making any inventive effort, are intended to be within the scope of the invention.
Example 1
Referring to fig. 1, a flow chart of a method for generating test data of a service scenario according to an embodiment of the present invention is shown. According to the embodiment, the current generation mode is determined according to the target service scene and the pre-configured mapping relation, and test data corresponding to the target service scene is generated to the target environment through the current generation mode. The test data generation method comprises steps 101 to 103, wherein the steps are as follows:
step 101: determining a target service scene according to a user test requirement, and receiving service scene parameters and a target environment corresponding to the target service scene; the target environment comprises a smoking test environment, an integrated test environment and a regression verification environment.
In this embodiment, a simplified flow of generating test data is shown in fig. 2, where a service scenario is accepted (received), a service scenario parameter is accepted (received), a target environment is accepted (received), a generation mode is mapped according to the service scenario, a target address is mapped according to the target environment and the generation mode, the test data is generated according to the service scenario parameter by adopting the generation mode and the target address, and a generation result is returned.
Specifically, the service scenario is determined according to the user test requirement, and as an example of the embodiment, for example: the test requirement is to verify that the new customer does not hold the asset display condition of the asset and needs a new account opening account, a service scene of opening an account can be defined, and after the service scene of opening an account is received, an account return of the new account opening is generated. For example: testing redemption of the personal pension requires an account with the personal pension asset, a business scenario "get account with the personal pension asset" can be defined, and receiving this business scenario gets an account with the personal pension asset. For example: a scenario of a financial product transaction time limit is tested, a business scenario of "product transaction time limit setting" may be defined, and a product is set to be within the transaction limit time when the business scenario is accepted.
Specifically, the service scene can generate more definite test data by receiving different parameters, and parameterization can enable the test data generated by the service scene to be more flexible, and can generate more definite and fine test data. Receiving a service scene parameter corresponding to a target service scene, as an example of the embodiment, for example: the account opening can be performed by specifying personal information such as the name, certificate number, bank card number and the like of the customer who opens the account, and the personal information is randomly generated when the personal information is not specified. For example: setting the financial product trade time limit may specify which product trade time limit is specifically set, and when not specified, one product is randomly selected. For example: the business scenario "set foundation workday" sets a start date as a parameter, and the received parameter may be a month, a quarter, a year, and foundation workday spanning any start time interval of several years, etc.
By implementing the embodiment of the invention, the target environment can be a smoke test environment, an integrated test environment or a regression verification environment and the like. The method flexibly supports the generation of test data in a plurality of different sets of test environments (target environments), flexibly supports the switching among different environments, and does not increase the generation cost of the test data due to the environmental difference.
Step 102: determining a current generation mode according to a target service scene and a preset mapping relation; the pre-configured mapping relation is obtained by establishing a corresponding relation between a service scene and a test data generation mode.
In this embodiment, a pre-configured mapping relationship is obtained by establishing a corresponding relationship between a service scenario and a test data generation manner, and by configuring, a corresponding relationship between a service scenario and a test data generation manner is established, as shown in fig. 3, where the service scenario may be mapped to one of three generation manners of external service, local function, or data block service. If the test data is the external service, the test data is generated by calling an external interface through an HTTP request. If the function is a local function, the test data is generated by calling the function in the JAR package. If the service is the data block service, the test data is generated through SQL script.
It should be noted that, the user may select a service scenario, which may be a popular scenario or specify a keyword search, and the service scenario may solidify parameters to only support a certain fixed generation number, or may parameterize and determine specified generation data, for example, the client account type may directly select a scenario generation number of a direct sales client type, or specify whether a direct sales client is a direct sales client or a replacement sales client, or a direct replacement sales client, through parameters.
By implementing the embodiment of the invention, the prior art does not shield SQL script or application interface and other different modes to generate the difference of the test data, and specifically adopts which mode needs to generate a plurality of decisions. In the invention, mapping is carried out according to the service scene and the test data generation mode, the current test data generation mode is automatically selected according to the service scene, the difference of different generation methods is shielded, various modes such as external service, local function and data block service are supported, the specific generation number mode is not required to be focused, and the generation of the test data can be completed according to the preset mapping relation only by focusing on the service scene.
Optionally, step 102 specifically includes: receiving a service scene ID corresponding to a target service scene; mapping out a test data generation mode corresponding to the service scene ID according to a pre-configured mapping relation to obtain a current generation mode; the test data generation mode comprises an external service mode, a local function mode and a data block service mode.
In this embodiment, the defined service scenario has a unique ID, different service scenarios are distinguished by the ID, the service scenario ID is received, and one of three test data generation modes corresponding to external service, local function or data block service is mapped according to the mapping relationship configured in the service scenario management module. The business scene management module configures the mapping relation between each business scene and external service, local function and data block service.
Step 103: and mapping out a target address according to the target environment and the current generation mode, and generating test data corresponding to the target service scene to the target environment according to the current generation mode based on the target address and the service scene parameters.
In this embodiment, the target environment may be a smoke test environment, an integrated test environment, a regression verification environment, or the like, and the target environment may be generated according to user selection. And configuring target addresses of three generation modes of the target environment in the environment management module. After the generating mode is mapped according to the service scene, the target address can be mapped according to the received target environment and the generating mode, test data are generated by adopting the generating mode and the target address, and a data generating result is returned.
Optionally, step 103 specifically includes steps 1031 to 1033, where each step specifically includes:
Step 1031: when the current generation mode is an external service mode, according to the target address and the service scene parameters, an external interface is called through an HTTP request to generate test data corresponding to a target service scene to a target environment;
Optionally, step 1031 specifically includes: based on the HTTP protocol, calling an AP I interface of a target address through an HTTP request, and setting the participation of the AP I interface as a service scene parameter;
If the access parameters of the AP I interface are not null, the external equipment generates and returns test data corresponding to the target service scene according to the appointed access operation codes;
If the access parameters of the AP I interface are null, enabling the external equipment to randomly generate required operation parameters according to a preset algorithm, generating test data corresponding to the target service scene according to the operation parameters operation codes, and returning the test data corresponding to the target service scene to the target environment.
In this embodiment, when external service mode is needed to generate test data, the test data is generated through the AP I interface of the HTTP protocol, the AP I interface of the target address is called, the access parameters of the AP I interface are service scene parameters, if the access parameters are not null, the test data return is generated according to the designated access operation codes, and if the access parameters are null, the system generates the test data return according to the parameter operation codes required by the algorithm random generation.
Step 1032: when the current generation mode is a local function mode, generating test data corresponding to a target service scene to a target environment by calling a function in a configured JAR packet according to the service scene parameters;
optionally, step 1032 specifically includes: analyzing key information of the JAR package, positioning a java method according to the key information, setting the participation of the java method as a service scene parameter, calling and operating the java method, and generating test data corresponding to a target service scene to a target environment;
Wherein the key information includes path, package name, class name and method name.
In this embodiment, when the test data needs to be generated by adopting the local function mode, the java method in the jar packet is executed to generate the test data. Analyzing the configured jar packet path, packet name, class name and method name, positioning the java method, taking the parameter of the java method as a service scene parameter, and running the java method to generate test data and returning the test data.
Step 1033: when the current generation mode is a data block service mode, generating test data corresponding to a target service scene to a target environment through a database script according to the target address and the service scene parameters.
Optionally, step 1033 specifically includes: generating test data through a database script, connecting the database through a target address, transmitting service scene parameters into a current database script corresponding to a target service scene, taking the service scene parameters as parameters for executing the current database script, enabling the current database script to be executed according to a preset step sequence, generating the test data corresponding to the target service scene, and returning the test data corresponding to the target service scene to a target environment;
wherein, a database script is packaged into a step, and a plurality of steps are packaged into a service scene.
In this embodiment, when the test data needs to be generated by adopting the data block service mode, the test data is generated by the database script, the target address is connected to the database, and the database script is executed to generate the test data and return. And taking the input business scene parameters as parameters for executing database scripts, packaging each database script into one step, packaging a plurality of steps into one business scene, executing the database scripts according to the step sequence to generate test data, and returning.
Step 104: and adding 1 to the generation times corresponding to the target service scene, sequencing the generation times corresponding to all the service scenes to generate a service scene list, and generating test data corresponding to any service scene to the current target environment according to any service scene in the service scene list selected by the current user and the current target environment.
In this embodiment, the service scenario list is updated, as shown in fig. 4, the number of times of generation is 0 when the service scenario is initially configured, and after the service scenario is received and the data of the service scenario is generated, the number of times of generation of the service scenario is increased by 1. And sequencing all the service scene generation times to generate a service scene list, updating the popular scene ranking list in real time, and generating a topN popular list. Based on the list, selecting a service scene, and generating new test data according to the required target environment.
By implementing the embodiment of the invention, the hot scenes can be displayed preferentially according to the use frequency, the real-time sequencing of the hot high-frequency generation number scenes is supported, new test data in the service scenes are generated directly according to the selected service scenes and the required target environments, the test data of the scenes are obtained, the time for searching the generation number scenes is reduced, and the generation number efficiency is improved.
By implementing the embodiment of the invention, flexible generation number scenes are provided through parameterization, test data are supported to be generated in any target environment, and are generated in various different modes, the test data of various complex scenes are supported to be generated, and the data demander can generate the test data only by providing service scenes, service scene parameters and target environments without concerning about specific data generation modes. The method has the advantages that the difference of different generation number methods is shielded, various modes such as external service, local function, data block service and the like are supported, a specific generation number mode is not required to be focused, only a business scene is required to be focused, the generation of test data is completed according to a preset mapping relation, the rapid and automatic generation of the test data is realized, the flexibility is high, the switching among different environments is flexibly supported, and the generation cost of the test data cannot be increased due to the environmental difference.
Example two
Accordingly, referring to fig. 5, fig. 5 is a schematic structural diagram of a second embodiment of a test data generating system for a service scenario according to the present invention. As shown in fig. 5, the test data generating system of the service scenario includes a service scenario management module 501, an environment management module 502, a test data generating module 503 and a data display module 504; the test data generating module 503 is configured to execute a test data generating method of a service scenario;
in this embodiment, the test data generating module 503 generates test data to the target environment according to the received service scenario, scenario parameters and generation mode.
The service scenario management module 501 is configured to manage a service scenario, configure a mapping relationship between the service scenario and a test data generation mode, configure a database script, and configure key information of a JAR packet;
In this embodiment, the service scenario management module 501 is mainly used for defining a service scenario and configuring a mapping relationship between the service scenario and a generation mode, where a database script needs to be configured when a call mode is a data block service, and a jar packet path, a packet name, a class name and a method name need to be configured when the call mode is a local function.
The environment management module 502 is configured to configure a target environment and configuration target information required by a test data generation mode, where the configuration target information includes an http target address, a database link address and a database user password;
In this embodiment, the environment management module 502 is mainly used for configuring a target environment and information needed by three generation modes of each environment, such as an http target address, a database link address, a database user password, and the like.
The data display module 504 is configured to display each service scenario, parameters of each service scenario, and a preset number of service scenario ranking sheets.
In this embodiment, the data display module 504 is configured to display each service scenario, parameters of each service scenario, and a top service scenario list.
By implementing the embodiment of the invention, flexible generation number scenes are provided through parameterization, test data are supported to be generated in any target environment, and are generated in various different modes, the test data of various complex scenes are supported to be generated, and the data demander can generate the test data only by providing service scenes, service scene parameters and target environments without concerning about specific data generation modes.
In addition, the embodiment of the application also provides a computer device, which comprises a processor and a memory, wherein the memory is used for storing a computer program, and the computer program is executed by the processor to realize the steps in any of the method embodiments.
The embodiment of the application also provides a computer readable storage medium, wherein the computer readable storage medium stores a computer program, and the computer program realizes the steps in any of the method embodiments when being executed by a processor.
Embodiments of the present application provide a computer program product which, when run on a computer device, causes the computer device to perform the steps of the method embodiments described above.
The test data generating system of a service scenario described above may implement the test data generating method of a service scenario described in the above method embodiment. The options in the method embodiments described above are also applicable to this embodiment and will not be described in detail here. The rest of the embodiments of the present application may refer to the content of the above method embodiments, and in this embodiment, no further description is given.
The foregoing embodiments have been provided for the purpose of illustrating the general principles of the present invention, and are not to be construed as limiting the scope of the invention. It should be noted that any modifications, equivalent substitutions, improvements, etc. made by those skilled in the art without departing from the spirit and principles of the present invention are intended to be included in the scope of the present invention.

Claims (9)

1. The method for generating the test data of the service scene is characterized by comprising the following steps:
Determining a target service scene according to a user test requirement, and receiving service scene parameters and a target environment corresponding to the target service scene; the target environment comprises a smoking test environment, an integrated test environment and a regression verification environment;
Determining a current generation mode according to the target service scene and a pre-configured mapping relation; the pre-configured mapping relation is obtained by establishing a corresponding relation between a service scene and a test data generation mode;
The determining a current generating mode according to the target service scene and a pre-configured mapping relation specifically comprises:
receiving a service scene ID corresponding to the target service scene;
according to the pre-configured mapping relation, mapping out a test data generation mode corresponding to the service scene ID to obtain the current generation mode;
the test data generation mode comprises an external service mode, a local function mode and a data block service mode;
and mapping a target address according to the target environment and the current generation mode, and generating test data corresponding to the target service scene to the target environment through the current generation mode based on the target address and the service scene parameters.
2. The method for generating test data of a service scenario according to claim 1, wherein the generating test data corresponding to the target service scenario to the target environment by the current generating manner based on the target address and the service scenario parameter specifically includes:
When the current generation mode is the external service mode, according to the target address and the service scene parameter, an external interface is called through an HTTP request to generate test data corresponding to the target service scene to the target environment;
When the current generation mode is the local function mode, generating test data corresponding to the target service scene to the target environment by calling a function in a configured JAR packet according to the service scene parameters;
and when the current generation mode is the data block service mode, generating test data corresponding to the target service scene to the target environment through a database script according to the target address and the service scene parameter.
3. The method for generating test data of a service scenario according to claim 2, wherein the generating test data corresponding to the target service scenario to the target environment by calling an external interface through an HTTP request according to the target address and the service scenario parameter specifically comprises:
Based on an HTTP protocol, calling an API interface of the target address through the HTTP request, and setting the participation of the API interface as the service scene parameter;
if the parameter entering of the API interface is not null, the external equipment generates and returns test data corresponding to the target service scene according to the appointed parameter entering running code;
If the input parameters of the API interface are null, the external equipment randomly generates required operation parameters according to a preset algorithm, operates the codes according to the operation parameters, generates test data corresponding to the target service scene, and returns the test data corresponding to the target service scene to the target environment.
4. The method for generating test data of a service scenario according to claim 2, wherein the generating test data corresponding to the target service scenario to the target environment by calling a function in a configured JAR packet according to the service scenario parameter specifically includes:
Analyzing key information of the JAR package, positioning a java method according to the key information, setting the participation of the java method as the service scene parameter, calling and operating the java method, and generating test data corresponding to the target service scene to the target environment;
Wherein the key information includes path, package name, class name and method name.
5. The method for generating test data of a service scenario according to claim 2, wherein the generating test data corresponding to the target service scenario to the target environment through a database script according to the target address and the service scenario parameter specifically comprises:
generating test data through a database script, connecting the database through the target address, transmitting the service scene parameters into a current database script corresponding to the target service scene, taking the service scene parameters as parameters for executing the current database script, enabling the current database script to be executed according to a preset step sequence, generating the test data corresponding to the target service scene, and returning the test data corresponding to the target service scene to the target environment;
Wherein, one database script is packaged into one step, and a plurality of steps are packaged into one business scene.
6. The method for generating test data of a service scenario according to claim 1, further comprising, after said generating test data corresponding to said target service scenario to said target environment by said current generation method based on said target address and said service scenario parameter:
And adding 1 to the generation times corresponding to the target service scene, sequencing the generation times corresponding to all the service scenes to generate a service scene list, and generating test data corresponding to any service scene to the current target environment according to any service scene in the service scene list selected by the current user and the current target environment.
7. A system for generating test data for a business scenario, comprising: the system comprises a business scene management module, an environment management module, a test data generation module and a data display module; wherein the test data generating module is configured to execute the test data generating method of the service scenario according to any one of claims 1 to 6;
The business scene management module is used for managing business scenes, configuring the mapping relation between the business scenes and the test data generation mode, configuring a database script and configuring key information of a JAR package;
the environment management module is used for configuring a target environment and configuration target information required by the test data generation mode, wherein the configuration target information comprises an http target address, a database link address and a database user password;
the data display module is used for displaying each service scene, parameters of each service scene and a preset number of service scene ranking lists.
8. A computer device comprising a processor and a memory for storing a computer program which, when executed by the processor, implements the method of generating test data for a business scenario according to any one of claims 1 to 6.
9. A computer-readable storage medium, characterized in that it stores a computer program which, when executed by a processor, implements the test data generation method of a business scenario according to any one of claims 1 to 6.
CN202311170659.7A 2023-09-11 2023-09-11 Method and system for generating test data of service scene Active CN117194253B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202311170659.7A CN117194253B (en) 2023-09-11 2023-09-11 Method and system for generating test data of service scene

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202311170659.7A CN117194253B (en) 2023-09-11 2023-09-11 Method and system for generating test data of service scene

Publications (2)

Publication Number Publication Date
CN117194253A CN117194253A (en) 2023-12-08
CN117194253B true CN117194253B (en) 2024-04-19

Family

ID=88999394

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202311170659.7A Active CN117194253B (en) 2023-09-11 2023-09-11 Method and system for generating test data of service scene

Country Status (1)

Country Link
CN (1) CN117194253B (en)

Citations (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN111966597A (en) * 2020-08-18 2020-11-20 中国银行股份有限公司 Test data generation method and device
CN114138651A (en) * 2021-12-03 2022-03-04 马上消费金融股份有限公司 Test data generation method and device
CN114185770A (en) * 2021-11-22 2022-03-15 招联消费金融有限公司 Method and device for generating test data, computer equipment and storage medium
CN115168205A (en) * 2022-07-08 2022-10-11 中国银行股份有限公司 Automatic testing method and device
CN115509942A (en) * 2022-10-26 2022-12-23 平安银行股份有限公司 Test data generation method, device, equipment and storage medium
CN116561003A (en) * 2023-05-18 2023-08-08 中国工商银行股份有限公司 Test data generation method, device, computer equipment and storage medium

Family Cites Families (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US9977821B2 (en) * 2014-11-26 2018-05-22 Wipro Limited Method and system for automatically generating a test artifact

Patent Citations (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN111966597A (en) * 2020-08-18 2020-11-20 中国银行股份有限公司 Test data generation method and device
CN114185770A (en) * 2021-11-22 2022-03-15 招联消费金融有限公司 Method and device for generating test data, computer equipment and storage medium
CN114138651A (en) * 2021-12-03 2022-03-04 马上消费金融股份有限公司 Test data generation method and device
CN115168205A (en) * 2022-07-08 2022-10-11 中国银行股份有限公司 Automatic testing method and device
CN115509942A (en) * 2022-10-26 2022-12-23 平安银行股份有限公司 Test data generation method, device, equipment and storage medium
CN116561003A (en) * 2023-05-18 2023-08-08 中国工商银行股份有限公司 Test data generation method, device, computer equipment and storage medium

Non-Patent Citations (3)

* Cited by examiner, † Cited by third party
Title
Thal, S (Thal, Silvia) Etc..Generic Detection and Search-based Test Case Generation of Urban Scenarios based on Real Driving Data. 2022 IEEE INTELLIGENT VEHICLES SYMPOSIUM.2022,全文. *
杨莹 ; .基于Jmeter的智能法律问答系统性能测试.计算机测量与控制.2019,(12),全文. *
谢瑞麟 等.IATG: 基于解释分析的自动驾驶软件测试方法.软件学报.2023,全文. *

Also Published As

Publication number Publication date
CN117194253A (en) 2023-12-08

Similar Documents

Publication Publication Date Title
CN107861870B (en) Interface test and test data generation method, device, terminal and storage medium
US8141043B2 (en) Automated business process testing that spans multiple platforms or applications
US10534586B2 (en) Method, system and apparatus for visual programming of interaction workflows for omni-channel customer contact centers with integrated customer relationship management
US11809458B2 (en) System and method for providing database abstraction and data linkage
CN109446071A (en) Interface test method, interface test device, electronic equipment and storage medium
CN109308266A (en) Construction method, test method, device, equipment and the medium of test case
US20070174390A1 (en) Customer service management
US7917896B2 (en) Extensible execution language
US20180332022A1 (en) Non-repeatable challenge-response authentication
CN107908543A (en) Applied program testing method, device, computer equipment and storage medium
CN109345190B (en) Data processing method and device
US10922058B2 (en) Method, system and apparatus for visual programming of interaction workflows for omni-channel customer contact centers with integrated customer relationship management
CN110377522A (en) The test method for scene of trading, calculates equipment and medium at device
JP6963062B1 (en) Information processing device and information processing method
US10628210B2 (en) System and method for enabling API interoperability
US10180900B2 (en) Recordation of user interface events for script generation
CN117194253B (en) Method and system for generating test data of service scene
CN115629743A (en) Service component arranging method, service scheduling method and device, electronic equipment and storage medium
CN110334019A (en) A kind of test method, device and readable storage medium storing program for executing
CN105512020B (en) Test method and device
CN113127335A (en) System testing method and device
CN116400913A (en) Business process generation method and device
CN109614603A (en) Method and apparatus for generating information
CN111338935B (en) Method and system for joint debugging
US20220138669A1 (en) Communication system for managing distribution of products and a method thereof

Legal Events

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