CN112162915A - 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
CN112162915A
CN112162915A CN202010879972.8A CN202010879972A CN112162915A CN 112162915 A CN112162915 A CN 112162915A CN 202010879972 A CN202010879972 A CN 202010879972A CN 112162915 A CN112162915 A CN 112162915A
Authority
CN
China
Prior art keywords
test
service
item
script
service test
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
CN202010879972.8A
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.)
Hangzhou Dasouche Auto Service Co ltd
Original Assignee
Hangzhou Dasouche Auto Service 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 Hangzhou Dasouche Auto Service Co ltd filed Critical Hangzhou Dasouche Auto Service Co ltd
Priority to CN202010879972.8A priority Critical patent/CN112162915A/en
Publication of CN112162915A publication Critical patent/CN112162915A/en
Pending legal-status Critical Current

Links

Images

Classifications

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

Abstract

One or more embodiments of the present specification provide a test data generation method, apparatus, device, and storage medium, where the method includes: determining a test item identifier and a test parameter corresponding to an upstream service test item in a service link; wherein, the upstream service test item comprises a service test item upstream of the target service test item; calling a test script template corresponding to the upstream service test item from a preset database according to the determined test item identifier; the preset database is pre-stored with test script templates corresponding to a plurality of service test items in the service link; according to the test script template and the test parameters corresponding to the upstream service test project, test data for performing service test on the target service test project are generated, so that the implementation complexity and difficulty of the test data can be effectively simplified, and the method has the advantages of simplicity in implementation and higher efficiency.

Description

