CN115509942A - Test data generation method, device, equipment and storage medium - Google Patents

Test data generation method, device, equipment and storage medium Download PDF

Info

Publication number
CN115509942A
CN115509942A CN202211319390.XA CN202211319390A CN115509942A CN 115509942 A CN115509942 A CN 115509942A CN 202211319390 A CN202211319390 A CN 202211319390A CN 115509942 A CN115509942 A CN 115509942A
Authority
CN
China
Prior art keywords
scene
data
service
target
action
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
CN202211319390.XA
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 Bank Co Ltd
Original Assignee
Ping An Bank 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 Bank Co Ltd filed Critical Ping An Bank Co Ltd
Priority to CN202211319390.XA priority Critical patent/CN115509942A/en
Publication of CN115509942A publication Critical patent/CN115509942A/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
    • G06F16/00Information retrieval; Database structures therefor; File system structures therefor
    • G06F16/20Information retrieval; Database structures therefor; File system structures therefor of structured data, e.g. relational data
    • G06F16/21Design, administration or maintenance of databases
    • G06F16/211Schema design and management
    • G06F16/212Schema design and management with details for data modelling support
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F16/00Information retrieval; Database structures therefor; File system structures therefor
    • G06F16/20Information retrieval; Database structures therefor; File system structures therefor of structured data, e.g. relational data
    • G06F16/25Integrating or interfacing systems involving database management systems

Abstract

The embodiment of the invention relates to the field of data processing, and discloses a test data generation method, a device, equipment and a storage medium, wherein the method comprises the following steps: receiving a number making request, wherein the number making request comprises a target integrated scene identifier and a link parameter; generating a scene chain according to the target integrated scene identifier and the link parameter; acquiring a service scene associated with a scene chain from a historical integrated scene, and determining a data calling method of the service scene, wherein the service scene comprises an interface calling scene and a data query scene; and based on the service scene, adopting a modeling model to call a data calling method and a preset modeling database to construct test data. According to the embodiment of the invention, the associated service scene is obtained through the scene chain, and the model of the model is adopted to call the model database to construct the test data related to the service scene, so that the reliability and the generation efficiency of the test data generation are improved, and the accuracy of the subsequent test result is ensured.

Description

