CN115145810A - Method, device, equipment, medium and product for obtaining test data - Google Patents

Method, device, equipment, medium and product for obtaining test data Download PDF

Info

Publication number
CN115145810A
CN115145810A CN202210727194.XA CN202210727194A CN115145810A CN 115145810 A CN115145810 A CN 115145810A CN 202210727194 A CN202210727194 A CN 202210727194A CN 115145810 A CN115145810 A CN 115145810A
Authority
CN
China
Prior art keywords
data
tested
query
item
items
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
CN202210727194.XA
Other languages
Chinese (zh)
Inventor
陈道明
杨爱珍
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
China Construction Bank Corp
Original Assignee
China Construction Bank Corp
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 China Construction Bank Corp filed Critical China Construction Bank Corp
Priority to CN202210727194.XA priority Critical patent/CN115145810A/en
Publication of CN115145810A publication Critical patent/CN115145810A/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/362Software debugging
    • G06F11/3644Software debugging by instrumenting at runtime
    • 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

Landscapes

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

Abstract

The present application relates to the field of computer software testing technologies, and in particular, to a method, an apparatus, a device, a medium, and a product for obtaining test data. And after receiving the first query instruction, calling a query preparation interface in the interface group, and acquiring constraint conditions corresponding to the items to be tested in the target template from the metadata through the query preparation interface. And after receiving the first query instruction or the second query instruction, calling a query execution interface in the interface group, and acquiring query data corresponding to the item to be tested from data pre-configured in the data pool through the query execution interface. After the constraint condition corresponding to the item to be tested and the query data are obtained, the test data meeting the constraint condition are selected from the query data. Therefore, when data are configured in the data pool in advance and query data of items to be tested need to be obtained, the query data corresponding to the items to be tested are directly called from the data pool, test data meeting constraint conditions are selected, the preparation time of the test data is shortened, and the test efficiency is improved.

Description