Test data generation method, device, equipment and storage medium
Technical Field
The present disclosure relates to the field of data processing technologies, and in particular, to a method, an apparatus, a device, and a storage medium for generating test data.
Background
With the rapid development of internet technology and computer technology, electronic business systems are increasingly widely used in enterprises, public institutions and other institutions. The electronic service system needs to perform service test in the stages of development, daily maintenance, upgrading and the like, and the problems in the service system are discovered in time.
In practical application, upstream and downstream service data are often used in a service testing process of an electronic service system, for complex services and underlying services, a call link may be very long, often involving multiple service systems or subsystems, often requiring multiple tasks to be cooperatively implemented, resulting in a tedious process of preparing test data and long time consumption.
In contrast, a method commonly used in the industry is to create test data by respectively requesting an upstream service system and a downstream service system through a plurality of interfaces or directly inserting a database, but for a complex service or a service with a long call link, the number of interfaces and data tables is too large, the relationship is complex, omission is easy, the difficulty in troubleshooting is high when an error occurs, and the problems that the test data preparation is difficult and the efficiency is low are caused.
Disclosure of Invention
An object of the embodiments of the present specification is to provide a method, an apparatus, a device, and a storage medium for generating test data, so as to solve the problems of difficulty in preparing current test data, low efficiency, and the like.
To solve the above technical problem, one or more embodiments of the present specification are implemented as follows:
in a first aspect, an embodiment of the present specification provides a test data generation method, including:
determining a test item identifier and a test parameter corresponding to an upstream service test item in a service link; wherein the upstream service test item comprises a service test item upstream of the target service test item;
calling a test script template corresponding to the upstream service test item from a preset database according to the test item identifier; the preset database is pre-stored with test script templates corresponding to a plurality of service test items in the service link;
and generating test data for performing service test on the target service test project according to the test script template and the test parameters corresponding to the upstream service test project.
In a second aspect, an embodiment of the present specification provides a test data generation apparatus, including:
the test item identification determining module is used for determining a test item identification and a test parameter corresponding to an upstream service test item in a service link; wherein the upstream service test item comprises a service test item upstream of the target service test item;
the test script template calling module is used for calling a test script template corresponding to the upstream service test item from a preset database according to the test item identification; the preset database is pre-stored with test script templates corresponding to a plurality of service test items in the service link;
and the test data generation module is used for generating test data for carrying out service test on the target service test project according to the test script template corresponding to the upstream service test project and the test parameters.
In a third aspect, an embodiment of the present specification provides a test data generation device, including: a processor, and a memory arranged to store computer executable instructions; the computer executable instructions, when executed, cause the processor to implement the steps of the method of any of the first aspects above.
In a fourth aspect, the present specification provides a computer-readable storage medium, on which a computer program is stored, the computer program, when executed by a processor, implementing the steps of the method according to any one of the first aspect.
After determining a test item identifier and a test parameter corresponding to an upstream service test item in a service link, first calling a test script template corresponding to the upstream service test item from a preset database according to the determined test item identifier, where the preset database stores test script templates corresponding to a plurality of service test items in the service link in advance, and then generating test data for performing a service test on a target service test item according to the test script template and the test parameter corresponding to the upstream service test item. The embodiment of the specification stores the test script templates corresponding to the multiple service test items in advance in the preset database, so that when test data of a target service test item is prepared, the corresponding test script templates can be called conveniently by using the test item identifiers corresponding to the upstream service test items, and then the data of the upstream service test items can be output quickly by combining test parameters as the test data of the target service test item.
Drawings
In order to more clearly illustrate one or more embodiments or prior art solutions of the present specification, the drawings that are needed in the description of the embodiments or prior art will be briefly described below, it is obvious that the drawings in the following description are only some of the embodiments described in one or more of the specification, and that other drawings can be obtained by those skilled in the art without inventive exercise.
FIG. 1 is a schematic diagram of an application scenario of a test data generation system according to one or more embodiments of the present disclosure;
FIG. 2 is a first flowchart of a test data generation method according to one or more embodiments of the present disclosure;
FIG. 3 is a second flowchart of a test data generation method according to one or more embodiments of the present disclosure;
FIG. 4 is a third schematic flow chart of a test data generation method provided in one or more embodiments of the present disclosure;
FIG. 5 is a fourth flowchart of a test data generation method according to one or more embodiments of the present disclosure;
FIG. 6 is a schematic flow chart of a test data generation method provided in one or more embodiments of the present disclosure;
FIG. 7 is a sixth flowchart of a test data generation method according to one or more embodiments of the present disclosure;
FIG. 8 is a block diagram of a test data generating apparatus according to one or more embodiments of the present disclosure;
fig. 9 is a schematic structural diagram of a test data generation apparatus according to one or more embodiments of the present specification.
Detailed Description
In order to make the technical solutions in one or more embodiments of the present disclosure better understood, the technical solutions in one or more embodiments of the present disclosure will be clearly and completely described below with reference to the accompanying drawings in one or more embodiments of the present disclosure, and it is obvious that the described embodiments are only a part of one or more embodiments of the present disclosure, but not all embodiments. All other embodiments that can be derived by a person skilled in the art from the embodiments given in one or more of the present specification without inventive step shall fall within the scope of protection of this document.
It should be noted that one or more embodiments and features of the embodiments in the present description may be combined with each other without conflict. Reference will now be made in detail to one or more embodiments of the disclosure, examples of which are illustrated in the accompanying drawings.
One or more embodiments of the present disclosure provide a method, an apparatus, a device, and a storage medium for generating test data, where after a test item identifier and a test parameter corresponding to an upstream service test item in a service link are determined, a test script template corresponding to the upstream service test item is called from a preset database according to the determined test item identifier, where the preset database stores test script templates corresponding to a plurality of service test items in the service link in advance, and then test data for performing a service test on a target service test item is generated according to the test script template and the test parameter corresponding to the upstream service test item. The embodiment of the specification stores the test script templates corresponding to the multiple service test items in advance in the preset database, so that when test data of a target service test item is prepared, the corresponding test script templates can be called conveniently by using the test item identifiers corresponding to the upstream service test items, and then the data of the upstream service test items can be output quickly by combining test parameters as the test data of the target service test item.
Fig. 1 is a schematic view of an application scenario of a test data generation system according to one or more embodiments of the present specification, and as shown in fig. 1, the system includes: the system comprises a server and a plurality of service test nodes, wherein the plurality of service test nodes correspond to a plurality of service systems with service association relations, and each service test node can be configured with a client interacting with the server so as to realize data interaction with the server.
In practical applications, the service test node may be a mobile terminal such as a smart phone or a tablet computer, or may be a terminal device such as a personal computer (fig. 1 shows only an exemplary desktop computer, which does not represent a limitation to the embodiments of the present disclosure), the service end may be used to provide test data for the service test node, and the service end may be an independent server or a server cluster composed of a plurality of servers.
It should be noted that, for a complete system consisting of multiple service systems, a complete data stream cannot be circulated in only one service system at a time. For example, for an online shopping mall, a data flow of this complete transaction passes through many business systems such as an Enterprise Resource Planning (ERP) system, a warehouse system, a distribution system, and an end system from the time when a buyer orders to the time when the buyer is finally received. The service systems are connected into a service link by calling, and the transaction data is circulated on the service link. For service testing, each service system may be considered as a service test node in a service link, and generally, when a service test is performed on a certain service test node (e.g., a target service test node), it is often necessary for an upstream service test node to perform service testing in advance and output service data (including but not limited to test result data), where the service data output upstream may be used as test data input by the target service test node for performing the service test. Therefore, for ease of understanding, the plurality of traffic test nodes are divided into a target traffic test node, an upstream traffic test node and a downstream traffic test node, wherein the target traffic test node is a traffic test node currently to be tested, the upstream traffic test node may refer to a traffic test node located upstream of the target traffic test node in a traffic link, and the downstream traffic test node may refer to a traffic test node located upstream of the target traffic test node in a traffic link.
Based on the application scenario shown in fig. 1, when a target service test node needs to be tested, test data needs to be prepared or created, wherein at least a part of the test data needs to be provided by an upstream service test node, in order to simplify the difficulty of preparing the test data and improve the efficiency of preparing the test data, the embodiment of the present specification abandons the mode that the upstream service test node needs to provide test data preparation service for the target service test node, but deploys a service end to provide test data preparation service for each service test node, each service test node uploads a used test script to the service end, the service end generates a test script template according to the test script, or each service test node generates a test script template according to the used test script and uploads the test script template to the service end, the server side stores the test script templates into a preset database, when test data are required to be prepared for the target service test node, the server side directly generates corresponding test scripts according to the test script templates corresponding to various service test items respectively and provides the required test data for the target service test node after operation, so that the target service test node does not need to communicate with a plurality of upstream service test nodes one by one to request the upstream service test nodes to provide data, test data preparation work and complex information interaction processes of each node are simplified, the preparation difficulty of the test data is reduced, and the preparation efficiency of the test data is improved.
Specifically, the server may first determine a test item identifier and a test parameter corresponding to an upstream service test item in the service link, and then call a test script template corresponding to the upstream service test item from a preset database according to the test item identifier, where the preset database stores test script templates corresponding to a plurality of service test items in the service link in advance, and then may generate test data for performing a service test on a target service test item according to the test script template and the test parameter corresponding to the upstream service test item.
Fig. 2 is a first flowchart of a test data generation method provided in one or more embodiments of the present specification, where the method in fig. 2 can be executed by the server in fig. 1, as shown in fig. 2, and the method at least includes the following steps:
s102, determining a test item identifier and a test parameter corresponding to an upstream service test item in a service link; wherein the upstream business test item comprises a business test item upstream of the target business test item.
S104, calling a test script template corresponding to the upstream service test item from a preset database according to the determined test item identification; the preset database is pre-stored with test script templates corresponding to a plurality of service test items in the service link.
And S106, generating test data for performing service test on the target service test project according to the test script template and the test parameters corresponding to the upstream service test project.
Wherein, S106 may specifically be: and performing service test on the upstream service test project according to the test script template and the test parameters corresponding to the upstream service test project, generating test result data, and taking the test result data corresponding to the upstream service test project as test data required to be input by the service test of the target service test project.
In one or more embodiments of the present description, after determining a test item identifier and a test parameter corresponding to an upstream service test item in a service link, a test script template corresponding to the upstream service test item is called from a preset database according to the determined test item identifier, where the preset database stores test script templates corresponding to a plurality of service test items in the service link in advance, and then test data for performing a service test on a target service test item is generated according to the test script template and the test parameter corresponding to the upstream service test item. The embodiment of the specification stores the test script templates corresponding to the multiple service test items in advance in the preset database, so that when test data of a target service test item is prepared, the corresponding test script templates can be called conveniently by using the test item identifiers corresponding to the upstream service test items, and then the data of the upstream service test items can be output quickly by combining test parameters as the test data of the target service test item.
The test parameters are used to represent conditions for generating test data, such as a test data range, a test data type, a test data volume, and the like, and by setting the test parameters, it can be ensured that the test data required by the target service test item can be generated based on the test script template.
For convenience of differentiation, in this embodiment of the present description, a service test item is divided into an upstream service test item, a target service test item, and a downstream service test item, where the upstream service test item is a service test item of an upstream service test node, the target service test item is a service test item of a target service test node, and the downstream service test item is a service test item of a downstream service test node, the service test item may refer to test content at the service test node, for example, the service test item may include an order system reliability test, a logistics system reliability test, a transaction system reliability test, and the like, and a same service test node may correspond to one service test item or may correspond to multiple service test items, which is not limited in this embodiment of the present description.
The server executes the above S106, which can be understood as that the server replaces an upstream service test node to perform a service test to obtain test data output to a target service test node, and in consideration of practical application, when the target service test node performs the service test, a plurality of upstream service test nodes are often required to complete the test in advance, and therefore, the target service test node needs to cooperate with the plurality of upstream service test nodes in sequence, and the process is complicated and the efficiency is low. In this embodiment, since the server executes the S106, the target service test node only needs to perform information interaction with the server, and no matter there are a plurality of upstream service test nodes, the server can request to replace the upstream service test node for performing service test, so that the process of acquiring test data by the target service test node can be greatly simplified, and the operation efficiency can be improved. The server side can uniformly manage the test script templates of all the service test nodes and create test data for the target service test node based on the test script templates, so that the communication cost among all the service test nodes can be reduced, and the efficiency of creating the test data is improved.
As shown in fig. 3, for the process of determining the test item identifier and the test parameter corresponding to the upstream service test item, in the above S102, determining the test item identifier and the test parameter corresponding to the upstream service test item in the service link specifically includes:
s1021, a test data generation request sent by the target service test node is received, wherein the test data generation request carries a test item identifier and a test parameter corresponding to an upstream service test item in the service link.
S1022, the received test data generation request is analyzed, and a test item identifier and a test parameter corresponding to an upstream service test item in the service link are obtained.
In the above embodiment, the target service test node may first determine a test item identifier and a test parameter corresponding to an upstream service test item that needs to be tested in advance, then add the test item identifier and the test parameter to the test data generation request, and send the test data generation request to the server, where the server may analyze the test item identifier and the test parameter to obtain the test item identifier and the test parameter after receiving the test data generation request.
As a modified embodiment of the foregoing embodiment, the test data generation request may not carry the test item identifier and the test parameter, but the server may automatically determine the test item identifier and the test parameter corresponding to the upstream business test item according to a preset rule or empirical knowledge based on the information of the target business test item carried in the test data generation request.
Based on the embodiment shown in fig. 3, as shown in fig. 4, the receiving, by the S1021, a test data generation request sent by the target service test node specifically includes:
s10211, sending the visual web page data to the target service test node, so that the target service test node obtains input information of a visual web page corresponding to the visual web page data from a user, where the input information includes: selecting information of an upstream business test item in the visual webpage and/or test parameters input aiming at the upstream business test item;
s10212, receiving a test data generation request generated by the target service test node based on the input information.
The visual webpage may include a World Wide Web (Web) page, and further, the visual webpage data may include a selection control corresponding to a plurality of business test items and/or a test parameter input control corresponding to each business test item, so that a tester may select an upstream business test item from the plurality of business test items through the selection control in the visual webpage and input a test parameter for the selected upstream business test item through the test parameter input control. In addition, the test data generated by the server can also be returned to the target service test node through the visual webpage, and the user can check the returned test data through the visual webpage so as to further perform service test by using the test data and the test script compiled aiming at the service test of the target service test node.
The embodiment has higher man-machine interaction freedom, can realize the free selection of the upstream service test items and the personalized customization of the test parameters by the tester, and can return and present the test data, thereby meeting the diversified test requirements of the tester.
In addition, the Web page has the advantages of high popularization rate, light weight, rich page content, high editing freedom degree and the like, so that the implementation difficulty of the embodiment can be reduced by adopting the Web page to realize the visual Web page, and the method has the advantages of simplicity in implementation, low cost, flexibility in adjustment and the like.
In another embodiment, on the basis of the embodiment corresponding to fig. 3, in step S1021, receiving a test data generation request sent by a target service test node specifically includes:
and receiving a test data generation request sent by a target service test node through a Hyper Text Transfer Protocol (HTTP) interface.
When a tester needs to perform interface test or automatic test, the target service test node can automatically and directly send a test data generation request to the server through the HTTP interface, and interface test and automatic test can be automatically realized without excessive manual participation, so that the method has the advantages of high automation degree, high test efficiency and the like.
It should be noted that the above two ways of receiving the test data generation request may be implemented separately or in parallel, for example, the service test node may be configured with a Web end to provide a Web page, and may also communicate with a server end through an HTTP interface, and human-computer interaction may be implemented by using the Web page provided by the Web end, a test script template may be generated by customization with the participation of a tester, and the service test node may automatically communicate with the server end and request to generate the test script template by using the HTTP interface, so that interface test and automated test may be automatically implemented without manual participation, and thus diversified test script template preparation requirements may be satisfied. In addition, under the condition of parallel implementation, the service end may select which way to receive the test data generation request according to a preset logic, for example, under the condition that the service test node adopts the Web end to provide a Web page, the service end preferentially receives the test data generation request generated by the target service test node based on the Web end, and returns the test data based on the Web end, under the condition that the service test node does not adopt the Web end to interact with the service end, the service end may interact with the service end through the HTTP interface, and correspondingly, the service end receives the test data generation request through the HTTP interface, and returns the test data to the service test node through the HTTP interface.
Further, as shown in fig. 5, before determining the test item identifier and the test parameter corresponding to the upstream service test item in the service link in step S102, the method further includes:
s108, acquiring a test script generated by the service test node aiming at the service test project;
s110, analyzing the obtained test script to obtain a test script template corresponding to the service test item;
and S112, storing the obtained test script template into a preset database.
In the embodiment, the service test nodes can be any nodes in the service link, and the test scripts can be generated by the service test nodes in daily service test projects.
Specifically, in the step S108, acquiring a test script generated by the service test node for the service test item specifically includes:
acquiring a test script generated by a service test node according to a preset test frame aiming at a service test item;
correspondingly, in step S110, analyzing the obtained test script to obtain a test script template corresponding to the service test item, which specifically includes:
and analyzing the obtained test script based on the preset test frame to obtain a test script template corresponding to the service test item.
In this embodiment, the preset test frame may be implemented by any test frame provided in the prior art or a language for writing a test script, and as long as it is ensured that the test frames used by the service test nodes are consistent, the server may analyze the preset test frame to obtain a test script template, which is not limited in the embodiments of this specification.
In some specific embodiments, the preset test framework may be a Guardian test framework, the Guardian test framework is based on a Robot Frame (RF) framework (an automated test framework that can be used for performing various types of automated tests, and an RF script is a test script written using a robot frame language), rules for writing test cases are defined according to actual services, and the test framework performs secondary development on the RF framework, defines structures of keywords, resources, test cases and variables, and has the advantages of rich content, high compatibility, and the like. The purpose of the embodiment can be efficiently realized only by the tester of the service test node obeying the Guardian rule during daily service test, writing the interface test script by using the RF and uploading the interface test script to the distributed version control system GIT. The test script can explain the description of the test case and the reference structure of the test case, such as parameter attributes including parameter type, whether the parameter must be filled, parameter default value, parameter range and the like, and define the return content of the scene, so that subsequent testers can flexibly set the test parameters according to the return content.
For the manner of obtaining the test script, the service test node may directly upload the test script to the server, and correspondingly, the server may directly obtain the test script uploaded by the service test node from the service test node, and in addition, when the service test node performs a test using the test script, the test script may be uploaded to the distributed version control system GIT, and then, the service test node may also directly upload the GIT address and/or the branch information of the test script in the GIT to the server, and correspondingly, the server may query and fetch the test script from the GIT according to the GIT address and/or the branch information, which may all achieve the purpose of the embodiment of the present specification, for example, in S108, the obtaining of the test script generated by the service test node for the service test project specifically includes:
receiving a test script archiving request sent by at least one service test node, wherein the test item archiving request carries the address and/or branch of a distributed version control system of the test script requested to be stored;
and inquiring to obtain the test script corresponding to the test script archiving request from the distributed version control system according to the address and/or the branch of the received distributed version control system of the test script.
For example, a user may perform human-computer interaction through a Web end configured by a service test node, specifically, for an upstream service test node, the user does not need to encode again to generate a test script or a test script template, but may input a test script GIT address and a branch existing in a test process through the Web end, a target service test node sends the test script GIT address and the branch to a server, and the server may query a test script requesting archiving from GIT according to the test script GIT address and the branch, and generate the test script template based on the test script.
Through the implementation mode, when the service test node uploads the test script to the GIT, the test script does not need to be repeatedly uploaded to the server, and only the GIT address and the branch corresponding to the test script need to be sent to the server, so that the network resources of the service test node can be effectively saved, and the system resource consumption and the network resource consumption of the service test node are reduced.
In addition, the test script is analyzed, the test script can be subjected to parameterization removal, so that the rest script part is used as a test script template, and the test script template is combined with newly input test parameters to be used as a complete test script to execute a test task. Therefore, the test script can be simply and quickly converted into the test script template through the implementation mode, so that the service end can independently and autonomously replace the service test node to complete the service test after the test parameters are introduced.
Specifically, the test script may also be analyzed in a human-computer interaction manner, in step S110, the obtained test script is analyzed, and a test script template corresponding to the service test item is obtained, which specifically includes:
analyzing the obtained test script to obtain test script information;
and generating a test script template according to the setting operation of the user on the obtained test script information.
For example, a user can perform human-computer interaction through a Web end configured by a service test node, an analyzer located at a service end analyzes test script information such as at least one test script template, resources, parameters and the like in a test script according to a Guardian test framework definition, the user can further check the test script information through the Web end, select a test script template to be stored from the test script information, set the parameters and the template name, and then the service end can generate the test script template and store the test script template in a preset database.
Through the implementation mode, a man-machine interaction mode can be adopted, a user can independently select the test script template to be generated, and the customization and the flexibility are high.
In addition, in some modified embodiments, the service test node may also be configured with a plug-in for triggering a test script archiving request, the user clicks the plug-in after selecting the test script to be archived, the service test node may upload the test script to the server, then, the server may automatically parse out test script information such as a test script template and parameters according to a file name and a path corresponding to a position where a current user cursor is located in the service test node and a commit id submitted by the last GIT as parameters, and automatically generate a name of the test script template according to the test case name, which is convenient for the user to identify when using, and then, the server automatically generates the test script template and stores the test script template in a preset database.
It should be noted that the above-mentioned manner of uploading the test script through the Web page of the Web end and the manner of uploading the test script through the plug-in may be used alternatively or jointly, where, when used jointly, the above-mentioned manner may be implemented according to a preset logic, for example, the test script is uploaded by the Web end preferentially, and in the case of not configuring the Web end, the test script may be uploaded by the plug-in; alternatively, the plug-in upload test script is preferentially used, and the test script uploaded on the Web side can be adopted without configuring the plug-in, which can all achieve the purpose of the embodiments of the present specification.
In the foregoing embodiments, the generation of the test script template is completed at the server, in other embodiments, for a storage process of the test script template, the service test node may further generate the test script template and then send the test script template to the server for storage, and before determining the test item identifier and the test parameter corresponding to the upstream service test item in the service link in step S102, the method further includes:
receiving a test script template sent by at least one service test node;
and storing the test script template sent by the at least one service test node into a preset database.
The service test nodes can perform parameterization removal on the used test scripts in the daily test process, generate the test script templates and upload the test script templates to the server side for storage, and through the implementation mode, the parameterization removal of the test scripts can be completed by the service test nodes, so that the operation load of the server side is reduced.
Further, as shown in fig. 6, after the step S106 generates test data for performing the service test on the target service test item according to the test script template and the test parameters corresponding to the upstream service test item, the method further includes:
s114, based on the generated test data and the test script uploaded by the target service test node, performing service test on the target service test project; alternatively, the first and second electrodes may be,
s116, the generated test data is sent to the target service test node, so that the target service test node performs service test on the target service test item according to the test data.
Through S114, the service end can perform a service test on the target service test item according to the test script and the test data uploaded by the target service test node, and the target service test node only needs to initiate a service test request and receive a service test result, so that the system load of the target service test node can be effectively reduced.
Through S116, the target service test node can perform the service test on the target service test item according to the test script and the test data, and can accurately test the test items of the target service test node, such as stability, reliability, pressure resistance, and the like, and at the same time, can effectively reduce the system load of the service end.
Further, in order to facilitate the downstream service testing node to perform the service test, as shown in fig. 7, the method further includes:
s118, after the service test of the target service test item is completed, generating a test script template corresponding to the target service test item according to a test script used for the service test of the target service test item;
and S120, storing the test script template corresponding to the target service test item into a preset database.
Through the implementation mode, the used test scripts can be subjected to parameterization removal, the test script templates are generated and stored in the preset database, so that the test scripts can be subsequently used for generating test data for the service test of the downstream service test nodes, the used test scripts can be accumulated and reused, existing resources can be fully utilized to efficiently and conveniently manufacture the test script templates, and the method has the advantages of being small in implementation difficulty and low in cost.
It should be noted that, the above description of the embodiment corresponding to fig. 5 and the above description of the embodiment corresponding to fig. 7 both embody a technical concept of generating a test script template by using a used test script, so as to accumulate and reuse the used test script, and do not require additional work of a tester to create a new test script or test script template, and the purpose of simplifying test data preparation work and improving test data preparation efficiency in the embodiments of the present specification can be achieved at a lower cost.
In addition, the used test scripts are uploaded to the server side to generate the test script templates, the server side can be understood as a manufacturing factory, namely the server side plays a role of the manufacturing factory to create and prepare test data for each business test node (or business system), when the upstream and downstream business systems perform business test and need to prepare the test data corresponding to the system, the test script templates can be directly used in the manufacturing factory to generate the test data, and the test data can be quickly prepared without searching a plurality of systems and long calling links; each service interaction party (namely each service test node or service system) can conveniently use the test script template of the other party to prepare the required data, so that the test data preparation difficulty and complexity are reduced, and the test data preparation efficiency is improved.
In the test data generation method in one or more embodiments of the present description, after determining a test item identifier and a test parameter corresponding to an upstream service test item in a service link, a test script template corresponding to the upstream service test item is called from a preset database according to the determined test item identifier, where the preset database stores test script templates corresponding to a plurality of service test items in the service link in advance, and then test data for performing a service test on a target service test item is generated according to the test script template and the test parameter corresponding to the upstream service test item. The embodiment of the specification stores the test script templates corresponding to the multiple service test items in advance in the preset database, so that when test data of a target service test item is prepared, the corresponding test script templates can be called conveniently by using the test item identifiers corresponding to the upstream service test items, and then the data of the upstream service test items can be output quickly by combining test parameters to serve as the test data of the target service test item.
Corresponding to the test data generating method described in fig. 2 to 7, based on the same technical concept, one or more embodiments of the present specification further provide a test data generating apparatus, and fig. 8 is a schematic diagram of module composition of the test data generating apparatus provided in one or more embodiments of the present specification, where the apparatus is configured to execute the test data generating method described in fig. 2 to 7, and as shown in fig. 8, the apparatus may include:
an upstream test information determining module 802, configured to determine a test item identifier and a test parameter corresponding to an upstream service test item in a service link; wherein the upstream service test item comprises a service test item upstream of the target service test item;
a test script template calling module 804, configured to call, according to the test item identifier, a test script template corresponding to the upstream service test item from a preset database; the preset database is pre-stored with test script templates corresponding to a plurality of service test items in the service link;
a test data generating module 806, configured to generate test data for performing a service test on the target service test item according to the test script template and the test parameter corresponding to the upstream service test item.
Optionally, the upstream test information determining module 802 is configured to:
receiving a test data generation request sent by a target service test node;
and analyzing the test data generation request to obtain a test item identifier and a test parameter corresponding to an upstream service test item in the service link.
Optionally, the upstream test information determining module 802 is specifically configured to:
sending visual webpage data to a target service test node to enable the target service test node to acquire input information of a user for a visual webpage corresponding to the visual webpage data, wherein the input information comprises: selecting information of an upstream business test item in the visual page and/or test parameters input aiming at the upstream business test item;
and receiving a test data generation request generated by the target service test node based on the input information.
Optionally, the upstream test information determining module 802 is specifically configured to:
and receiving a test data generation request sent by the target service test node through a hypertext transfer protocol (HTTP) interface.
Optionally, the apparatus further comprises: a first template storage module to:
acquiring a test script generated by a service test node aiming at a service test project;
analyzing the test script to obtain a test script template corresponding to the service test item;
and storing the test script template to a preset database.
Optionally, the first template storage module is specifically configured to:
acquiring a test script generated by a service test node according to a preset test frame aiming at a service test item;
and analyzing the test script based on the preset test frame to obtain a test script template corresponding to the service test project.
Optionally, the first template storage module is specifically configured to:
receiving a test script archiving request sent by at least one service test node, wherein the test item archiving request carries the address and/or branch of a distributed version control system of the test script requested to be stored;
inquiring and obtaining the test script corresponding to the test script archiving request from a distributed version control system according to the address and/or the branch of the distributed version control system of the test script;
optionally, the first template storage module is further specifically configured to:
analyzing the test script to obtain test script information;
generating a test script template according to the setting operation of the user on the test script information;
and storing the test script template to a preset database.
Optionally, the apparatus further comprises: a second template storage module for:
receiving a test script template sent by at least one service test node;
and storing the test script template sent by the at least one service test node into a preset database.
Optionally, the apparatus further comprises: a service testing module, configured to:
based on the test data, carrying out service test on the target service test project according to the test script uploaded by the target service test node; alternatively, the first and second electrodes may be,
and sending the test data to a target service test node so that the target service test node performs service test on the target service test item according to the test data.
Optionally, the apparatus further comprises: a third template storage module for:
after the target service test item is tested, generating a test script template corresponding to the target service test item according to a test script used for carrying out service test on the target service test item;
and storing the test script template corresponding to the target service test item into the preset database.
In the test data generation apparatus in one or more embodiments of the present description, after determining a test item identifier and a test parameter corresponding to an upstream service test item in a service link, a test script template corresponding to the upstream service test item is called from a preset database according to the determined test item identifier, where the preset database stores test script templates corresponding to a plurality of service test items in the service link in advance, and then test data for performing a service test on a target service test item is generated according to the test script template and the test parameter corresponding to the upstream service test item. The embodiment of the specification stores the test script templates corresponding to the multiple service test items in advance in the preset database, so that when test data of a target service test item is prepared, the corresponding test script templates can be called conveniently by using the test item identifiers corresponding to the upstream service test items, and then the data of the upstream service test items can be output quickly by combining test parameters as the test data of the target service test item.
It should be noted that the embodiment of the test data generation apparatus in this specification and the embodiment of the test data generation method in this specification are based on the same inventive concept, and therefore, specific implementation of this embodiment may refer to implementation of the corresponding test data generation method, and repeated details are not described again.
Further, corresponding to the methods shown in fig. 2 to 7, based on the same technical concept, one or more embodiments of the present specification further provide a test data generation device, which is configured to perform the test data generation method, as shown in fig. 9.
The test data generating apparatus may have a relatively large difference due to different configurations or performances, and may include one or more processors 901 and a memory 902, and the memory 902 may store one or more stored applications or data. Memory 902 may be, among other things, transient storage or persistent storage. The application program stored in memory 902 may include one or more modules (not shown), each of which may include a series of computer-executable instructions for the test data generation apparatus. Still further, the processor 901 may be arranged in communication with the memory 902 for executing a series of computer executable instructions in the memory 902 on the test data generating device. The test data generation apparatus may also include one or more power supplies 903, one or more wired or wireless network interfaces 904, one or more input-output interfaces 905, one or more keyboards 906, and the like.
In a particular embodiment, the test data generation apparatus comprises a memory, and one or more programs, wherein the one or more programs are stored in the memory, and the one or more programs may comprise one or more modules, and each module may comprise a series of computer-executable instructions for the test data generation apparatus, and the one or more programs configured to be executed by the one or more processors comprise computer-executable instructions for:
determining a test item identifier and a test parameter corresponding to an upstream service test item in a service link; wherein the upstream service test item comprises a service test item upstream of the target service test item;
calling a test script template corresponding to the upstream service test item from a preset database according to the test item identifier; the preset database is pre-stored with test script templates corresponding to a plurality of service test items in the service link;
and generating test data for performing service test on the target service test project according to the test script template and the test parameters corresponding to the upstream service test project.
Optionally, when executed, the computer-executable instructions determine a test item identifier and a test parameter corresponding to an upstream service test item in the service link, including:
receiving a test data generation request sent by a target service test node;
and analyzing the test data generation request to obtain a test item identifier and a test parameter corresponding to an upstream service test item in the service link.
Optionally, when executed, the computer-executable instructions receive a test data generation request sent by a target service test node, where the test data generation request includes:
sending visual webpage data to a target service test node to enable the target service test node to acquire input information of a user for a visual webpage corresponding to the visual webpage data, wherein the input information comprises: selecting information of an upstream business test item in the visual page and/or test parameters input aiming at the upstream business test item;
and receiving a test data generation request generated by the target service test node based on the input information.
Optionally, when executed, the computer-executable instructions receive a test data generation request sent by a target service test node, where the test data generation request includes:
and receiving a test data generation request sent by the target service test node through a hypertext transfer protocol (HTTP) interface.
Optionally, when executed, before the invoking a test script template corresponding to the upstream service test item from a preset database according to the test item identifier, the computer-executable instructions further include:
acquiring a test script generated by a service test node aiming at a service test project;
analyzing the test script to obtain a test script template corresponding to the service test item;
and storing the test script template to a preset database.
Optionally, when executed, the computer-executable instructions obtain a test script generated by the service test node for the service test item, including:
acquiring a test script generated by a service test node according to a preset test frame aiming at a service test item;
the analyzing the test script to obtain the test script template corresponding to the service test item includes:
and analyzing the test script based on the preset test frame to obtain a test script template corresponding to the service test project.
Optionally, when executed, before the invoking a test script template corresponding to the upstream service test item from a preset database according to the test item identifier, the computer-executable instructions further include:
receiving a test script template sent by at least one service test node;
and storing the test script template sent by the at least one service test node into a preset database.
Optionally, when executed, the computer-executable instructions obtain a test script generated by the service test node for the service test item, including:
receiving a test script archiving request sent by at least one service test node, wherein the test item archiving request carries the address and/or branch of a distributed version control system of the test script requested to be stored;
and inquiring the test script corresponding to the test script archiving request from the distributed version control system according to the address and/or the branch of the distributed version control system of the test script.
Optionally, when the computer executable instruction is executed, the analyzing the test script to obtain the test script template corresponding to the service test item includes:
analyzing the test script to obtain test script information;
and generating a test script template according to the setting operation of the user on the test script information.
Optionally, the computer executable instructions, when executed, further comprise computer executable instructions for:
based on the test data, carrying out service test on the target service test project according to the test script uploaded by the target service test node; alternatively, the first and second electrodes may be,
and sending the test data to a target service test node so that the target service test node performs service test on the target service test item according to the test data.
Optionally, the computer executable instructions, when executed, further comprise computer executable instructions for:
after the target service test item is tested, generating a test script template corresponding to the target service test item according to a test script used for carrying out service test on the target service test item;
and storing the test script template corresponding to the target service test item into the preset database.
In the test data generation device in one or more embodiments of the present description, after determining a test item identifier and a test parameter corresponding to an upstream service test item in a service link, a test script template corresponding to the upstream service test item is called from a preset database according to the determined test item identifier, where the preset database stores test script templates corresponding to a plurality of service test items in the service link in advance, and then test data for performing a service test on a target service test item is generated according to the test script template and the test parameter corresponding to the upstream service test item. The embodiment of the specification stores the test script templates corresponding to the multiple service test items in advance in the preset database, so that when test data of a target service test item is prepared, the corresponding test script templates can be called conveniently by using the test item identifiers corresponding to the upstream service test items, and then the data of the upstream service test items can be output quickly by combining test parameters as the test data of the target service test item.
Further, based on the same technical concept, corresponding to the methods shown in fig. 2 to fig. 7, one or more embodiments of the present specification further provide a storage medium for storing computer-executable instructions, where in a specific embodiment, the storage medium may be a usb disk, an optical disk, a hard disk, and the like, and the storage medium stores computer-executable instructions that, when executed by a processor, implement the following processes:
determining a test item identifier and a test parameter corresponding to an upstream service test item in a service link; wherein the upstream service test item comprises a service test item upstream of the target service test item;
calling a test script template corresponding to the upstream service test item from a preset database according to the test item identifier; the preset database is pre-stored with test script templates corresponding to a plurality of service test items in the service link;
and generating test data for performing service test on the target service test project according to the test script template and the test parameters corresponding to the upstream service test project.
Optionally, the storage medium stores computer-executable instructions, which when executed by the processor, determine a test item identifier and a test parameter corresponding to an upstream service test item in the service link, including:
receiving a test data generation request sent by a target service test node;
and analyzing the test data generation request to obtain a test item identifier and a test parameter corresponding to an upstream service test item in the service link.
Optionally, the storage medium stores computer-executable instructions, which when executed by the processor, receive a test data generation request sent by a target service test node, and includes:
sending visual webpage data to a target service test node to enable the target service test node to acquire input information of a user for a visual webpage corresponding to the visual webpage data, wherein the input information comprises: selecting information of an upstream business test item in the visual page and/or test parameters input aiming at the upstream business test item;
and receiving a test data generation request generated by the target service test node based on the input information.
Optionally, the storage medium stores computer-executable instructions, which when executed by the processor, receive a test data generation request sent by a target service test node, and includes:
and receiving a test data generation request sent by the target service test node through a hypertext transfer protocol (HTTP) interface.
Optionally, when executed by the processor, the computer-executable instructions stored in the storage medium further include, before the invoking a test script template corresponding to the upstream service test item from a preset database according to the test item identifier, that:
acquiring a test script generated by a service test node aiming at a service test project;
analyzing the test script to obtain a test script template corresponding to the service test item;
and storing the test script template to a preset database.
Optionally, the computer-executable instructions stored in the storage medium, when executed by the processor, obtain a test script generated by the service test node for the service test item, including:
acquiring a test script generated by a service test node according to a preset test frame aiming at a service test item;
the analyzing the test script to obtain the test script template corresponding to the service test item includes:
and analyzing the test script based on the preset test frame to obtain a test script template corresponding to the service test project.
Optionally, when executed by the processor, the computer-executable instructions stored in the storage medium further include, before the invoking a test script template corresponding to the upstream service test item from a preset database according to the test item identifier, that:
receiving a test script template sent by at least one service test node;
and storing the test script template sent by the at least one service test node into a preset database.
Optionally, the computer-executable instructions stored in the storage medium, when executed by the processor, obtain a test script generated by the service test node for the service test item, including:
receiving a test script archiving request sent by at least one service test node, wherein the test item archiving request carries the address and/or branch of a distributed version control system of the test script requested to be stored;
and inquiring the test script corresponding to the test script archiving request from the distributed version control system according to the address and/or the branch of the distributed version control system of the test script.
Optionally, when the computer executable instructions stored in the storage medium are executed by the processor, the parsing the test script to obtain the test script template corresponding to the service test item includes:
analyzing the test script to obtain test script information;
and generating a test script template according to the setting operation of the user on the test script information.
Optionally, the storage medium stores computer executable instructions that, when executed by the processor, further implement the following process:
based on the test data, carrying out service test on the target service test project according to the test script uploaded by the target service test node; alternatively, the first and second electrodes may be,
and sending the test data to a target service test node so that the target service test node performs service test on the target service test item according to the test data.
Optionally, the storage medium stores computer executable instructions that, when executed by the processor, further implement the following process:
after the target service test item is tested, generating a test script template corresponding to the target service test item according to a test script used for carrying out service test on the target service test item;
and storing the test script template corresponding to the target service test item into the preset database.
When a computer executable instruction stored in a storage medium in one or more embodiments of the present specification is executed by a processor, after a test item identifier and a test parameter corresponding to an upstream service test item in a service link are determined, a test script template corresponding to the upstream service test item is called from a preset database according to the determined test item identifier, where the preset database stores test script templates corresponding to a plurality of service test items in the service link in advance, and then test data for performing a service test on a target service test item is generated according to the test script template and the test parameter corresponding to the upstream service test item. The embodiment of the specification stores the test script templates corresponding to the multiple service test items in advance in the preset database, so that when test data of a target service test item is prepared, the corresponding test script templates can be called conveniently by using the test item identifiers corresponding to the upstream service test items, and then the data of the upstream service test items can be output quickly by combining test parameters as the test data of the target service test item.
It should be noted that the embodiment of the storage medium in this specification and the embodiment of the test data generation method in this specification are based on the same inventive concept, and therefore, for specific implementation of this embodiment, reference may be made to implementation of the corresponding test data generation method, and repeated details are not described again.
The foregoing description has been directed to specific embodiments of this disclosure. Other embodiments are within the scope of the following claims. In some cases, the actions or steps recited in the claims may be performed in a different order than in the embodiments and still achieve desirable results. In addition, the processes depicted in the accompanying figures do not necessarily require the particular order shown, or sequential order, to achieve desirable results. In some embodiments, multitasking and parallel processing may also be possible or may be advantageous.
In the 90 s of the 20 th century, improvements in a technology could clearly distinguish between improvements in hardware (e.g., improvements in circuit structures such as diodes, transistors, switches, etc.) and improvements in software (improvements in process flow). However, as technology advances, many of today's process flow improvements have been seen as direct improvements in hardware circuit architecture. Designers almost always obtain the corresponding hardware circuit structure by programming an improved method flow into the hardware circuit. Thus, it cannot be said that an improvement in the process flow cannot be realized by hardware physical modules. For example, a Programmable Logic Device (PLD), such as a Field Programmable Gate Array (FPGA), is an integrated circuit whose Logic functions are determined by programming the Device by a user. A digital system is "integrated" on a PLD by the designer's own programming without requiring the chip manufacturer to design and fabricate application-specific integrated circuit chips. Furthermore, nowadays, instead of manually making an Integrated Circuit chip, such Programming is often implemented by "logic compiler" software, which is similar to a software compiler used in program development and writing, but the original code before compiling is also written by a specific Programming Language, which is called Hardware Description Language (HDL), and HDL is not only one but many, such as abel (advanced Boolean Expression Language), ahdl (alternate Language Description Language), traffic, pl (core unified Programming Language), Cal, jhdware Description Language, langua, mylar, pams, hardlanguage (Hardware Description Language), vhlanguage, Language, HDL, software Language (Hardware Description Language), and vhjjjjjjjjjjjjjjjg Language, which are currently used in most fields. It will also be apparent to those skilled in the art that hardware circuitry that implements the logical method flows can be readily obtained by merely slightly programming the method flows into an integrated circuit using the hardware description languages described above.
The controller may be implemented in any suitable manner, for example, the controller may take the form of, for example, a microprocessor or processor and a computer-readable medium storing computer-readable program code (e.g., software or firmware) executable by the (micro) processor, logic gates, switches, an Application Specific Integrated Circuit (ASIC), a programmable logic controller, and an embedded microcontroller, examples of which include, but are not limited to, the following microcontrollers: ARC 625D, Atmel AT91SAM, Microchip PIC18F26K20, and Silicone Labs C8051F320, the memory controller may also be implemented as part of the control logic for the memory. Those skilled in the art will also appreciate that, in addition to implementing the controller as pure computer readable program code, the same functionality can be implemented by logically programming method steps such that the controller is in the form of logic gates, switches, application specific integrated circuits, programmable logic controllers, embedded microcontrollers and the like. Such a controller may thus be considered a hardware component, and the means included therein for performing the various functions may also be considered as a structure within the hardware component. Or even means for performing the functions may be regarded as being both a software module for performing the method and a structure within a hardware component.
The systems, devices, modules or units illustrated in the above embodiments may be implemented by a computer chip or an entity, or by a product with certain functions. One typical implementation device is a computer. In particular, the computer may be, for example, a personal computer, a laptop computer, a cellular telephone, a camera phone, a smartphone, a personal digital assistant, a media player, a navigation device, an email device, a game console, a tablet computer, a wearable device, or a combination of any of these devices.
For convenience of description, the above devices are described as being divided into various units by function, and are described separately. Of course, the functionality of the various elements may be implemented in the same one or more software and/or hardware implementations of one or more of the present descriptions.
As will be appreciated by one skilled in the art, one or more embodiments of the present description may be provided as a method, system, or computer program product. Accordingly, one or more of the present description may take the form of an entirely hardware embodiment, an entirely software embodiment or an embodiment combining software and hardware aspects. Furthermore, one or more of the present description may take the form of a computer program product embodied on one or more computer-usable storage media (including, but not limited to, disk storage, CD-ROM, optical storage, and the like) having computer-usable program code embodied in the medium.
One or more of the present specification has been described with reference to flowchart illustrations and/or block diagrams of methods, apparatus (systems), and computer program products according to one or more embodiments of the specification. It will be understood that each flow and/or block of the flow diagrams and/or block diagrams, and combinations of flows and/or blocks in the flow diagrams and/or block diagrams, can be implemented by computer program instructions. These computer program instructions may be provided to a processor of a general purpose computer, special purpose computer, embedded processor, or other programmable data processing apparatus to produce a machine, such that the instructions, which execute via the processor of the computer or other programmable data processing apparatus, create means for implementing the functions specified in the flowchart flow or flows and/or block diagram block or blocks.
These computer program instructions may also be stored in a computer-readable memory that can direct a computer or other programmable data processing apparatus to function in a particular manner, such that the instructions stored in the computer-readable memory produce an article of manufacture including instruction means which implement the function specified in the flowchart flow or flows and/or block diagram block or blocks.
These computer program instructions may also be loaded onto a computer or other programmable data processing apparatus to cause a series of operational steps to be performed on the computer or other programmable apparatus to produce a computer implemented process such that the instructions which execute on the computer or other programmable apparatus provide steps for implementing the functions specified in the flowchart flow or flows and/or block diagram block or blocks.
In a typical configuration, a computing device includes one or more processors (CPUs), input/output interfaces, network interfaces, and memory.
The memory may include forms of volatile memory in a computer readable medium, Random Access Memory (RAM) and/or non-volatile memory, such as Read Only Memory (ROM) or flash memory (flash RAM). Memory is an example of a computer-readable medium.
Computer-readable media, including both non-transitory and non-transitory, removable and non-removable media, may implement information storage by any method or technology. The information may be computer readable instructions, data structures, modules of a program, or other data. Examples of computer storage media include, but are not limited to, phase change memory (PRAM), Static Random Access Memory (SRAM), Dynamic Random Access Memory (DRAM), other types of Random Access Memory (RAM), Read Only Memory (ROM), Electrically Erasable Programmable Read Only Memory (EEPROM), flash memory or other memory technology, compact disc read only memory (CD-ROM), Digital Versatile Discs (DVD) or other optical storage, magnetic cassettes, magnetic tape, magnetic disk storage or other magnetic storage devices, or any other non-transmission medium that can be used to store information that can be accessed by a computing device. As defined herein, a computer readable medium does not include a transitory computer readable medium such as a modulated data signal and a carrier wave.
It should also be noted that the terms "comprises," "comprising," or any other variation thereof, are intended to cover a non-exclusive inclusion, such that a process, method, article, or apparatus that comprises a list of elements does not include only those elements but may include other elements not expressly listed or inherent to such process, method, article, or apparatus. Without further limitation, an element defined by the phrase "comprising an … …" does not exclude the presence of other like elements in a process, method, article, or apparatus that comprises the element.
As will be appreciated by one skilled in the art, one or more embodiments of the present description may be provided as a method, system, or computer program product. Accordingly, one or more of the present description may take the form of an entirely hardware embodiment, an entirely software embodiment or an embodiment combining software and hardware aspects. Furthermore, one or more of the present description may take the form of a computer program product embodied on one or more computer-usable storage media (including, but not limited to, disk storage, CD-ROM, optical storage, and the like) having computer-usable program code embodied in the medium.
One or more of the present specification can be described in the general context of computer-executable instructions, such as program modules, being executed by a computer. Generally, program modules include routines, programs, objects, components, data structures, etc. that perform particular tasks or implement particular abstract data types. One or more of the present specification can also be practiced in distributed computing environments where tasks are performed by remote processing devices that are linked through a communications network. In a distributed computing environment, program modules may be located in both local and remote computer storage media including memory storage devices.
The embodiments in the present specification are described in a progressive manner, and the same and similar parts among the embodiments are referred to each other, and each embodiment focuses on the differences from the other embodiments. In particular, for the system embodiment, since it is substantially similar to the method embodiment, the description is simple, and for the relevant points, reference may be made to the partial description of the method embodiment.
The above description is merely illustrative of one or more embodiments of the present disclosure and is not intended to limit one or more embodiments of the present disclosure. Various modifications and alterations to one or more of the present descriptions will be apparent to those skilled in the art. Any modification, equivalent replacement, improvement or the like made within the spirit and principle of one or more of the present specification should be included in the scope of one or more claims of the present specification.