Test data generation method, device, equipment and storage medium
Technical Field
The present invention relates to the field of data processing, and in particular, to a method, an apparatus, a device, and a storage medium for generating test data.
Background
The test data is an important component of software performance test, and a complete service data ecology and rich data model is crucial to software performance pressure test. The method is mainly embodied in two aspects: firstly, the more similar the test data is to the service data in the actual scene, the higher the closeness degree of the service scene to be tested to the real production situation is, the more accurate the test result is, the higher the referential degree is; secondly, the service form of the test data is consistent with the service, the logic of test coverage can be accurate, and the performance risk analysis is comprehensive.
The generation of the current test data occupies a longer part of the whole test period in the performance test execution process for three reasons: firstly, the maintenance of the data service form consumes more time, and more manpower is required to be consumed to carry out operations such as carding, writing and swiping a number script, data entry and the like on the service before the performance test is carried out; secondly, performance problem troubleshooting involves repeated operation, and aiming at the non-reusable test data, the repeated preparation cost is high; thirdly, in the process of automatic unattended performance, the failure rate of performance test caused by test data is high (about 50%), and intelligent preprocessing of data before pressure test is urgently needed for the performance inspection of unattended performance version. Therefore, how to complete better modeling according to the target test scenario is an urgent problem to be solved.
Disclosure of Invention
In view of the above, in order to solve the problems in the prior art, the present invention provides a test data generation method, apparatus, device and storage medium applicable to the fields such as financial technology and the like or other fields.
In a first aspect, the present invention provides a test data generating method, including:
receiving a number making request, wherein the number making request comprises a target integrated scene identifier and a link parameter;
generating a scene chain according to the target integrated scene identification and the link parameter;
acquiring a service scene associated with the scene chain from a historical integrated scene, and determining a data calling method of the service scene, wherein the service scene comprises an interface calling scene and a data query scene;
and based on the service scene, adopting a model of making number to call the data calling method and a preset making number database to construct test data.
In an alternative embodiment, the method further comprises:
constructing a number making model;
the construction model comprises the following steps:
acquiring historical service data integrating a plurality of service scenes;
dividing the historical service data according to a preset hierarchical division standard to obtain hierarchical service data;
and constructing a number model according to the hierarchical business data on the basis of the tree model.
In an alternative embodiment, the method further comprises:
constructing a database of construction numbers;
the structure number database includes:
vertically splitting each historical service scene into a plurality of micro services according to a preset service requirement type, and correspondingly constructing a data linked list for each micro service;
and acquiring service data corresponding to each historical service scene, correspondingly filling the service data into the data linked list, and aggregating the data linked list to form a number making database.
In an optional embodiment, the invoking the data invoking method and the preset number database by using a number model based on the service scenario to construct test data includes:
and calling the data calling method by adopting a model making model to execute a model making action script, and acquiring data related to the service scene from a preset model making database to obtain test data.
In an optional embodiment, the obtaining data related to the service scenario from a preset number database to obtain test data includes:
acquiring an interface ID and a port number from the interface calling scene;
determining a target interface according to the interface ID and the port number;
acquiring a database connection pool maintained in advance in the data query scene;
acquiring target connection matched with a preset number database from the database connection pool;
calling the target interface, and accessing to the manufacture database based on the target connection;
and calling the data calling method, acquiring data from the manufacture number database, inputting the data into a manufacture number model, and outputting test data.
In an alternative embodiment, the method further comprises:
determining a target action for executing and constructing test data according to the service scene;
acquiring a target scene action tree corresponding to the target integrated scene identifier, wherein the target scene action tree is a tree structure formed by sequencing all standard actions according to the service logic of the target integrated scene identifier;
judging whether the target action has a dependent action according to the target position of the target action in the target scene action tree;
if so, determining parameters to be configured corresponding to the target action based on action output parameters corresponding to the dependent action and action input parameters corresponding to the target action;
if not, determining a parameter to be configured corresponding to the target action based on the action input parameter corresponding to the target action;
and generating a number making action script corresponding to the target action according to the data calling method and the parameter to be configured corresponding to the target action.
In an optional embodiment, the generating a scene chain according to the target integrated scene identifier and the link parameter includes:
acquiring a service scene corresponding to the target integrated scene identifier from a preset scene library according to the target integrated scene identifier;
acquiring the connection relation between the service scenes from the link parameters;
and connecting the service scenes according to the connection relation to obtain a scene chain.
In a second aspect, the present invention provides a test data generating apparatus, including:
the system comprises a receiving module, a transmitting module and a processing module, wherein the receiving module is used for receiving a number request, and the number request comprises a target integrated scene identifier and a link parameter;
the generating module is used for generating a scene chain according to the target integrated scene identifier and the link parameter;
the determining module is used for acquiring a service scene associated with the scene chain from a historical integrated scene and determining a data calling method of the service scene, wherein the service scene comprises an interface calling scene and a data query scene;
and the construction module is used for calling the data calling method and the preset number database by adopting a number making model based on the service scene to construct test data.
In a third aspect, the present invention provides a computer apparatus comprising a memory storing a computer program and at least one processor for executing the computer program to implement the test data generation method of any one of the preceding embodiments.
In a fourth aspect, the present invention provides a computer storage medium storing a computer program which, when executed, implements a test data generation method according to any one of the preceding embodiments.
The embodiment of the invention has the following beneficial effects:
the test data generation method provided by the embodiment of the invention comprises the steps of receiving a number making request, wherein the number making request comprises a target integrated scene identifier and a link parameter; generating a scene chain according to the target integrated scene identifier and the link parameter; acquiring a service scene associated with a scene chain from a historical integrated scene, and determining a data calling method of the service scene, wherein the service scene comprises an interface calling scene and a data query scene; and based on the service scene, adopting a modeling model to call a data calling method and a preset modeling database to construct test data. In the embodiment, the test data related to the service scene is constructed by adopting the number model and the number database, visual scheduling of the service scene is supported, the service scene is associated with the database, adaptation of the service scene to multiple data sources and repeated scheduling can be supported, and the generation efficiency of the test data is improved; and the accuracy of the test result is ensured when the test is carried out according to the test data.
Drawings
In order to more clearly illustrate the technical solution of the present invention, the drawings required in the embodiments will be briefly described below, and it should be understood that the following drawings only illustrate some embodiments of the present invention, and therefore should not be considered as limiting the scope of the present invention. Like components are numbered similarly in the various figures.
FIG. 1 is a schematic diagram illustrating a first implementation of a test data generation method according to an embodiment of the present invention;
FIG. 2 is a diagram illustrating a second implementation of a test data generation method according to an embodiment of the present invention;
FIG. 3 is a diagram illustrating a third implementation of a test data generation method in an embodiment of the present invention;
FIG. 4 is a diagram illustrating a fourth implementation of a test data generation method in an embodiment of the invention;
FIG. 5 is a diagram illustrating a fifth implementation of a test data generation method in an embodiment of the present invention;
FIG. 6 is a schematic diagram illustrating a sixth implementation manner of a test data generation method in the embodiment of the present invention;
FIG. 7 is a diagram illustrating a seventh implementation manner of a test data generation method in the embodiment of the present invention;
FIG. 8 is a diagram illustrating an eighth implementation of the test data generation method in the embodiment of the present invention;
FIG. 9 is a diagram illustrating a ninth implementation of the test data generation method in the embodiment of the present invention;
fig. 10 is a schematic structural diagram showing a test data generation apparatus according to an embodiment of the present invention.
Detailed Description
The technical solutions in the embodiments of the present invention will be clearly and completely described below with reference to the drawings in the embodiments of the present invention, and it is obvious that the described embodiments are only a part of the embodiments of the present invention, and not all of the embodiments.
The components of embodiments of the present invention generally described and illustrated in the figures herein may be arranged and designed in a wide variety of different configurations. Thus, the following detailed description of the embodiments of the present invention, presented in the figures, is not intended to limit the scope of the invention, as claimed, but is merely representative of selected embodiments of the invention. All other embodiments, which can be derived by a person skilled in the art from the embodiments of the present invention without making any creative effort, shall fall within the protection scope of the present invention.
Hereinafter, the terms "including", "having", and their derivatives, which may be used in various embodiments of the present invention, are only intended to indicate specific features, numbers, steps, operations, elements, components, or combinations of the foregoing, and should not be construed as first excluding the existence of, or adding to, one or more other features, numbers, steps, operations, elements, components, or combinations of the foregoing.
Furthermore, the terms "first," "second," "third," and the like are used solely to distinguish one from another and are not to be construed as indicating or implying relative importance.
Unless otherwise defined, all terms (including technical and scientific terms) used herein have the same meaning as commonly understood by one of ordinary skill in the art to which various embodiments of the present invention belong. Terms such as those defined in commonly used dictionaries will be interpreted as having a meaning that is the same as a contextual meaning in the related art and will not be interpreted as having an idealized or overly formal meaning unless expressly so defined herein in various embodiments of the present invention.
In the field of financial banking and the like, the safety of a software system or a platform is an important issue, so that the software system or the platform needs to be tested before being released or operated; in the testing process, the obtaining of the test data often determines the reliability of the test result. When the service scenario to be tested is an integrated scenario integrating a plurality of service scenarios, the acquisition of the test data is more important due to the complexity of the integrated scenario. Based on this, the embodiment of the present invention provides a test data generation method, which is used for implementing acquisition of test data in a complex integration scenario, and improving the acquisition efficiency and reliability of the test data.
Example 1
Referring to fig. 1, an embodiment of the present invention provides a method for generating test data, which is described in detail below.
S10, receiving a number making request, wherein the number making request comprises a target integrated scene identifier and a link parameter.
The number is obtained according to different requests to satisfy the user requirement. Before software testing, a server needs to make numbers according to the requirements of integrated scenes integrating different service scenes, then sends out corresponding number making requests, and a server background executes number making tasks after receiving the corresponding number making requests. The number request is a number request of a complex scene integrating a plurality of service scenes, and the number request comprises a target integrated scene identifier and a link parameter. The target integrated scene identification is used for uniquely identifying a target integrated scene, the target integrated scene is an integrated scene corresponding to the test data which needs to be constructed at this time, the integrated scene is an integrated scene integrating a plurality of sub-service scenes, and the link parameters include the connection relation among the sub-service scenes in the target integrated scene. For example, the target integration scenario may be a scenario suitable for credit card system testing, and the sub-service scenario includes, but is not limited to, a query sub-service scenario, an update sub-service scenario, a file generation sub-service scenario, and the like.
And S20, generating a scene chain according to the target integrated scene identification and the link parameter.
And generating a scene chain according to the integrated scene and the link parameter corresponding to the target integrated scene identifier. The scenario chain covers the main business logic of the parties participating in the business flow in each sub-business scenario.
In one embodiment, as shown in fig. 2, step S20 specifically includes the following steps:
and S21, acquiring a service scene corresponding to the target integrated scene identifier from a preset scene library according to the target integrated scene identifier.
In this embodiment, a scene library is preset, where the scene library includes a plurality of service scenes, for example, the service scenes include, but are not limited to, an interface call scene, a data query scene, a dynamic interface scene, a log query scene, a timing task scene, a current limiting scene, a number creating scene, and a fusing scene. The method comprises the steps that a plurality of service scenes can be integrated into different integrated scenes, each integrated scene is correspondingly provided with an integrated scene identifier, a mapping relation exists between the integrated scene identifier and each service scene in the integrated scenes, and the service scenes which have the mapping relation with a target integrated scene identifier are obtained from a preset scene library through matching of the target integrated scene identifier and the integrated scene identifier.
And S22, acquiring the connection relation between the service scenes from the link parameters.
And S23, connecting the service scenes according to the connection relation to obtain a scene chain.
The link parameter includes the connection relation of each service scene in the target integrated scene, and the connection relation is the service logic relation between each service scene according to the connection relation, and connects each acquired service scene, thereby forming a scene chain of the integrated scene.
And S30, acquiring a service scene associated with the scene chain from the historical integrated scene, and determining a data calling method of the service scene, wherein the service scene comprises an interface calling scene and a data query scene.
And acquiring the service scenes associated with the scene chain from the historical integrated scenes after the historical test, namely acquiring each service scene associated with the target integrated scene. And determining a data calling method corresponding to each service scene according to the data calling process of each service scene in the historical integration scene, wherein the service scene comprises but is not limited to an interface calling scene and a data inquiry scene. The data calling method corresponds to each service scene one to one, different service scenes can correspond to the same or different data calling methods, and the specific corresponding relation and the setting of the data calling method are not limited herein.
And S40, based on the service scene, adopting a modeling model to call a data calling method and a preset modeling database to construct test data.
And according to each service scene, adopting a model of making a model to call a data calling method corresponding to each service scene to obtain data in a preset making number database, thereby obtaining test data.
In one embodiment, as shown in fig. 3, step S40 in this embodiment is specifically:
and S41, executing the number making action script by adopting a number making model calling data calling method, and acquiring data related to a service scene from a preset number making database to obtain test data.
And adopting a modeling model to call a data calling method corresponding to each service scene to execute a modeling action script corresponding to the service scene, and acquiring hierarchical data related to each service scene from a preset modeling database to obtain test data. The artificial number operation script is a script configured in advance to generate test data corresponding to a certain operation.
In an embodiment, taking an example of a target integration scenario formed by an interface calling scenario and a data query scenario for explanation, as shown in fig. 4, step S41 further includes the following steps:
s411, the interface ID and the port number are obtained from the interface calling scene.
S412, determining a target interface according to the interface ID and the port number.
And if the interface calling scene comprises the interface ID and the port number of the interface of the target interface to be called, acquiring the corresponding interface ID and the port number from the interface calling scene, and determining the target interface to be called according to the interface ID and the port number.
S413, obtain a database connection pool maintained in advance in a data query scenario.
And acquiring a database connection pool maintained in advance in the data query scene, wherein the database connection pool is used for being responsible for allocating, managing and releasing database connections, and can be connected with each data linked list in a preset number database.
And S414, acquiring the target connection matched with the preset number database from the database connection pool.
And acquiring target connection matched with a preset number database from the database connection pool, namely determining the target connection corresponding to the data query scene according to the connection relation between the database connection pool and each data linked list in the number database under each service scene, namely determining the data linked list connected with the data query scene.
S415, calling a target interface, and accessing to a number database based on the target connection.
And calling the target interface, connecting the corresponding data linked list in the data making database according to the target connection corresponding to the data query scene.
And S416, calling a data calling method, acquiring data from the number making database, inputting the data into the number making model, and outputting test data.
Calling a data calling method corresponding to each service scene in the target integrated scene, namely calling an interface calling scene and a data calling method corresponding to a data query scene, calling data from a corresponding data chain table in a data base, inputting the called data into a data model through the target interface, subdividing and screening the input data according to a data hierarchy by the data model, and outputting required test data.
In one implementation, as shown in fig. 5, the embodiment of the present invention further includes: and S50, constructing a number making model. As shown in fig. 6, step S50 specifically includes:
s51, historical service data integrating a plurality of service scenes is obtained.
And S52, dividing the historical service data according to a preset hierarchical division standard to obtain hierarchical service data.
Obtaining historical service data of each service scene contained in each historical integrated scene, and dividing the historical service data according to a predetermined hierarchical division standard to obtain hierarchical service data, wherein the predetermined hierarchical division standard can be set according to actual conditions, and is not limited herein. For example, the predetermined hierarchy division standard may be set in a descending order, and each hierarchy includes a parent class, a child class, a thin class, a derivative class, and the like, so that the historical service data may be divided into hierarchy service data such as parent class, child class, thin class, derivative class service data, and the like.
And S53, constructing a number making model according to the hierarchical service data on the basis of the tree model.
Based on the tree model, the hierarchical service data is respectively associated with each node of the tree model according to corresponding different hierarchies, namely, the parent service data is a root node of the associated tree model, the subclass service data is associated with leaf nodes, the fine service data is associated with child nodes, and the like, and the service data of different hierarchies are sequentially associated, so that the manufacture model of the tree structure is obtained.
The modeling model can correspondingly acquire business data of different hierarchies according to the hierarchies corresponding to each internal node.
In one embodiment, as shown in fig. 7, the embodiment of the present invention further includes: and S60, constructing a data base. As shown in fig. 8, step S60 specifically includes:
s61, vertically splitting each historical service scene into a plurality of micro services according to the preset service demand type, and correspondingly constructing a data linked list for each micro service.
And vertically splitting each historical service scene according to a preset service requirement type by adopting a micro-service architecture to obtain a plurality of micro-services. The predetermined service requirement type may be set according to an actual situation, and is not limited herein. For example, the service requirement type includes a regular service, an extended service, a real-time response service, and the like.
After obtaining a plurality of micro services, correspondingly creating a data linked list for each micro service, wherein the data linked list is used for storing the service data corresponding to the service demand type.
S62, acquiring service data corresponding to each historical service scene, correspondingly filling the service data into a data linked list, and aggregating the data linked list to form a number database.
Acquiring executed service data in each historical service scene, correspondingly filling the service data into a data linked list corresponding to the service demand type of the historical service scene, and performing aggregation processing on each filled data linked list to obtain a database containing the service data corresponding to a plurality of service scenes in an aggregation manner, wherein the database is used as a data base.
In one embodiment, as shown in fig. 9, this embodiment further includes the following steps:
and S71, determining and executing a target action for constructing the test data according to the service scene.
The target action is the action selected by the manufacture number; the server can control the client to display a task configuration interface corresponding to the target integration scene identifier, a user can determine at least one target action in a plurality of standard actions provided by the task configuration interface, and when the target actions include at least two, the action sequence also needs to be determined; displaying a parameter configuration interface corresponding to the target action, inputting a scene parameter value corresponding to the scene configuration parameter in the parameter configuration interface, wherein the scene parameter value is not specifically limited herein, so as to obtain a build task corresponding to the target integrated scene identifier, so that the build task includes at least one target action and a scene parameter value corresponding to the scene configuration parameter. The standard action here refers to the action contained in each business scenario in the target integration scenario.
For example, when the target integration scenario is a scenario suitable for testing a credit card system, the standard actions include card issuing, card binding registration, activation, regulation, transaction and the like; in a manufacturing task, a standard card issuing action can be selected and determined as a target action so as to ensure that finally generated test data can be used for testing the card issuing function of the system; in another manufacturing task, two standard actions of card issuing and card binding registration can be selected and determined as target actions, so as to ensure that finally generated test data can correspond to the function of card binding registration after the card issuing action is performed in a test.
And S72, acquiring a target scene action tree corresponding to the target integrated scene identifier, wherein the target scene action tree is a tree structure formed by sequencing all standard actions according to the service logic of the target integrated scene identifier.
The target scene action tree is a tree structure formed by sequencing all standard actions according to the service logic of the target integrated scene identifier. The standard action is preset, and the specific action is not limited herein. And acquiring a corresponding target scene action tree according to the target integrated scene identifier.
And S73, judging whether the target action has a dependent action according to the target position of the target action in the target scene action tree.
And judging whether the target action has a dependent action according to the target position of the target action in the target scene action tree, wherein the dependent action is an action which must be executed before the target action is executed.
And S74, if the target action has the dependent action, determining the to-be-configured parameters corresponding to the target action based on the action output parameters corresponding to the dependent action and the action input parameters corresponding to the target action.
And S75, if the target action does not have a dependent action, determining a parameter to be configured corresponding to the target action based on the action input parameter corresponding to the target action.
The server can inquire the target scene action tree according to the target action, determine the target position of the target action in the target scene action tree, and judge whether other standard actions exist between the target position and the root node in the target scene action tree; if other standard actions exist between the target position and the root node, determining that a dependent action exists; and if no other standard action exists between the target position and the root node, determining that no dependent action exists. In short, the target action is one of all standard actions in the target scene action tree, and one of all standard actions from the root node to the target position, which is closest to the target action, may be determined as the dependent action according to the target position of the target action in the target scene action tree.
The action output parameter of the dependent action refers to a parameter which is output after the execution of the dependent action and is used for calling the target action. The action input parameters corresponding to the target action refer to parameters which need to be input in the execution process of the target action. The parameter to be configured corresponding to the target action refers to a parameter required to be configured for executing the number making action script corresponding to the target action.
When the target action has the dependence action, the server needs to determine the action output parameter corresponding to the dependence action and the action input parameter corresponding to the target action as the parameter to be configured corresponding to the target action, namely, in the process of executing the number of each target action, the action output parameter corresponding to the dependence action and the action input parameter corresponding to the target action need to be configured in advance, so as to ensure that the parameter to be configured of the number-making action script can be configured independently, the server does not need to depend on the execution of the dependence action, and the execution independence of the number-making action script can be ensured.
When the target action does not have the dependence action, the server only needs to input the action input parameters corresponding to the target action and determine the action input parameters as the parameters to be configured corresponding to the target action.
And S76, generating a number making action script corresponding to the target action according to the data calling method and the parameter to be configured corresponding to the target action.
The server can obtain the parameters to be configured corresponding to the data calling method and the target action for coding, and a build action script corresponding to the target action is formed.
The server can use the scene parameter value of the scene configuration parameter as the script input parameter of the number making action script corresponding to at least one target action, sequentially execute the number making action script corresponding to at least one target action according to the dependency relationship between at least one target action, and determine the output result of the last executed number making action script as the test data, so that the test data can be suitable for the scene tests corresponding to different number making scene tasks.
The method has the advantages that at least one number making action script under the target integration scene is called and executed, and the test data required by the target integration scene can be generated quickly, so that the test data generation operation is simple, the construction efficiency is high, the method is suitable for generating the full-link test data of different integration scenes, and the application range of the test data is widened.
In the embodiment, on the first hand, the number model and the number database are adopted to construct test data related to a service scene, visual scheduling of the service scene is supported, the service scene is associated with the database, adaptation and repeated scheduling of the service scene to multiple data sources can be supported, the generation efficiency of the test data is improved, and one-time preparation and multiple-time use of the service scene are realized; in the second aspect, by making numbers of integrated scenes integrating a plurality of service scenes, the integration of the service scenes isolates strong dependence on operators; the configuration of the database decouples the complex architecture of a plurality of sources, reduces the difficulty of data operation and greatly improves the number making efficiency; in the third aspect, the consistency of the data form and the actual service scene is guaranteed, and the accuracy of the subsequent test result, the integrity of the test link service coverage and the controllability of the performance risk are ensured; in a fourth aspect, the possibility of repeatable scheduling of complex integrated scene artifacts is enabled.
Example 2
Referring to fig. 10, an embodiment of the present invention provides a test data generating apparatus, including:
a receiving module 101, configured to receive a number request, where the number request includes a target integrated scene identifier and a link parameter;
a generating module 102, configured to generate a scene chain according to the target integrated scene identifier and the link parameter;
a determining module 103, configured to obtain a service scenario associated with the scenario chain from a historical integration scenario, and determine a data calling method of the service scenario, where the service scenario includes an interface calling scenario and a data query scenario;
and the construction module 104 is configured to call the data call method and the preset number database by using a number model based on the service scene to construct test data.
The test data generation device described above corresponds to the test data generation method of embodiment 1, and any option in embodiment 1 is also applicable to this embodiment, and is not described in detail here.
The embodiment of the present invention further provides a computer device, which includes a memory and at least one processor, where the memory stores a computer program, and the processor is configured to execute the computer program to implement the test data generation method of the above embodiment.
The memory may include a storage program area and a storage data area, wherein the storage program area may store an operating system, an application program required for at least one function; the storage data area may store data (such as scene chains, test data, etc.) created according to the use of the computer device, etc. Further, the memory may include high speed random access memory, and may also include non-volatile memory, such as at least one magnetic disk storage device, flash memory device, or other volatile solid state storage device.
The embodiment of the invention also provides a computer-readable storage medium, wherein a machine executable instruction is stored in the computer-readable storage medium, and when the machine executable instruction is called and executed by a processor, the computer executable instruction causes the processor to execute the steps of the test data generation method of the embodiment.
In the several embodiments provided in the present application, it should be understood that the disclosed apparatus and method may be implemented in other manners. The apparatus embodiments described above are merely illustrative and, for example, the flowchart and block diagrams in the figures illustrate the architecture, functionality, and operation of possible implementations of apparatus, methods and computer program products according to various embodiments of the present invention. In this regard, each block in the flowchart or block diagrams may represent a module, segment, or portion of code, which comprises one or more executable instructions for implementing the specified logical function(s). It should also be noted that, in alternative implementations, the functions noted in the block may occur out of the order noted in the figures. For example, two blocks shown in succession may, in fact, be executed substantially concurrently, or the blocks may sometimes be executed in the reverse order, depending upon the functionality involved. It will also be noted that each block of the block diagrams and/or flowchart illustration, and combinations of blocks in the block diagrams and/or flowchart illustration, can be implemented by special purpose hardware-based systems that perform the specified functions or acts, or combinations of special purpose hardware and computer instructions.
In addition, each functional module or unit in each embodiment of the present invention may be integrated together to form an independent part, or each module may exist separately, or two or more modules may be integrated to form an independent part.
The functions, if implemented in the form of software functional modules 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 or a part of the technical solution that contributes to the prior art in essence can 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 smart phone, a personal computer, a server, or a network device, etc.) 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 removable hard disk, a Read-Only Memory (ROM), a Random Access Memory (RAM), a magnetic disk, or an optical disk, and various media capable of storing program codes.
The above description is only for the specific embodiments of the present invention, but the scope of the present invention is not limited thereto, and any person skilled in the art can easily think of the changes or substitutions within the technical scope of the present invention, and shall cover the scope of the present invention.