Method, device, equipment, medium and product for obtaining test data
Technical Field
The present application relates to the field of computer software testing technologies, and in particular, to a method, an apparatus, a device, a medium, and a product for obtaining test data.
Background
The test data is data in the form of tasks, such as pictures, text, video, etc., for testing different applications, which are used to check whether the software under test can work as expected, and also to test the limits of the applications or to determine their salient points by boundary value testing.
At present, test data are created manually according to the requirements of test tasks, so that the preparation time of the test data is long, and the test efficiency is influenced.
Disclosure of Invention
The application provides a method, a device, equipment, a medium and a product for obtaining test data, which are used for reducing the preparation time of the test data and improving the test efficiency.
In a first aspect, the present application provides a method for obtaining test data, including:
after receiving a first query instruction, calling a query preparation interface in an interface group, and acquiring constraint conditions corresponding to items to be tested in a target template from metadata through the query preparation interface;
after the first query instruction or the second query instruction is received, a query execution interface in the interface group is called, and query data corresponding to the item to be tested is acquired from data pre-configured in a data pool through the query execution interface;
and selecting the test data meeting the constraint condition from the query data.
Optionally, the obtaining query data corresponding to the item to be tested from data preconfigured in the data pool specifically includes:
and acquiring query data corresponding to each item to be tested from data pre-configured in a data pool in sequence according to the sequence of the serial numbers of the items to be tested from small to large.
Optionally, the obtaining of the constraint condition corresponding to the item to be tested in the target template from the metadata specifically includes:
and sequentially searching constraint conditions corresponding to each item to be tested in the metadata according to the sequence of the serial numbers of the items to be tested in the target template from small to large, and acquiring the constraint conditions corresponding to the items to be tested with the constraint conditions.
Optionally, the obtaining query data corresponding to the item to be tested from data preconfigured in the data pool specifically includes:
and acquiring data pre-configured in a data pool, and selecting query data corresponding to each item to be tested from the pre-configured data.
Optionally, the method further includes:
and replacing the items to be tested in the target template, acquiring constraint conditions corresponding to the replaced items to be tested from the metadata, and acquiring query data corresponding to the replaced items to be tested from a data pool.
Optionally, the method further includes:
and adding the items to be tested in the target template, acquiring constraint conditions corresponding to the added items to be tested from the metadata, and acquiring query data corresponding to the added items to be tested from a data pool.
Optionally, the method further includes:
configuring data in the data pool in advance, and updating the data configured in the data pool according to a preset time interval;
the acquiring query data corresponding to the item to be tested from the data pre-configured in the data pool specifically includes:
and acquiring query data corresponding to the item to be tested from the updated data pool according to the preset time interval.
Optionally, the method further includes:
receiving an acquisition instruction, calling an acquisition interface in the interface group, and selecting a target template for the test task from a template library through the acquisition interface according to the item to be tested of the test task in the acquisition instruction.
Optionally, the method further includes:
and sending the test data to a front-end client so that the front-end client fills the test data into the target template, and testing the test task by using the target template filled with the test data.
In a second aspect, the present application provides an apparatus for obtaining test data, comprising: the first acquisition module is used for calling a query preparation interface in the interface group after receiving a first query instruction, and acquiring constraint conditions corresponding to items to be tested in the target template from metadata through the query preparation interface;
the second acquisition module is used for calling the query execution interface in the interface group after receiving the first query instruction or the second query instruction, and acquiring query data corresponding to the item to be tested from data pre-configured in a data pool through the query execution interface;
and the selecting module is used for selecting the test data meeting the constraint condition from the query data.
In a third aspect, the present application provides an electronic device, comprising: a memory and a processor;
the memory is used for storing instructions; the processor is arranged to invoke instructions in the memory to perform the method of retrieving test data in the first aspect and any one of the possible designs of the first aspect.
In a fourth aspect, the present application provides a computer-readable storage medium having stored thereon computer instructions, which, when executed by at least one processor of an electronic device, cause the electronic device to perform the method for obtaining test data in any one of the possible designs of the first aspect and the first aspect.
In a fifth aspect, the present application provides a computer program product comprising computer instructions which, when executed by at least one processor of an electronic device, cause the electronic device to perform the method of obtaining test data of the first aspect and any one of the possible designs of the first aspect.
According to the method for obtaining the test data, after the first query instruction is received, the query preparation interface in the interface group is called, and the constraint condition corresponding to the item to be tested in the target template is obtained from the metadata through the query preparation interface. And after receiving the first query instruction or the second query instruction, calling a query execution interface in the interface group, and acquiring query data corresponding to the item to be tested from data pre-configured in the data pool through the query execution interface. After obtaining the constraint condition corresponding to the item to be tested and the query data, selecting the test data meeting the constraint condition from the query data. Therefore, when data are pre-configured in the data pool and query data of items to be tested need to be acquired, the query data corresponding to the items to be tested are directly called from the data pool, test data meeting constraint conditions are selected, the preparation time of the test data is shortened, and the test efficiency is improved.
Drawings
In order to more clearly illustrate the technical solutions in the present application or prior art, the drawings used in the embodiments or the description of the prior art are briefly described below, and it is obvious that the drawings in the following description are some embodiments of the present application, and it is obvious for those skilled in the art to obtain other drawings without creative efforts.
Fig. 1 is a schematic view of a scenario of a method for acquiring test data according to an embodiment of the present application;
FIG. 2 is a flowchart of a method for obtaining test data according to an embodiment of the present application;
fig. 3 is a signaling interaction diagram of a method for acquiring test data according to an embodiment of the present application;
FIG. 4 is a schematic structural diagram of an apparatus for acquiring test data according to an embodiment of the present disclosure;
fig. 5 is a schematic hardware structure diagram of an electronic device according to an embodiment of the present application.
Detailed Description
To make the purpose, technical solutions and advantages of the present application clearer, the technical solutions in the present application will be clearly and completely described below with reference to the drawings in the present application, and it is obvious that the described embodiments are some, but not all embodiments of the present application. All other embodiments obtained by a person of ordinary skill in the art based on the embodiments in the present application without making any creative effort belong to the protection scope of the present application.
With the complexity of software systems becoming higher and higher, a piece of software is often written by a plurality of software engineers, one software engineer is responsible for a piece of module, each software engineer may focus on only the responsible module, the whole piece of software is not well known, and if the software is directly run, many errors are easily generated. Thus, testing of software is required, which is primarily the operation of a program under specified conditions to discover bugs, to measure software quality, and to evaluate whether the software meets design requirements.
Before testing the software, test data is created, which is used to detect whether the software under test can work as expected. The test data can be word or excel, comprises a user name, a password, other database fields and the like, and is used for testing the positive results and the negative results of the application program; the test data may also be pictures or images for applications that verify different objects or different facial expressions, for data analysis, autopilot technology, etc.; the test data may also be audio for identifying different language commands.
At present, test data are created manually according to the requirements of a test task, so that the preparation time of the test data is long, and the test efficiency is influenced. And because different test tasks need to establish different test data manually, thereby need investing a large amount of manpower, make the test prepare the input cost higher.
In order to solve the above problem, the present application provides a method for acquiring test data. And after receiving the first query instruction, calling a query preparation interface in the interface group, and acquiring constraint conditions corresponding to the items to be tested in the target template from the metadata through the query preparation interface. And after receiving the first query instruction or the second query instruction, calling a query execution interface in the interface group, and acquiring query data corresponding to the item to be tested from data pre-configured in the data pool through the query execution interface. After obtaining the constraint condition corresponding to the item to be tested and the query data, selecting the test data meeting the constraint condition from the query data. Therefore, when data are pre-configured in the data pool and query data of items to be tested need to be acquired, the query data corresponding to the items to be tested are directly called from the data pool, test data meeting constraint conditions are selected, the preparation time of the test data is shortened, and the test efficiency is improved. Meanwhile, as more data are pre-configured in the data pool, corresponding query data can be provided for a plurality of different items to be tested, so that the test preparation investment cost is reduced.
The technical solution of the present application will be described in detail below with specific examples. The following several specific embodiments may be combined with each other, and details of the same or similar concepts or processes may not be repeated in some embodiments.
Fig. 1 is a schematic view illustrating a scenario for acquiring test data according to an embodiment of the present application. The front-end client 101 receives a first query instruction, and sends the first query instruction to the back-end server 102, where the first query instruction includes an item to be tested in the target template. The front-end client 101 may further receive a second query instruction, and send the second query instruction to the back-end server 102, where the second query instruction includes an item to be tested in the target template. The back-end server 102 may obtain the item to be tested in the first query instruction after receiving the first query instruction, call a query preparation interface and a query execution interface in the interface group, obtain the constraint condition corresponding to the item to be tested in the target template from the metadata through the query preparation interface, and obtain the query data corresponding to the item to be tested from the data pre-configured in the data pool through the query execution interface. The back-end server 102 may also obtain the items to be tested in the first query instruction after receiving the first query instruction, only call the query preparation interface in the interface group, and obtain the constraint conditions corresponding to the items to be tested in the target template from the metadata through the query preparation interface; and after receiving the second query instruction, acquiring the items to be tested in the second query instruction, calling a query execution interface in the interface group, and acquiring query data corresponding to the items to be tested from the data pre-configured in the data pool through the query execution interface. Then, the back-end server 102 picks out test data meeting the constraint condition from the query data, and may return the test data to the front-end client 101. The front-end client 101 fills the test data into the corresponding item to be tested in the target template, and sends the filled target template to the back-end server 102. The back-end server 102 tests the test task using the target template filled with the test data, and may return the test result to the front-end client 101.
Fig. 2 is a flowchart illustrating a method for obtaining test data according to an embodiment of the present application. On the basis of the embodiment shown in fig. 1, as shown in fig. 2, the method of this embodiment may include the following steps, taking a backend server as an execution subject:
s101, after receiving a first query instruction, calling a query preparation interface in the interface group, and acquiring constraint conditions corresponding to items to be tested in the target template from the metadata through the query preparation interface.
The tester sends a first query instruction to the front-end client through an input device, which may be a mouse, a keyboard, or the like. The front-end client sends the first query instruction to the back-end server after receiving the first query instruction, wherein the first query instruction comprises the name, the identification, the serial number and the like of the item to be tested in the target template, and the first query instruction can be used for indicating constraint conditions corresponding to the item to be tested in the query target template and also can be used for indicating query data corresponding to the item to be tested in the query target template.
After receiving the first query instruction, the back-end server calls a query preparation interface in an interface group, wherein the interface group can be located in a data query service and comprises a plurality of interfaces such as a query preparation interface, a query execution interface and a test interface, so that the data transmission speed is improved. And then, the back-end server is connected with the metadata through a query preparation interface, and acquires constraint conditions corresponding to the items to be tested in the target template from the metadata, wherein the constraint conditions are constraints corresponding to the items to be tested and are used for limiting the test data, and the constraint conditions can comprise unique constraints, default value constraints, non-empty constraints and the like. For example, if the item to be tested is an identity type and the constraint condition of the item to be tested is a unique constraint, only one identity type can be selected. For example, if the item to be tested is a bank classification and the constraint condition of the item to be tested is a default constraint, the bank classification may only select a default bank. For example, if the item to be tested is a name, and the constraint condition of the item to be tested is a non-null constraint, the name is a mandatory item.
S102, receiving the first query instruction or the second query instruction, calling a query execution interface in the interface group, and acquiring query data corresponding to the item to be tested from data pre-configured in the data pool through the query execution interface.
The data pool can be understood as a data container arranged according to a certain rule, the items to be tested are obtained through a template inquiry or transaction number making mode, the test data corresponding to the items to be tested are placed in the data pool, and therefore a large amount of data are configured in the data pool in advance. For example, a large number of items to be tested corresponding to the test tasks may be obtained, and query data corresponding to the items to be tested is configured in the data pool. Because a large amount of test data corresponding to the items to be tested are pre-configured in the data pool, the test data corresponding to the items to be tested of different tasks can be obtained when different tasks are tested, and thus the test preparation investment cost and time are reduced.
It should be noted that the data pool faces the tester, and in the test case design stage, the tester can send an instruction to the back-end server through the front-end client, so that the back-end server selects test data meeting the test task in the data pool, and the tester refers to the test data; in the test case execution phase, the executive personnel can utilize the test data to test the test tasks.
In some embodiments, the data configured in the data pool may be updated at preset time intervals, for example, part of the data may be added, part of the data may be deleted, part of the data may be replaced, and the like, so as to improve the availability of the data and meet the requirements of different testing tasks. Therefore, the query data corresponding to the items to be tested can be obtained from the updated data pool according to the preset time intervals, and the query data obtained at the preset time intervals are used as the query data corresponding to the items to be tested, so that the comprehensiveness of the data is improved, and the test effect is further improved.
The tester sends a first query instruction or a second query instruction to the front-end client through the input device, the back-end server can call a query execution interface in the interface group according to the first query instruction or the second query instruction, and query data corresponding to the item to be tested is obtained from data pre-configured in the data pool through the query execution interface.
In some embodiments, after receiving the first query instruction, the back-end server simultaneously calls a query preparation interface and a query execution interface in the interface group, obtains constraint conditions corresponding to items to be tested in the target template from the metadata through the query preparation interface, and obtains query data corresponding to the items to be tested from data pre-configured in the data pool through the query execution interface.
In other embodiments, after receiving the first query instruction, the back-end server only calls the query preparation interface in the interface group, and obtains the constraint condition corresponding to the item to be tested in the target template from the metadata through the query preparation interface. And after receiving the second query instruction, the back-end server calls a query execution interface in the interface group, and acquires query data corresponding to the item to be tested from data pre-configured in the data pool through the query execution interface.
As an implementation manner, an item to be tested in the target template needs to be replaced, the item to be tested before replacement is referred to as a current item to be tested, the item to be tested after replacement is referred to as a target item to be tested, current query data corresponding to the current item to be tested in the data pool is replaced by the target query data, and a current constraint condition corresponding to the current item to be tested in the metadata is replaced by the target constraint condition. After the target item to be tested is used to replace the current item to be tested in the target template, the target constraint condition corresponding to the target item to be tested can be obtained from the metadata, and the target query data corresponding to the target item to be tested can be obtained from the data pool, so that the data pool can meet the test data required when the test task is changed.
As another implementation manner, the items to be tested in the target template need to be added, and the items to be tested that need to be added are called target items to be tested, then query data corresponding to the target items to be tested may be added to the data pool, and constraint conditions corresponding to the target items to be tested are added to the metadata. After the items to be tested in the target template are added, the constraint conditions corresponding to the target items to be tested can be obtained in the metadata, and meanwhile, the query data corresponding to the target items to be tested can be obtained in the data pool, so that the data pool can meet the test data required when the test task changes.
S103, selecting test data meeting the constraint conditions from the query data.
After acquiring the constraint conditions corresponding to the items to be tested in the target template and the query data, the server picks out the test data meeting the constraint conditions from the query data. For example, the item to be tested is a bank classification, the query data includes a plurality of banks, and the test data is a default bank if the constraint condition is the default bank.
According to the method for obtaining the test data, data are configured in the data pool in advance, when the query data of the items to be tested need to be obtained, the query data corresponding to the items to be tested are directly called from the data pool, the test data meeting the constraint conditions are selected, the preparation time of the test data is shortened, and the test efficiency is improved.
Fig. 3 shows a signaling interaction diagram for acquiring test data according to an embodiment of the present application. As shown in fig. 3, the method of the present embodiment may include the following steps:
s201, sending the acquisition instruction to a back-end server.
And the front-end client receives an acquisition instruction sent by a tester through the input equipment, wherein the acquisition instruction is used for indicating to acquire a target template corresponding to the test task. And after receiving the acquisition instruction, the front-end client sends the acquisition instruction to the back-end server.
S202, receiving an acquisition instruction, calling an acquisition interface in the interface group, and selecting a target template for the test task from the template library through the acquisition interface according to the item to be tested of the test task in the acquisition instruction.
The back-end server receives the acquisition instruction sent by the front-end client, extracts the items to be tested of the test tasks in the acquisition instruction, and calls the acquisition interfaces in the interface group, so that the target template corresponding to the items to be tested can be selected from the template library by using the acquisition interfaces, and the items to be tested in the target template can include the items to be tested of the test tasks in the acquisition instruction.
In some embodiments, the obtaining instruction may include items to be tested of the test task, and after receiving the obtaining instruction, the back-end server may extract the items to be tested of the test task in the obtaining instruction, and call the obtaining interface in the interface group, so as to search, through the obtaining interface, for a target template that matches the items to be tested of the test task in the template library, thereby selecting the target template for the test task.
In some embodiments, after receiving the obtaining instruction, the back-end server may call the obtaining interface, obtain all templates in the template library through the obtaining interface, and send all templates to the front-end client, so that a tester can select a corresponding target template according to an item to be tested in the test task. For example, the items to be tested of each template in the template library may be compared with the items to be tested in the test task, and if the items to be tested in a certain template include the items to be tested in the test task, the template may be selected as the target template.
S203, sending the first query instruction to a back-end server.
The front-end client receives a first query instruction sent by a tester through input equipment, wherein the first query instruction can be used for indicating constraint conditions corresponding to items to be tested in a query target template and can also be used for indicating query data corresponding to the items to be tested in the query target template. And the front-end client sends the first query instruction to the back-end server after receiving the first query instruction.
S204, receiving the first query instruction, acquiring the items to be tested of the target template in the first query instruction, calling a query preparation interface in the interface group, and acquiring constraint conditions corresponding to the items to be tested in the target template from the metadata through the query preparation interface.
The back-end server receives a first query instruction sent by the front-end client, obtains items to be tested of a target template in the first query instruction, calls a query preparation interface in the interface group, searches constraint conditions of the items to be tested in the metadata through the query preparation interface, and obtains the constraint conditions corresponding to the items to be tested through the query preparation interface if the constraint conditions of the items to be tested exist in the metadata.
In some embodiments, some items to be tested do not have corresponding constraint conditions, and the constraint conditions corresponding to each item to be tested can be sequentially searched in the metadata according to the sequence of the serial numbers of the items to be tested from small to large, so that each item to be tested can be queried, and the constraint conditions of the items to be tested are prevented from being omitted. When the constraint condition of a certain item to be tested can be found in the metadata, the item to be tested is indicated to have the constraint condition, when the constraint condition of the certain item to be tested cannot be found in the metadata, the item to be tested is indicated to have no constraint condition, and the constraint condition corresponding to the item to be tested with the constraint condition is obtained. For example, a constraint condition having the same identifier as the identifier of the item to be tested may be searched for in the metadata, and if the constraint condition having the same identifier is found, it indicates that the item to be tested has the constraint condition, and if the constraint condition having the identifier is not found, it indicates that the item to be tested does not have the constraint condition.
For example, the target template includes five items to be tested, a first item to be tested, a second item to be tested, a third item to be tested, a fourth item to be tested, and a fifth item to be tested, where the serial number of the first item to be tested is (1), the serial number of the second item to be tested is (2), the serial number of the third item to be tested is (3), the serial number of the fourth item to be tested is (4), and the serial number of the fifth item to be tested is (5). Then, firstly, the constraint condition with the same identification as the identification of the first item to be tested is searched in the metadata, if so, the constraint condition with the identification of the first item to be tested, namely the constraint condition of the first item to be tested is obtained, and if not, the first item to be tested does not have the constraint condition; then, searching constraint conditions with the same identification as the identification of the second item to be tested in the metadata, if so, acquiring the constraint conditions with the identification of the second item to be tested, namely the constraint conditions of the second item to be tested, and if not, the second item to be tested does not have the constraint conditions; then, searching constraint conditions with the same identification as the identification of the third item to be tested in the metadata, if so, acquiring the constraint conditions with the identification of the third item to be tested, namely the constraint conditions of the third item to be tested, and if not, the third item to be tested does not have the constraint conditions; then, searching constraint conditions with the same identification as the identification of the fourth item to be tested in the metadata, if so, acquiring the constraint conditions with the identification of the fourth item to be tested, namely the constraint conditions of the fourth item to be tested, and if not, the fourth item to be tested does not have the constraint conditions; and finally, searching constraint conditions with the same identification as that of the fifth item to be tested in the metadata, if so, acquiring the constraint conditions with the identification of the fifth item to be tested, namely the constraint conditions of the fifth item to be tested, and if not, acquiring the constraint conditions of the fifth item to be tested. In some embodiments, the constraint condition corresponding to each item to be tested may also be sequentially searched in the metadata according to the descending order of the serial number of the item to be tested, which is not limited herein.
And S205, sending the second query instruction to a back-end server.
The front-end client receives a second query instruction sent by a tester through the input device, and the second query instruction can be used for indicating query data corresponding to an item to be tested in the query target template. And the front-end client sends the second query instruction to the back-end server after receiving the second query instruction.
S206, receiving a second query instruction, calling a query execution interface in the interface group, and acquiring query data corresponding to the item to be tested from data pre-configured in the data pool through the query execution interface.
The back-end server receives a second query instruction sent by the front-end client, acquires the items to be tested of the target template in the second query instruction, calls a query execution interface in the interface group, searches query data corresponding to the items to be tested in the data pool through the query execution interface, and accordingly acquires the query data corresponding to the items to be tested through the query execution interface. For example, the item to be tested is of the identity type and the query data comprises an identity card, a passport, etc.
In some embodiments, query data corresponding to each item to be tested can be sequentially obtained from data pre-configured in the data pool according to the sequence of the serial numbers of the items to be tested from small to large, so that the query data of the items to be tested are prevented from being omitted. For example, query data having the same identification as the identification of the item to be tested may be looked up in the data pool.
For example, the target template includes five items to be tested, a first item to be tested, a second item to be tested, a third item to be tested, a fourth item to be tested, and a fifth item to be tested, where the serial number of the first item to be tested is (1), the serial number of the second item to be tested is (2), the serial number of the third item to be tested is (3), the serial number of the fourth item to be tested is (4), and the serial number of the fifth item to be tested is (5). Searching query data with the same identification as that of the first item to be tested, namely query data corresponding to the first item to be tested, in a data pool; then, searching query data with the same identification as that of the second item to be tested in the data pool, namely query data corresponding to the second item to be tested; then, searching query data with the same identification as that of the third item to be tested in the data pool, namely query data corresponding to the third item to be tested; then, searching query data with the same identification as that of the fourth item to be tested in the data pool, namely query data corresponding to the fourth item to be tested; and finally, searching query data with the same identifier as that of the fifth item to be tested, namely query data corresponding to the fifth item to be tested in the data pool. In some embodiments, the query data corresponding to each item to be tested may also be sequentially searched in the data pool according to the sequence of the sequence numbers of the items to be tested from large to small, which is not limited herein.
And S207, selecting test data meeting the constraint conditions from the query data.
After acquiring the constraint conditions corresponding to the items to be tested in the target template and the query data, the server picks out the test data meeting the constraint conditions from the query data.
And S208, sending the test data to the front-end client.
And after the rear-end server picks out the test data meeting the constraint conditions from the query data, the test data is sent to the front-end client side, so that a tester can obtain the test data.
And S209, filling the test data into the target template.
After the front-end client receives the test data, a tester fills the test data into the target template at the front-end client through the input device.
And S210, sending the target template filled with the test data to a back-end server.
And S211, testing the test task by using the target template filled with the test data.
The back-end server receives the target template filled with the test data, wherein the target template comprises the items to be tested of the test task, so that the test task can be tested by using the target template filled with the test data.
According to the method for acquiring the test data, the back-end server interacts with the front-end client, so that when query data of items to be tested need to be acquired, the query data corresponding to the items to be tested are directly called from data pre-configured in the data pool, the test data meeting constraint conditions are selected, the preparation time of the test data is shortened, and the test efficiency is improved.
Fig. 4 is a schematic structural diagram of an apparatus for acquiring test data according to an embodiment of the present application, and as shown in fig. 4, the apparatus 10 for acquiring test data of the present embodiment is used to implement operations corresponding to a backend server in any of the method embodiments described above, where the apparatus 10 for acquiring test data of the present embodiment includes:
the first obtaining module 11 is configured to, after receiving the first query instruction, invoke a query preparation interface in the interface group, and obtain, through the query preparation interface, a constraint condition corresponding to an item to be tested in the target template from the metadata;
the second obtaining module 12 is configured to, after receiving the first query instruction or the second query instruction, call a query execution interface in the interface group, and obtain query data corresponding to the item to be tested from data preconfigured in the data pool through the query execution interface;
and the selecting module 13 is used for selecting the test data meeting the constraint condition from the query data.
The apparatus 10 for obtaining a test apparatus provided in the embodiment of the present application may implement the method embodiment, and for specific implementation principles and technical effects, reference may be made to the method embodiment, which is not described herein again.
Fig. 5 shows a hardware structure diagram of an electronic device according to an embodiment of the present application. As shown in fig. 5, the electronic device 20 is configured to implement the operation corresponding to the backend server in any of the method embodiments described above, where the electronic device 20 of this embodiment may include: memory 21, processor 22 and communication interface 23.
A memory 21 for storing computer instructions. The Memory 21 may include a Random Access Memory (RAM), a Non-Volatile Memory (NVM), at least one disk Memory, a usb disk, a removable hard disk, a read-only Memory, a magnetic disk or an optical disk.
A processor 22 for executing computer instructions stored by the memory to implement the method of obtaining test data in the above embodiments. Reference may be made in particular to the description relating to the method embodiments described above. The Processor 22 may be a Central Processing Unit (CPU), other general purpose Processor, a Digital Signal Processor (DSP), an Application Specific Integrated Circuit (ASIC), or the like. A general purpose processor may be a microprocessor or the processor may be any conventional processor or the like. The steps of a method disclosed in connection with the present invention may be embodied directly in a hardware processor, or in a combination of the hardware and software modules within the processor.
Alternatively, the memory 21 may be separate or integrated with the processor 22.
A communication interface 23, which may be coupled to the processor 22. The processor 22 may control the communication interface 23 to implement the functions of receiving and transmitting data.
The electronic device provided in this embodiment may be used to execute the method for obtaining test data, and the implementation manner and the technical effect are similar, which are not described herein again.
The present application also provides a computer readable storage medium, in which computer instructions are stored, and the computer instructions are executed by a processor to implement the methods provided by the above-mentioned various embodiments.
The present application also provides a computer program product comprising computer instructions stored in a computer readable storage medium. The computer instructions may be read by at least one processor of the device from a computer-readable storage medium, and execution of the computer instructions by the at least one processor causes the device to perform the methods provided by the various embodiments described above.
The embodiment of the present application further provides a chip, which includes a memory and a processor, where the memory is used to store computer instructions, and the processor is used to call and execute the computer instructions from the memory, so that a device in which the chip is installed executes the method described in the above various possible embodiments.
Finally, it should be noted that: the above embodiments are only used to illustrate the technical solutions of the present application, and not to limit the same. Although the present application has been described in detail with reference to the foregoing embodiments, it should be understood by those of ordinary skill in the art that: it is also possible to modify the solutions described in the previous embodiments or to substitute some or all of them with equivalents. And the modifications or the substitutions do not make the essence of the corresponding technical solutions depart from the scope of the technical solutions of the embodiments of the present application.