Claims (14)

1. A method for generating test data, comprising:
determining a test item identifier and a test parameter corresponding to an upstream service test item in a service link; wherein the upstream service test item comprises a service test item upstream of the target service test item;
calling a test script template corresponding to the upstream service test item from a preset database according to the test item identifier; the preset database is pre-stored with test script templates corresponding to a plurality of service test items in the service link;
and generating test data for performing service test on the target service test project according to the test script template and the test parameters corresponding to the upstream service test project.
2. The method of claim 1, wherein the determining the test item identifier and the test parameter corresponding to the upstream service test item in the service link comprises:
receiving a test data generation request sent by a target service test node;
and analyzing the test data generation request to obtain a test item identifier and a test parameter corresponding to an upstream service test item in the service link.
3. The method according to claim 2, wherein the receiving of the test data generation request sent by the target service test node comprises:
sending visual webpage data to a target service test node to enable the target service test node to acquire input information of a user for a visual webpage corresponding to the visual webpage data, wherein the input information comprises: selecting information of an upstream business test item in the visual webpage and/or test parameters input aiming at the upstream business test item;
and receiving a test data generation request generated by the target service test node based on the input information.
4. The method according to claim 2, wherein the receiving of the test data generation request sent by the target service test node comprises:
and receiving a test data generation request sent by the target service test node through a hypertext transfer protocol (HTTP) interface.
5. The method according to claim 1, before said calling a test script template corresponding to the upstream service test item from a preset database according to the test item identifier, further comprising:
acquiring a test script generated by a service test node aiming at a service test project;
analyzing the test script to obtain a test script template corresponding to the service test item;
and storing the test script template to a preset database.
6. The method of claim 5, wherein obtaining the test script generated by the service test node for the service test item comprises:
acquiring a test script generated by a service test node according to a preset test frame aiming at a service test item;
the analyzing the test script to obtain the test script template corresponding to the service test item includes:
and analyzing the test script based on the preset test frame to obtain a test script template corresponding to the service test project.
7. The method of claim 5, wherein obtaining the test script generated by the service test node for the service test item comprises:
receiving a test script archiving request sent by at least one service test node, wherein the test item archiving request carries the address and/or branch of a distributed version control system of the test script requested to be stored;
and inquiring the test script corresponding to the test script archiving request from the distributed version control system according to the address and/or the branch of the distributed version control system of the test script.
8. The method according to claim 5, wherein the parsing the test script to obtain a test script template corresponding to the service test item comprises:
analyzing the test script to obtain test script information;
and generating a test script template according to the setting operation of the user on the test script information.
9. The method according to claim 1, before said calling a test script template corresponding to the upstream service test item from a preset database according to the test item identifier, further comprising:
receiving a test script template sent by at least one service test node;
and storing the test script template sent by the at least one service test node into a preset database.
10. The method of claim 1, further comprising:
based on the test data, carrying out service test on the target service test project according to the test script uploaded by the target service test node; alternatively, the first and second electrodes may be,
and sending the test data to a target service test node so that the target service test node performs service test on the target service test item according to the test data.
11. The method of claim 10, further comprising:
after the target service test item is tested, generating a test script template corresponding to the target service test item according to a test script used for carrying out service test on the target service test item;
and storing the test script template corresponding to the target service test item into the preset database.
12. A test data generation apparatus, comprising:
the test item identification determining module is used for determining a test item identification and a test parameter corresponding to an upstream service test item in a service link; wherein the upstream service test item comprises a service test item upstream of the target service test item;
the test script template calling module is used for calling a test script template corresponding to the upstream service test item from a preset database according to the test item identification; the preset database is pre-stored with test script templates corresponding to a plurality of service test items in the service link;
and the test data generation module is used for generating test data for carrying out service test on the target service test project according to the test script template corresponding to the upstream service test project and the test parameters.
13. A test data generation device, characterized by comprising: a processor, and a memory arranged to store computer executable instructions; the computer executable instructions, when executed, cause the processor to implement the steps of the method of any of the preceding claims 1 to 11.
14. A computer-readable storage medium, characterized in that a computer program is stored on the computer-readable storage medium, which computer program, when being executed by a processor, carries out the steps of the method of one of the preceding claims 1 to 11.
CN202010879972.8A 2020-08-27 2020-08-27 Test data generation method, device, equipment and storage medium Pending CN112162915A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202010879972.8A CN112162915A (en) 2020-08-27 2020-08-27 Test data generation method, device, equipment and storage medium

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202010879972.8A CN112162915A (en) 2020-08-27 2020-08-27 Test data generation method, device, equipment and storage medium