Claims (10)

1. A method of generating test data, comprising:
receiving a number making request, wherein the number making request comprises a target integrated scene identifier and a link parameter;
generating a scene chain according to the target integrated scene identification and the link parameter;
acquiring a service scene associated with the scene chain from a historical integrated scene, and determining a data calling method of the service scene, wherein the service scene comprises an interface calling scene and a data query scene;
and based on the service scene, adopting a model of making number to call the data calling method and a preset making number database to construct test data.
2. The method of test data generation of claim 1, further comprising:
constructing a number making model;
the constructing of the number model comprises:
acquiring historical service data integrating a plurality of service scenes;
dividing the historical service data according to a preset hierarchical division standard to obtain hierarchical service data;
and constructing a number model according to the hierarchical business data on the basis of the tree model.
3. The method of test data generation according to claim 1, further comprising:
constructing a database of construction numbers;
the structure number database includes:
vertically splitting each historical service scene into a plurality of micro services according to a preset service requirement type, and correspondingly constructing a data linked list for each micro service;
and acquiring service data corresponding to each historical service scene, correspondingly filling the service data into the data linked list, and aggregating the data linked list to form a number making database.
4. The method for generating test data according to claim 1, wherein the step of calling the data calling method and the preset number database by using a number model based on the service scenario to construct test data comprises:
and calling the data calling method by adopting a model making model to execute a model making action script, and acquiring data related to the service scene from a preset model making database to obtain test data.
5. The method according to claim 4, wherein the obtaining data related to the service scenario from a preset number database to obtain test data comprises:
acquiring an interface ID and a port number from the interface calling scene;
determining a target interface according to the interface ID and the port number;
acquiring a database connection pool maintained in advance in the data query scene;
acquiring target connection matched with a preset number database from the database connection pool;
calling the target interface, and accessing to the manufacture database based on the target connection;
and calling the data calling method, acquiring data from the manufacture number database, inputting the data into a manufacture number model, and outputting test data.
6. The method of test data generation according to claim 1, further comprising:
determining a target action for executing and constructing test data according to the service scene;
acquiring a target scene action tree corresponding to the target integrated scene identifier, wherein the target scene action tree is a tree structure formed by sequencing all standard actions according to the service logic of the target integrated scene identifier;
judging whether the target action has a dependent action or not according to the target position of the target action in the target scene action tree;
if so, determining a parameter to be configured corresponding to the target action based on the action output parameter corresponding to the dependent action and the action input parameter corresponding to the target action;
if not, determining a parameter to be configured corresponding to the target action based on the action input parameter corresponding to the target action;
and generating a number making action script corresponding to the target action according to the data calling method and the parameter to be configured corresponding to the target action.
7. The method of generating test data according to claim 1, wherein generating a scene chain according to the target integrated scene identifier and the link parameter comprises:
acquiring a service scene corresponding to the target integrated scene identifier from a preset scene library according to the target integrated scene identifier;
acquiring the connection relation between the service scenes from the link parameters;
and connecting the service scenes according to the connection relation to obtain a scene chain.
8. A test data generating apparatus, comprising:
the system comprises a receiving module, a transmitting module and a processing module, wherein the receiving module is used for receiving a number request, and the number request comprises a target integrated scene identifier and a link parameter;
the generation module is used for generating a scene chain according to the target integrated scene identifier and the link parameter;
the determining module is used for acquiring a service scene associated with the scene chain from a historical integrated scene and determining a data calling method of the service scene, wherein the service scene comprises an interface calling scene and a data query scene;
and the construction module is used for calling the data calling method and the preset number database by adopting a number making model based on the service scene to construct test data.
9. A computer device, characterized in that the computer device comprises a memory, in which a computer program is stored, and at least one processor for executing the computer program to implement the test data generation method of any one of claims 1-7.
10. A computer storage medium characterized in that it stores a computer program that, when executed, implements a test data generation method according to any one of claims 1-7.
CN202211319390.XA 2022-10-26 2022-10-26 Test data generation method, device, equipment and storage medium Pending CN115509942A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202211319390.XA CN115509942A (en) 2022-10-26 2022-10-26 Test data generation method, device, equipment and storage medium

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202211319390.XA CN115509942A (en) 2022-10-26 2022-10-26 Test data generation method, device, equipment and storage medium