Claims (13)

1. A method of obtaining test data, the method comprising:
after receiving a first query instruction, calling a query preparation interface in an interface group, and acquiring constraint conditions corresponding to items to be tested in a target template from metadata through the query preparation interface;
after the first query instruction or the second query instruction is received, a query execution interface in the interface group is called, and query data corresponding to the item to be tested is obtained from data pre-configured in a data pool through the query execution interface;
and selecting the test data meeting the constraint condition from the query data.
2. The method according to claim 1, wherein the obtaining query data corresponding to the item to be tested from data preconfigured in a data pool specifically includes:
and acquiring query data corresponding to each item to be tested from data pre-configured in a data pool in sequence according to the sequence of the serial numbers of the items to be tested from small to large.
3. The method according to claim 1, wherein the obtaining of the constraint condition corresponding to the item to be tested in the target template from the metadata specifically includes:
and sequentially searching constraint conditions corresponding to each item to be tested in the metadata according to the sequence of the serial numbers of the items to be tested in the target template from small to large, and acquiring the constraint conditions corresponding to the items to be tested with the constraint conditions.
4. The method according to claim 1, wherein the obtaining query data corresponding to the item to be tested from data preconfigured in a data pool specifically includes:
and acquiring data pre-configured in a data pool, and selecting query data corresponding to each item to be tested from the pre-configured data.
5. The method according to any one of claims 1-4, further comprising:
and replacing the items to be tested in the target template, acquiring constraint conditions corresponding to the replaced items to be tested from the metadata, and acquiring query data corresponding to the replaced items to be tested from a data pool.
6. The method according to any one of claims 1-4, further comprising:
and adding the items to be tested in the target template, acquiring constraint conditions corresponding to the added items to be tested from the metadata, and acquiring query data corresponding to the added items to be tested from a data pool.
7. The method according to any one of claims 1-4, further comprising:
configuring data in the data pool in advance, and updating the data configured in the data pool according to a preset time interval;
the acquiring query data corresponding to the item to be tested from the data pre-configured in the data pool specifically includes:
and acquiring query data corresponding to the item to be tested from the updated data pool according to the preset time interval.
8. The method according to any one of claims 1-4, further comprising:
receiving an acquisition instruction, calling an acquisition interface in the interface group, and selecting a target template for a test task from a template library through the acquisition interface according to an item to be tested of the test task in the acquisition instruction.
9. The method of claim 8, further comprising:
and sending the test data to a front-end client so that the front-end client fills the test data into the target template, and testing the test task by using the target template filled with the test data.
10. A data testing apparatus, characterized in that the apparatus comprises:
the first acquisition module is used for calling a query preparation interface in the interface group after receiving a first query instruction, and acquiring constraint conditions corresponding to items to be tested in the target template from metadata through the query preparation interface;
the second obtaining module is used for calling a query execution interface in the interface group after receiving the first query instruction or the second query instruction, and obtaining query data corresponding to the item to be tested from data pre-configured in a data pool through the query execution interface;
and the selecting module is used for selecting the test data meeting the constraint condition from the query data.
11. An electronic device, comprising: a processor, and a memory communicatively coupled to the processor;
the memory stores computer execution instructions;
the processor executes computer-executable instructions stored by the memory to implement the method of obtaining test data of any one of claims 1 to 9.
12. A computer-readable storage medium having stored thereon computer instructions for implementing a method of acquiring test data according to any one of claims 1 to 9 when executed by a processor.
13. A computer program product, characterized in that the computer program product comprises a computer program which, when being executed by a processor, carries out the method of acquiring test data according to any one of claims 1 to 9.
CN202210727194.XA 2022-06-24 2022-06-24 Method, device, equipment, medium and product for obtaining test data Pending CN115145810A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202210727194.XA CN115145810A (en) 2022-06-24 2022-06-24 Method, device, equipment, medium and product for obtaining test data

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202210727194.XA CN115145810A (en) 2022-06-24 2022-06-24 Method, device, equipment, medium and product for obtaining test data