Publications (1)

Publication Number Publication Date
CN112162915A true CN112162915A (en) 2021-01-01

Family

ID=73860310

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202010879972.8A Pending CN112162915A (en) 2020-08-27 2020-08-27 Test data generation method, device, equipment and storage medium

Country Status (1)

Country Link
CN (1) CN112162915A (en)

Cited By (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN112835809A (en) * 2021-03-22 2021-05-25 亿企赢网络科技有限公司 Test data setting method, device, equipment and medium based on browser
CN113127358A (en) * 2021-04-23 2021-07-16 北京映客芝士网络科技有限公司 Test method, test device, electronic equipment and medium
CN113282499A (en) * 2021-05-31 2021-08-20 长沙市到家悠享家政服务有限公司 Method, system, device and medium for creating test data
CN113468536A (en) * 2021-05-27 2021-10-01 北京达佳互联信息技术有限公司 Detection method, device, system, electronic equipment and storage medium
CN113742249A (en) * 2021-11-05 2021-12-03 麒麟软件有限公司 Test script granulation method and system based on desktop operating system
CN114595159A (en) * 2022-05-10 2022-06-07 太平金融科技服务(上海)有限公司 Test data generation method, device, equipment and storage medium

Citations (11)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20160148130A1 (en) * 2014-11-26 2016-05-26 Wipro Limited Method and system for automatically generating a test artifact
CN107329890A (en) * 2017-06-06 2017-11-07 北京金山安全软件有限公司 Test method and device based on Mock and server
CN107480053A (en) * 2017-07-21 2017-12-15 杭州销冠网络科技有限公司 A kind of Software Test Data Generation Method and device
CN107844421A (en) * 2017-10-31 2018-03-27 平安科技(深圳)有限公司 Interface test method, device, computer equipment and storage medium
CN108804336A (en) * 2018-06-15 2018-11-13 深圳壹账通智能科技有限公司 Interactive system test method, device, computer equipment and storage medium
CN109446059A (en) * 2018-09-12 2019-03-08 北京邮电大学 The generation method and device of test template script
CN109726105A (en) * 2018-05-15 2019-05-07 平安普惠企业管理有限公司 Test data building method, device, equipment and storage medium
CN110058990A (en) * 2019-03-12 2019-07-26 平安普惠企业管理有限公司 Performance test methods and device, computer equipment, storage medium
CN110147318A (en) * 2019-04-19 2019-08-20 平安普惠企业管理有限公司 It is a kind of to generate the method and device of test data, electronic equipment
CN111352853A (en) * 2020-05-25 2020-06-30 南京领行科技股份有限公司 Compatibility testing method, device, server and storage medium
WO2020155778A1 (en) * 2019-02-03 2020-08-06 苏州市龙测智能科技有限公司 Interface automation test method, test apparatus, test device and storage medium

Patent Citations (11)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20160148130A1 (en) * 2014-11-26 2016-05-26 Wipro Limited Method and system for automatically generating a test artifact
CN107329890A (en) * 2017-06-06 2017-11-07 北京金山安全软件有限公司 Test method and device based on Mock and server
CN107480053A (en) * 2017-07-21 2017-12-15 杭州销冠网络科技有限公司 A kind of Software Test Data Generation Method and device
CN107844421A (en) * 2017-10-31 2018-03-27 平安科技(深圳)有限公司 Interface test method, device, computer equipment and storage medium
CN109726105A (en) * 2018-05-15 2019-05-07 平安普惠企业管理有限公司 Test data building method, device, equipment and storage medium
CN108804336A (en) * 2018-06-15 2018-11-13 深圳壹账通智能科技有限公司 Interactive system test method, device, computer equipment and storage medium
CN109446059A (en) * 2018-09-12 2019-03-08 北京邮电大学 The generation method and device of test template script
WO2020155778A1 (en) * 2019-02-03 2020-08-06 苏州市龙测智能科技有限公司 Interface automation test method, test apparatus, test device and storage medium
CN110058990A (en) * 2019-03-12 2019-07-26 平安普惠企业管理有限公司 Performance test methods and device, computer equipment, storage medium
CN110147318A (en) * 2019-04-19 2019-08-20 平安普惠企业管理有限公司 It is a kind of to generate the method and device of test data, electronic equipment
CN111352853A (en) * 2020-05-25 2020-06-30 南京领行科技股份有限公司 Compatibility testing method, device, server and storage medium

Non-Patent Citations (3)

* Cited by examiner, † Cited by third party
Title
何舒: "API接口自动化测试系统设计及实现", 《中国优秀硕士学位论文全文数据库 信息科技辑》, 15 March 2019 (2019-03-15), pages 138 - 506 *
滕莎: "Web产品自动化测试系统设计与实现", 《中国优秀硕士学位论文全文数据库信息科技辑》, 15 September 2011 (2011-09-15), pages 138 - 251 *
潘诗瑶: "Web应用系统中的MOCK测试技术", 《软件》, no. 12, 15 December 2016 (2016-12-15), pages 214 - 218 *

Cited By (7)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN112835809A (en) * 2021-03-22 2021-05-25 亿企赢网络科技有限公司 Test data setting method, device, equipment and medium based on browser
CN113127358A (en) * 2021-04-23 2021-07-16 北京映客芝士网络科技有限公司 Test method, test device, electronic equipment and medium
CN113468536A (en) * 2021-05-27 2021-10-01 北京达佳互联信息技术有限公司 Detection method, device, system, electronic equipment and storage medium
CN113282499A (en) * 2021-05-31 2021-08-20 长沙市到家悠享家政服务有限公司 Method, system, device and medium for creating test data
CN113282499B (en) * 2021-05-31 2024-02-09 长沙市到家悠享家政服务有限公司 Method, system, equipment and medium for creating test data
CN113742249A (en) * 2021-11-05 2021-12-03 麒麟软件有限公司 Test script granulation method and system based on desktop operating system
CN114595159A (en) * 2022-05-10 2022-06-07 太平金融科技服务(上海)有限公司 Test data generation method, device, equipment and storage medium

Similar Documents

Publication Publication Date Title
CN107562467B (en) Page rendering method, device and equipment
CN112162915A (en) Test data generation method, device, equipment and storage medium
CN110532020B (en) Data processing method, device and system for micro-service arrangement
CN109002362B (en) Service method, device and system and electronic equipment
CN107644286B (en) Workflow processing method and device
CN108845940B (en) Enterprise-level information system automatic function testing method and system
CN110597730B (en) Automatic test case generation method and system based on scene method
CN110968601A (en) Data query processing method and device
US11487595B2 (en) API adapter creation device, API adapter creation method, and API adapter creation program
CN111241182A (en) Data processing method and apparatus, storage medium, and electronic apparatus
CN112015739A (en) Data verification and data query method and device
CN110569428A (en) recommendation model construction method, device and equipment
CN110990274A (en) Data processing method, device and system for generating test case
CN115841236A (en) Business modeling method, device and medium for realizing quick response
CN103186384A (en) Business-component-oriented software designing and analyzing system and using method thereof
CN110602163B (en) File uploading method and device
CN110874322B (en) Test method and test server for application program
CN112491943A (en) Data request method, device, storage medium and electronic equipment
CN115390852A (en) Method and device for generating uniform abstract syntax tree and program analysis
CN113434063B (en) Information display method, device and equipment
CN114449063A (en) Message processing method, device and equipment
CN110704742B (en) Feature extraction method and device
CN109597695B (en) Data processing method, device and equipment
CN113391795A (en) Method and system for realizing self-adaptive mapping of application scene and software development kit
CN111797070A (en) Ticket data processing method and device

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