Publications (1)

Publication Number Publication Date
CN115509942A true CN115509942A (en) 2022-12-23

Family

ID=84513229

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202211319390.XA Pending CN115509942A (en) 2022-10-26 2022-10-26 Test data generation method, device, equipment and storage medium

Country Status (1)

Country Link
CN (1) CN115509942A (en)

Cited By (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN111221726A (en) * 2019-12-25 2020-06-02 平安普惠企业管理有限公司 Test data generation method and device, storage medium and intelligent equipment
CN117194253A (en) * 2023-09-11 2023-12-08 易方达基金管理有限公司 Method and system for generating test data of service scene

Cited By (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN111221726A (en) * 2019-12-25 2020-06-02 平安普惠企业管理有限公司 Test data generation method and device, storage medium and intelligent equipment
CN117194253A (en) * 2023-09-11 2023-12-08 易方达基金管理有限公司 Method and system for generating test data of service scene
CN117194253B (en) * 2023-09-11 2024-04-19 易方达基金管理有限公司 Method and system for generating test data of service scene

Similar Documents

Publication Publication Date Title
CN115509942A (en) Test data generation method, device, equipment and storage medium
CN106354645B (en) Test method and test platform based on background system service or interface
CN107861870B (en) Interface test and test data generation method, device, terminal and storage medium
CN109947646A (en) Interface test method, device, computer equipment and storage medium
CN109857668A (en) UI automated function test method, test device, test equipment and storage medium
CN105512036A (en) Test template for automatically generating test case according to preset rules and test method
CN108345532A (en) A kind of automatic test cases generation method and device
CN105389256A (en) Unit testing method and system
CN110046091B (en) Automatic test method and device
CN106055325B (en) A kind of service construction method that support multisystem is run simultaneously
CN112256318B (en) Construction method and equipment for dependent product
CN114546738A (en) Server general test method, system, terminal and storage medium
CN110458412A (en) The generation method and device of risk monitoring and control data
CN110275703A (en) Assignment method, device, computer equipment and the storage medium of key-value pair data
CN111966597B (en) Test data generation method and device
CN112487075B (en) Method for integrating relational database data conversion operators and non-relational database data conversion operators
CN107766519B (en) Method for visually configuring data structure
CN106649078B (en) Application interface test method and device
CN105242958A (en) Virtual testing system and HLA simulation system data exchange method
CN109857735B (en) Data construction method and system for rule description through excel
KR20090099977A (en) A reserved component container based software development method and apparatus
CN111158979A (en) Service dial testing method, system, device and storage medium
CN109857576A (en) RPC interface call method and device
CN110597728A (en) Method, device and system for constructing test data
CN116302889A (en) Performance test method and device for functional module and server

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