Publications (1)

Publication Number Publication Date
CN115145810A true CN115145810A (en) 2022-10-04

Family

ID=83408796

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202210727194.XA Pending CN115145810A (en) 2022-06-24 2022-06-24 Method, device, equipment, medium and product for obtaining test data

Country Status (1)

Country Link
CN (1) CN115145810A (en)

Similar Documents

Publication Publication Date Title
CN107861870B (en) Interface test and test data generation method, device, terminal and storage medium
CN111506498A (en) Automatic generation method and device of test case, computer equipment and storage medium
CN112889042A (en) Identification and application of hyper-parameters in machine learning
CN112882699B (en) Service processing method, device, equipment and medium based on flow configuration engine
CN107943694B (en) Test data generation method and device
CN111144402A (en) OCR recognition accuracy calculation method, device, equipment and storage medium
CN111444188A (en) Stock test data preparation method and device, storage medium and electronic equipment
CN113434395A (en) Automatic generation method, device, equipment and medium of test case
CN112395182A (en) Automatic testing method, device, equipment and computer readable storage medium
CN107871055B (en) Data analysis method and device
CN110109981B (en) Information display method and device for work queue, computer equipment and storage medium
CN104933096B (en) Abnormal key recognition methods, device and the data system of database
CN112559525B (en) Data checking system, method, device and server
CN113220597A (en) Test method, test device, electronic apparatus, and storage medium
CN111913880A (en) Application software testing method and device
CN115145810A (en) Method, device, equipment, medium and product for obtaining test data
CN110177006B (en) Node testing method and device based on interface prediction model
CN114443802A (en) Interface document processing method and device, electronic equipment and storage medium
CN113448985A (en) API (application program interface) interface generation method, calling method and device and electronic equipment
CN113468076A (en) Application program exception testing method, device, equipment and storage medium
CN111460268A (en) Method and device for determining database query request and computer equipment
CN110750569A (en) Data extraction method, device, equipment and storage medium
CN106528577B (en) Method and device for setting file to be cleaned
CN110275863A (en) File moving method, device and storage medium
CN115629950B (en) Extraction method of performance test asynchronous request processing time point

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