Data testing method, device and electronic equipment

By employing a multi-layered management strategy to generate query statements in automated testing, the problem of automated scripts failing due to their reliance on external data was resolved, thus achieving automatic generation of test data and improving testing efficiency.

CN115495368BActive Publication Date: 2026-03-03AGRICULTURAL BANK OF CHINA
View PDF 3 Cites 0 Cited by

Patent Information

Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2022-09-30
Publication Date
2026-03-03

AI Technical Summary

Technical Problem

In existing automated testing, the writing of automated scripts is often interrupted or fails due to reliance on test data from external related systems, resulting in low testing efficiency.

Method used

A script-based multi-layered management strategy is adopted to determine the query statements that match the test instances and generate scripts. The scripts are managed in a hierarchical and modular way to generate query statements and automatically query target data, thereby realizing the automatic generation of test data.

Benefits of technology

It improved the efficiency of test data generation, realized the automated generation of test data, and improved testing efficiency and the accuracy of script management.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN115495368B_ABST
    Figure CN115495368B_ABST
Patent Text Reader

Abstract

The present disclosure provides a data testing method and device and electronic equipment, and relates to the technical field of computers. The specific implementation scheme is as follows: a multi-layer management strategy based on a script is used to determine a query statement generation script matched with a test requirement of a test instance; the query statement generation script is run to generate a query statement; the query statement includes a target field to be queried; target data containing the target field is found from a data structure layer storing data according to the query statement; a field value of the target field is read from the target data to determine test data corresponding to the field value of the target field of the target data; the test instance is tested based on the test data corresponding to the target data to obtain a target test result of the test instance.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This disclosure relates to the field of computer technology, and in particular to a data testing method, apparatus, and electronic device. Background Technology

[0002] System testing scenarios require a large amount of test data, which is typically generated manually. This data generation process is complex and inefficient. Currently, automated testing can be used to improve test data efficiency. Automated testing refers to using software tools to replace manual test execution. Execution typically involves writing automated scripts to run test cases. However, during script writing, test cases often rely on external, related system test data, hindering script execution and often resulting in interruptions or failures. Summary of the Invention

[0003] This disclosure provides a data testing method, apparatus, and electronic device for automatically testing test instances.

[0004] According to a first aspect of this disclosure, a data testing method is provided, comprising:

[0005] A script-based multi-level management strategy is used to generate scripts by determining query statements that match the testing requirements of the test instance.

[0006] Run the query statement generation script to generate a query statement; the query statement includes the target field to be queried.

[0007] Based on the query statement, search for target data containing the target field from the data structure layer where the data is stored;

[0008] Read the field value of the target field from the target data to determine the test data corresponding to the field value of the target field in the target data;

[0009] The test instance is tested based on the test data corresponding to the target data to obtain the target test result of the test instance.

[0010] According to a second aspect of this disclosure, a data testing apparatus is provided, comprising:

[0011] The script determination unit is used to determine the query statements that match the test requirements of the test instance and generate scripts based on the script-based multi-level management strategy.

[0012] The statement acquisition unit is used to run the query statement generation script to generate a query statement; the query statement includes the target field to be queried.

[0013] The data query unit is used to search for target data containing the target field from the data structure layer that stores the data, according to the query statement;

[0014] A test data unit is used to read the field value of the target field from the target data to determine the test data corresponding to the field value of the target field in the target data;

[0015] The data testing unit is used to test the test instance based on the test data corresponding to the target data, and obtain the target test result of the test instance.

[0016] According to a third aspect of this disclosure, an electronic device is provided, comprising:

[0017] At least one processor; and

[0018] A memory communicatively connected to the at least one processor; wherein,

[0019] The memory stores instructions that can be executed by the at least one processor to enable the at least one processor to perform the method described in the first aspect.

[0020] According to the technology disclosed herein, a multi-layered management strategy based on scripts can be used to determine query statement generation scripts that match the testing requirements of test instances. Running these scripts yields query statements containing the target fields to be queried. The execution of the query statement generation scripts automatically retrieves the query statements. These query statements allow the retrieval of target data containing the target fields from the data structure layer of the stored data. Reading the field values ​​of the target fields from the target data provides the corresponding test data, thus automating the generation of test data. Based on the test data corresponding to the target data, test instances can be tested to obtain the target test results. This multi-layered management strategy enables the retrieval of query statement generation scripts, automating the generation of query statements. Furthermore, the automatically generated query statements allow for the automated querying of target data, thereby automating the generation of test data, improving the efficiency of test data generation, and achieving automated data generation.

[0021] It should be understood that the description in this section is not intended to identify key or essential features of the embodiments of this disclosure, nor is it intended to limit the scope of this disclosure. Other features of this disclosure will become readily apparent from the following description. Attached Figure Description

[0022] The accompanying drawings are provided to better understand this solution and do not constitute a limitation of this disclosure. Wherein:

[0023] Figure 1This is an example diagram illustrating an application scenario of the data testing method provided in this embodiment of the disclosure;

[0024] Figure 2 This is a flowchart of one embodiment of a data testing method provided in this disclosure;

[0025] Figure 3 This is an example diagram of a plurality of script setting layers provided in an embodiment of this disclosure;

[0026] Figure 4 This is a flowchart of yet another embodiment of a data testing method provided in this disclosure;

[0027] Figure 5 This is a schematic diagram of the structure of one embodiment of a data testing device provided in this disclosure;

[0028] Figure 6 This is a block diagram of an electronic device used to implement the data testing method of the embodiments of this disclosure. Detailed Implementation

[0029] The exemplary embodiments of this disclosure are described below with reference to the accompanying drawings, including various details of the embodiments to aid understanding, and should be considered merely exemplary. Therefore, those skilled in the art will recognize that various changes and modifications can be made to the embodiments described herein without departing from the scope and spirit of this disclosure. Similarly, for clarity and brevity, descriptions of well-known functions and structures are omitted in the following description.

[0030] The technical solution disclosed herein can be applied to automated testing scenarios of systems. By implementing multi-level management testing, it enables the automatic generation of query statement generation scripts. Through the query statement generation scripts, it automatically completes the query of target data for participating data, thereby achieving automatic generation of test data and improving testing efficiency.

[0031] In existing technologies, data testing processes, such as those for instant messaging and social applications, require system testing before release. Currently, to improve the efficiency of automated testing, automated testing is generally employed. Automated testing is typically achieved through automated script cases. However, during the actual development of automated script cases, issues often arise such as non-reusable data or data from external systems related to the system under test, potentially leading to script compilation failures. Failed compilation of automated scripts may result in the failure to generate automated test data, leading to test failures and necessitating script rewriting, thus reducing testing efficiency and increasing difficulty.

[0032] To address the aforementioned technical issues, in this embodiment of the disclosure, during automated testing, a multi-layered script management strategy can be used to determine query statement generation scripts that match the testing requirements of the test instance. This multi-layered management strategy allows for the determination of query statement generation scripts in a hierarchical and modular manner. Running the query statement generation script generates a query statement containing the target field to be queried. The query statement allows for the retrieval of target data containing the target field from the data structure layer of the stored data, achieving automated querying of the target data. After obtaining the target data, the field values ​​of the target fields can be read from the target data to determine the test data corresponding to those field values. The test instance can then be automatedly tested using the corresponding test data to obtain the target test results. Managing scripts hierarchically and modularly improves script management efficiency and accuracy. Utilizing automatically generated query statements enables automated querying of target data, thereby achieving automated generation of test data, improving the efficiency of test data generation, and realizing automated data generation.

[0033] The technical solution of this disclosure will now be described in detail with reference to the accompanying drawings.

[0034] refer to Figure 1 This diagram illustrates an application scenario of the data testing method provided in this disclosure. The scenario may include a first electronic device 1 and a second electronic device 2. The first electronic device 1 and the second electronic device 2 can establish a wired or wireless communication connection. The first electronic device 1 can establish a connection with at least one database 3. The first electronic device 1 can be configured with the data testing method of this disclosure to establish a data pool 4 using at least one database 3. The data pool 4 can contain multiple candidate data entries. Furthermore, the electronic device 1 can automatically generate a query statement script and automatically retrieve target data from the data pool, thereby automatically generating test data using the target data. The test data generated by the first electronic device 1 can be sent to the second electronic device 2. The second electronic device 2 can test the test data to obtain the target test results. The second electronic device 2 can be a test node in a test cluster.

[0035] In practical applications, the second electronic device 2 can feed back the target test results to the first electronic device 1, which then outputs the target test results, thereby improving testing efficiency.

[0036] Figure 2 A flowchart illustrating one embodiment of a data testing method provided in this disclosure, which can be applied to an electronic device, and includes the following steps:

[0037] 201: A script-based multi-level management strategy that generates scripts by determining query statements that match the test requirements of the test instance.

[0038] Multi-level management strategy refers to the script management mechanism for the functional modules of the system. It can realize modular and hierarchical management of scripts, improve script management efficiency, and achieve unified management.

[0039] A script can be a program instruction developed using a programming language or programming tools. This instruction can be executed to run the script. A query statement generation script refers to a written instruction that generates query statements, which can be called and run by the data testing methods configured with this disclosure.

[0040] 202: Run the query statement generation script to generate the query statement; the query statement includes the target field to be queried.

[0041] A query statement can refer to program instructions written in programming languages ​​such as SQL (Structured Query Language), for example, an SQL query statement.

[0042] The query statement generation script can generate query statements by setting information such as fields, format, and data.

[0043] 203: Based on the query statement, search for the target data containing the target field from the data structure layer where the data is stored.

[0044] The data structure layer can refer to the model layer that stores and processes data.

[0045] The data structure layer can be associated with at least one database.

[0046] In the data structure layer, a single piece of data refers to data stored according to a data structure. Specifically, a data structure can refer to a column structure, which may include multiple data fields. A single piece of data can refer to the values ​​corresponding to each of these multiple data fields. Taking a debit card data structure as an example, it can include a data structure composed of multiple data fields such as card number, province code, line number, status, account number, account holder identifier, document type, document number, and balance. A single piece of target data can include the values ​​corresponding to each of these multiple data fields.

[0047] 204: Read the field value of the target field from the target data to determine the test data corresponding to the field value of the target field in the target data.

[0048] The target field can be a subset of multiple data fields from the data structure corresponding to the target data. For example, using the debit card data structure mentioned above, the target fields could include the province code and the status. That is, the usage status of a debit card with a specific province code can be retrieved.

[0049] It can read the field values ​​of the target fields in the target data. The test data is then determined based on the field values ​​of the target fields.

[0050] 205: Test the test instance based on the test data corresponding to the target data to obtain the target test result of the test instance.

[0051] Test data can be input into a test instance to initiate a test on the test data and obtain the target test results.

[0052] In this embodiment of the disclosure, during automated testing, a multi-layered script management strategy can be used to determine query statement generation scripts that match the testing requirements of the test instance. This multi-layered management strategy allows for the determination of query statement generation scripts in a hierarchical and modular manner. Running the query statement generation script generates a query statement containing the target field to be queried. The query statement allows for the search of target data containing the target field from the data structure layer of the stored data, achieving automated querying of the target data. After obtaining the target data, the field values ​​of the target fields can be read to determine the test data corresponding to those field values. The test instance can then be automatedly tested using the corresponding test data to obtain the target test results. Managing scripts hierarchically and modularly improves script management efficiency and accuracy. Utilizing automatically generated query statements enables automated querying of target data, thereby achieving automated generation of test data, improving the efficiency of test data generation, and realizing automated data generation.

[0053] As an example, a script-based multi-level management strategy determines query statements that match the testing requirements of the test instance and generates scripts, including:

[0054] Identify multiple script setting layers within a multi-tiered script management strategy;

[0055] Based on the test requirements of the test instance, obtain the script setting information corresponding to the script setting layer in the script setting layer, and obtain the script setting information corresponding to multiple script setting layers respectively.

[0056] Based on the script settings information corresponding to each of the multiple script setting layers, the script for generating the query statement is determined.

[0057] The order of script settings layers can be stored among multiple layers, allowing you to set higher-level script settings layers first, followed by lower-level ones.

[0058] The query statement generation script is determined based on the script setting information corresponding to multiple script setting layers. This includes combining the script setting information corresponding to multiple script setting layers according to the hierarchical order to obtain the query statement generation script.

[0059] Script settings information can refer to the script content entered in the corresponding script settings layer, such as at least one of the following: layer identifier, layer name, layer function, and layer transaction information.

[0060] In this embodiment of the disclosure, multiple script setting layers can be identified in a multi-layered script management strategy. The script setting information of each layer can be used to determine the query statement generation script. The design of multiple script setting layers enables efficient and modular management of scripts, improving script update and generation efficiency, thereby achieving fast and accurate acquisition of the query statement generation script.

[0061] In one possible design, multiple script setup layers include: system setup layer, module setup layer, function definition layer, page definition layer, and data processing layer;

[0062] Based on the script settings information corresponding to multiple script setting layers, the script for generating the query statement is determined, including:

[0063] Based on the system settings information corresponding to the system settings layer, the module settings information corresponding to the module settings layer, the function settings information corresponding to the function definition layer, the page settings information corresponding to the page definition layer, and the transaction settings information corresponding to the data processing layer;

[0064] Based on system settings, module settings, function settings, page settings, and transaction settings, a query statement generation script is obtained according to the query language encoding.

[0065] For ease of understanding, such as Figure 3 The diagram shows multiple script setting layers. These may include a system setting layer 301, a module setting layer 302, a function definition layer 303, a page definition layer 304, and a data processing layer 305. Each script setting layer can be configured and managed independently.

[0066] Optionally, the system settings layer can be used to configure system information. Its corresponding system settings information may include, for example, system number and system name (the system name may include Chinese and English names). The module settings layer can be used to define the hierarchy after system modules are divided. Its corresponding module settings information may include module number, module name, and names of the two levels of modules. The function definition layer can refer to the hierarchy that defines functional modules at each level. Its corresponding function settings information may include, for example, the specific constituent modules of Level 1, Level 2, and Level 3 functional modules. The page definition layer can refer to the description information of functional pages. Its corresponding page settings information may include, for example, the name and function description of the functional page. The data processing layer can refer to the specific transaction information of functional modules, such as add, delete, and modify transactions. Its corresponding transaction settings information may include defined detailed transaction operations such as add, modify, and delete.

[0067] In this embodiment, scripts can be automatically managed based on system settings, module settings, function definition, page definition, and data processing layers, improving script management efficiency and accuracy. Automated script management enables rapid and accurate script generation. Furthermore, a progressive hierarchy is used to configure different script settings layers, further enhancing script generation efficiency and accuracy.

[0068] In some embodiments, the target field to be queried in the query statement includes at least one; reading the field value of the target field from the target data includes:

[0069] Read the field values ​​corresponding to at least one target field from the target data;

[0070] Determine the test data corresponding to the field values ​​of the target data in the target field, including:

[0071] The test data is obtained by converting the field values ​​corresponding to at least one target field read from the target data according to the data format of the test data.

[0072] The target field may include at least one. Test data can be obtained by converting the field values ​​corresponding to at least one target field according to the test data format.

[0073] For example, if the target field contains a province number field and a status field, you can read the province number identifier from the province number field and the status identifier from the status field from a single piece of target data.

[0074] Test data, consisting of "province identifier - status identifier," is formed by combining the province identifier in the province identifier field and the status identifier in the status field. This test data can be input into a test instance to obtain the target test result for the test instance.

[0075] In this embodiment of the disclosure, at least one field value corresponding to each target field can be read from the target data first. The field values ​​of each target field can be converted into test data according to the data format of the test data. Through format conversion, accurate test data can be obtained, so that the test data can be accurately tested, thereby improving the execution efficiency and accuracy of data testing.

[0076] like Figure 4 The diagram shown is a flowchart of one embodiment of a data testing method provided in this disclosure. According to a query statement, searching for target data containing a target field from the data structure layer storing the data may include:

[0077] 401: Determines multiple candidate data items stored in the resource pool of the data structure layer where the data is stored.

[0078] 402: Use the target field in the query statement to retrieve the target data containing the target field from multiple candidate data.

[0079] A resource pool can be a data storage area for storing multiple data entries in the data structure layer.

[0080] Multiple candidate data items in the resource pool can be extracted in advance, in real time, or a combination of both.

[0081] The fields in a query statement can be target fields. The target field can be the specific field that needs to be queried.

[0082] In this embodiment, by obtaining multiple candidate data from the resource pool of the data structure layer storing the data, the candidate data in the resource pool can be used quickly, and the target data can be obtained efficiently and accurately, thereby improving the efficiency and accuracy of target data acquisition.

[0083] As one embodiment, it also includes:

[0084] Identify at least one database associated with the data structure layer storing the data;

[0085] Extract multiple candidate data that meet the usage conditions from at least one database, and store the multiple candidate data in the resource pool of the data structure layer.

[0086] Optionally, a database configuration management page can be provided, through which data query management can be performed on at least one database. The database configuration management page can provide setting subpages corresponding to the database query tables, which may be as shown in Table 1 below.

[0087]

[0088] Table 1

[0089] The first and second rows in Table 1 can be descriptions of the fields and the database. The data model number can refer to a string obtained by assigning a number to the target field, or it can be a mathematical model identifier named after the mathematical model corresponding to the target field. The data model name can refer to the function name assigned to the mathematical model number corresponding to the target field. The associated database can correspond to a query statement based on the database definition. For example, "from sysa.PS_PA_AC_BIND_INFO where COD_FN_ENT = "0101"", where "sysa.PS_PA_AC_BIND_INFO" is the database name, "COD_FN_ENT" is the target field name, and "0101" is the field value of the target field.

[0090] The third row in Table 1 can represent several fields in the data structure of the target data obtained from the query. These fields may include the target fields. For example, each field can be: serial number, field name, field meaning, main attribute, field type, data label, etc. The meaning of each field can be the same as in related technologies, and will not be elaborated further here.

[0091] In this embodiment, at least one database associated with the data structure layer storing the data can be identified. Multiple candidate data entries that meet the usage conditions are extracted from these databases, and the candidate data are stored in a resource pool within the data structure layer. Extracting multiple candidate data entries from at least one database enables the construction of the resource pool. The resource pool allows for the acquisition of multiple usable candidate data entries, improving the efficiency and accuracy of candidate data acquisition. Data reuse is also achieved through the resource pool; when data is needed for querying, data can be directly read from the resource pool. Furthermore, the unified processing of data from at least one database within the resource pool expands the scope of data acquisition within the pool. The data in the resource pool is not limited to a single database, further improving data processing efficiency and accuracy.

[0092] In one possible design, multiple candidate data entries that meet the usage conditions are extracted from at least one database, including:

[0093] Based on the defined key fields, extract multiple candidate data entries containing the key fields from at least one database.

[0094] Optionally, key fields can be obtained from the query statement. Key fields can refer to fields in the query statement that serve as query identifiers. For example, the province code field can be considered a key field, while the status field is not.

[0095] Of course, in practical applications, key fields can also be set by the user. The system can output the key field settings page and detect the field names entered by the user on the settings page.

[0096] Optionally, different fields in this disclosure may have different field names. For example, the province code field and the status field may have different field names. Different fields may have the same field type. For example, both the province code field and the card number field may be of character type.

[0097] In this embodiment of the disclosure, multiple candidate data entries can be extracted from at least one database by defining key fields. Utilizing key field extraction enables efficient and accurate data acquisition.

[0098] As another embodiment, based on defined key fields, multiple candidate data entries containing the key fields are extracted from at least one database, including:

[0099] In response to a database selection operation targeting at least one database, the target database to be selected is determined.

[0100] Based on key fields, extract multiple candidate data entries containing the key fields from the target database.

[0101] Optionally, a database selection interface can be provided. At least one database can be selected and configured through this interface. For example, a drop-down menu corresponding to at least one database can be provided. The interface detects when a user clicks the drop-down menu to select a target database and retrieves the user-inputted settings information for that target database. These settings may include, for example, IP address (Internet Protocol) port, username, password, etc. A connection is established with the target database based on its settings information to query multiple candidate data entries. The database may include various types such as DB2 (Database 2), ORACLE (Oracle Database), MySQL (My Structured Query Language), and SYBASE (Sybase Adaptive Server Enterprise), etc. This embodiment does not impose excessive limitations on the specific type of database.

[0102] In this embodiment of the disclosure, a target database can be determined by selecting the database, thereby enabling targeted database queries and effectively improving the efficiency and accuracy of data queries.

[0103] like Figure 5The diagram shown is a structural schematic of one embodiment of a data testing device provided in this disclosure. The device can be located in an electronic device, and the device 400 may include:

[0104] Script determination unit 501: Used for script-based multi-level management strategies to determine query statements that match the test requirements of test instances and generate scripts;

[0105] Statement Acquisition Unit 502: Used to run the query statement generation script and generate a query statement; the query statement includes the target field to be queried;

[0106] Data query unit 503: used to search for target data containing the target field from the data structure layer that stores the data according to the query statement;

[0107] Test data unit 504: Used to read the field value of the target field from the target data to determine the test data corresponding to the field value of the target field in the target data;

[0108] Data testing unit 505: Used to test test instances based on test data corresponding to target data, and obtain the target test results of test instances.

[0109] As one embodiment, the script determination unit 501 may include:

[0110] The hierarchy determination module is used to determine multiple script setting layers in a multi-level script management strategy;

[0111] The layered settings module is used to obtain script settings information corresponding to multiple script settings layers based on the test requirements of the test instance.

[0112] The script generation module is used to determine the query statement and generate a script based on the script setting information corresponding to multiple script setting layers.

[0113] In some embodiments, the multiple script setting layers include: a system setting layer, a module setting layer, a function definition layer, a page definition layer, and a data processing layer; the script generation module may include:

[0114] The layered settings submodule is used to set up system settings information corresponding to the system settings layer, module settings information corresponding to the module settings layer, function settings information corresponding to the function definition layer, page settings information corresponding to the page definition layer, and transaction settings information corresponding to the data processing layer.

[0115] The script generation submodule is used to generate a script based on system settings, module settings, function settings, page settings, and transaction settings, according to the query language encoding.

[0116] In one possible design, the target field to be queried in the query statement includes at least one.

[0117] Test data units may include:

[0118] The data reading module is used to read the field values ​​corresponding to at least one target field from the target data.

[0119] The data conversion module is used to convert the field values ​​corresponding to at least one target field read from the target data into test data according to the data format of the test data.

[0120] As one embodiment, the data query unit includes:

[0121] The resource determination module is used to determine multiple candidate data items stored in the resource pool of the data structure layer that stores the data.

[0122] The data query module is used to retrieve target data containing the target field from multiple candidate data using the target field in the query statement.

[0123] This also includes:

[0124] An association determination unit is used to determine at least one database associated with the data structure layer storing the data;

[0125] The resource assembly unit is used to extract multiple candidate data that meet the usage conditions from at least one database and store the multiple candidate data in the resource pool of the data structure layer.

[0126] As one embodiment, the data query module includes:

[0127] The key determination submodule is used to extract multiple candidate data entries containing the defined key fields from at least one database.

[0128] In some embodiments, the key determination submodule can be specifically used for:

[0129] In response to a database selection operation targeting at least one database, determine the target database to be selected;

[0130] Based on key fields, extract multiple candidate data entries containing the key fields from the target database.

[0131] The steps in this embodiment can be performed as described in the above embodiments. Figure 2 The data testing method shown here is described in detail in the method description, and will not be repeated here.

[0132] The collection, storage, use, processing, transmission, provision, and disclosure of user personal information involved in the technical solution disclosed herein comply with the provisions of relevant laws and regulations and do not violate public order and good morals.

[0133] According to embodiments of this disclosure, this disclosure also provides an electronic device, a readable storage medium, and a computer program product. The electronic device or testing equipment involved in the embodiments of this disclosure can be any electronic device, and no particular limitation is made regarding the specific type of electronic device herein; for example, it may include a computer, a server, a cloud server, etc.

[0134] According to embodiments of this disclosure, this disclosure also provides a computer program product comprising: a computer program stored in a readable storage medium, at least one processor of an electronic device being able to read the computer program from the readable storage medium, and the at least one processor executing the computer program causing the electronic device to perform the scheme provided in any of the above embodiments.

[0135] Figure 6 A schematic block diagram of an example electronic device 600 that can be used to implement embodiments of the present disclosure is shown. The electronic device is intended to represent various forms of digital computers, such as laptop computers, desktop computers, workstations, personal digital assistants, servers, blade servers, mainframe computers, and other suitable computers. The electronic device may also represent various forms of mobile devices, such as personal digital processors, cellular phones, smartphones, wearable devices, and other similar computing devices. The components shown herein, their connections and relationships, and their functions are merely illustrative and are not intended to limit the implementation of the present disclosure described and / or claimed herein.

[0136] The device structure of the electronic device or testing device in the foregoing embodiments can be Figure 6 The electronic device shown.

[0137] like Figure 6 As shown, device 600 includes a computing unit 601, which can perform various appropriate actions and processes based on a computer program stored in read-only memory (ROM) 602 or a computer program loaded from storage unit 608 into random access memory (RAM) 603. RAM 603 may also store various programs and data required for the operation of device 600. The computing unit 601, ROM 602, and RAM 603 are interconnected via bus 604. Input / output (I / O) interface 605 is also connected to bus 604.

[0138] Multiple components in device 600 are connected to I / O interface 605, including: input unit 606, such as keyboard, mouse, etc.; output unit 607, such as various types of monitors, speakers, etc.; storage unit 608, such as disk, optical disk, etc.; and communication unit 609, such as network card, modem, wireless transceiver, etc. Communication unit 609 allows device 600 to exchange information / data with other devices through computer networks such as the Internet and / or various telecommunications networks.

[0139] The computing unit 601 can be a variety of general-purpose and / or special-purpose processing components with processing and computing capabilities. Some examples of the computing unit 601 include, but are not limited to, a central processing unit (CPU), a graphics processing unit (GPU), various special-purpose artificial intelligence (AI) computing chips, various computing units running machine learning model algorithms, a digital signal processor (DSP), and any suitable processor, controller, microcontroller, etc. The computing unit 601 performs the various methods and processes described above, such as data testing methods. For example, in some embodiments, the data testing method may be implemented as a computer software program tangibly contained in a machine-readable medium, such as storage unit 608. In some embodiments, part or all of the computer program may be loaded and / or installed on device 600 via ROM 602 and / or communication unit 609. When the computer program is loaded into RAM 603 and executed by the computing unit 601, one or more steps of the data testing method described above may be performed. Alternatively, in other embodiments, the computing unit 601 may be configured to perform data testing methods by any other suitable means (e.g., by means of firmware).

[0140] Various embodiments of the systems and techniques described above herein can be implemented in digital electronic circuit systems, integrated circuit systems, field-programmable gate arrays (FPGAs), application-specific integrated circuits (ASICs), application-specific standard products (ASSPs), systems-on-a-chip (SoCs), payload-programmable logic devices (CPLDs), computer hardware, firmware, software, and / or combinations thereof. These various embodiments may include implementations in one or more computer programs that can be executed and / or interpreted on a programmable system including at least one programmable processor, which may be a dedicated or general-purpose programmable processor, capable of receiving data and instructions from a storage system, at least one input device, and at least one output device, and transmitting data and instructions to the storage system, the at least one input device, and the at least one output device.

[0141] The program code used to implement the methods of this disclosure may be written in any combination of one or more programming languages. This program code may be provided to a processor or controller of a general-purpose computer, special-purpose computer, or other programmable data processing apparatus, such that when executed by the processor or controller, the program code causes the functions / operations specified in the flowcharts and / or block diagrams to be implemented. The program code may be executed entirely on a machine, partially on a machine, as a standalone software package partially on a machine and partially on a remote machine, or entirely on a remote machine or server.

[0142] In the context of this disclosure, a machine-readable medium can be a tangible medium that may contain or store a program for use by or in conjunction with an instruction execution system, apparatus, or device. A machine-readable medium can be a machine-readable signal medium or a machine-readable storage medium. A machine-readable medium can be, but is not limited to, electronic, magnetic, optical, electromagnetic, infrared, or semiconductor systems, apparatus, or devices, or any suitable combination of the foregoing. More specific examples of machine-readable storage media include electrical connections based on one or more wires, portable computer disks, hard disks, random access memory (RAM), read-only memory (ROM), erasable programmable read-only memory (EPROM or flash memory), optical fiber, portable compact disk read-only memory (CD-ROM), optical storage devices, magnetic storage devices, or any suitable combination of the foregoing.

[0143] To provide interaction with a user, the systems and techniques described herein can be implemented on a computer having: a display device for displaying information to the user (e.g., a CRT (cathode ray tube) or LCD (liquid crystal display) monitor); and a keyboard and pointing device (e.g., a mouse or trackball) through which the user provides input to the computer. Other types of devices can also be used to provide interaction with the user; for example, feedback provided to the user can be any form of sensory feedback (e.g., visual feedback, auditory feedback, or tactile feedback); and input from the user can be received in any form (including sound input, voice input, or tactile input).

[0144] The systems and technologies described herein can be implemented in computing systems that include backend components (e.g., as a data server), or computing systems that include middleware components (e.g., an application server), or computing systems that include frontend components (e.g., a user computer with a graphical user interface or web browser through which a user can interact with embodiments of the systems and technologies described herein), or any combination of such backend, middleware, or frontend components. The components of the system can be interconnected via digital data communication of any form or medium (e.g., a communication network). Examples of communication networks include local area networks (LANs), wide area networks (WANs), and the Internet.

[0145] Computer systems can include clients and servers. Clients and servers are generally geographically separated and typically interact via communication networks. The client-server relationship is created by computer programs running on the respective computers and having a client-server relationship with each other. A server can be a cloud server, also known as a cloud computing server or cloud host, a hosting product within the cloud computing service ecosystem, addressing the shortcomings of traditional physical hosts and VPS (Virtual Private Server, or simply "VPS") services, such as high management difficulty and weak business scalability. Servers can also be servers for distributed systems or servers incorporating blockchain technology.

[0146] It should be understood that the various forms of processes shown above can be used to rearrange, add, or delete steps. For example, the steps described in this disclosure can be executed in parallel, sequentially, or in different orders, as long as the desired result of the technical solution disclosed in this disclosure can be achieved, and this is not limited herein.

[0147] The specific embodiments described above do not constitute a limitation on the scope of protection of this disclosure. Those skilled in the art should understand that various modifications, combinations, sub-combinations, and substitutions can be made according to design requirements and other factors. Any modifications, equivalent substitutions, and improvements made within the spirit and principles of this disclosure should be included within the scope of protection of this disclosure.

Claims

1. A data testing method, characterized by, The method comprises the following steps: determining a plurality of script setting layers in a multi-layer management strategy of a script; the plurality of script setting layers comprise a system setting layer, a module setting layer, a function definition layer, a page definition layer, and a data processing layer; obtaining script setting information corresponding to the plurality of script setting layers based on test requirements of a test instance and script setting information corresponding to the script setting layers; obtaining script setting information corresponding to the system setting layer, module setting layer, function definition layer, page definition layer, and transaction setting layer based on the system setting information, module setting information, function setting information, page setting information, and transaction setting information; obtaining a query statement generation script according to the system setting information, module setting information, function setting information, page setting information, and transaction setting information and in accordance with a query language code; running the query statement generation script to generate a query statement; the query statement comprises a target field to be queried; determining at least one database associated with a data structure layer storing data; extracting a plurality of candidate data satisfying a use condition from the at least one database and storing the plurality of candidate data in a resource pool of the data structure layer; determining the plurality of candidate data stored in the resource pool of the data structure layer storing data; obtaining target data containing the target field from the plurality of candidate data by using the target field in the query statement; reading a field value of the target field from the target data to determine test data corresponding to the field value of the target field in the target data; testing the test instance based on the test data corresponding to the target data to obtain a target test result of the test instance.

2. The method of claim 1, wherein, The target field to be queried in the query statement comprises at least one; the reading of the field value of the target field from the target data comprises: reading a field value corresponding to each of the at least one target field from the target data; the determination of the test data corresponding to the field value of the target field in the target data comprises: converting the field value corresponding to each of the at least one target field read from the target data into the test data in accordance with a data format of the test data.

3. The method of claim 1, wherein, The extraction of the plurality of candidate data satisfying the use condition from the at least one database comprises: extracting a plurality of candidate data containing a defined key field from the at least one database based on the key field.

4. The method of claim 3, wherein, The extraction of the plurality of candidate data containing the key field from the at least one database based on the defined key field comprises: determining a target database selected in response to a database selection operation on the at least one database; extracting the plurality of candidate data containing the key field from the target database based on the key field.

5. A data testing apparatus, characterized by, The method comprises the following steps: a script determination unit configured to determine a query statement generation script matched with test requirements of a test instance based on a multi-layer management strategy of a script; a statement acquisition unit configured to run the query statement generation script to generate a query statement; the query statement comprises a target field to be queried. The data query unit is configured to query target data containing the target field from a data structure layer storing data according to the query statement; The test data unit is configured to read a field value of the target field from the target data to determine test data corresponding to the field value of the target field in the target data; The data test unit is configured to test the test instance based on the test data corresponding to the target data to obtain a target test result of the test instance; The script determination unit comprises: The hierarchical determination module is configured to determine a plurality of script setting layers in a multi-layer management strategy of the script; the plurality of script setting layers comprise a system setting layer, a module setting layer, a function definition layer, a page definition layer, and a data processing layer; The hierarchical setting module is configured to obtain script setting information corresponding to each of the plurality of script setting layers based on script setting information corresponding to the script setting layer of the test instance; The script generation module is configured to determine the query statement generation script according to the script setting information corresponding to each of the plurality of script setting layers; The script generation module comprises: The hierarchical setting submodule is configured to obtain system setting information corresponding to the system setting layer, module setting information corresponding to the module setting layer, function setting information corresponding to the function definition layer, page setting information corresponding to the page definition layer, and transaction setting information corresponding to the data processing layer; The script generation submodule is configured to obtain the query statement generation script according to the system setting information, the module setting information, the function setting information, the page setting information, and the transaction setting information in accordance with a query language code; The data query unit comprises: The association determination unit is configured to determine at least one database associated with a data structure layer storing data; The resource construction unit is configured to extract a plurality of candidate data satisfying a use condition from the at least one database, and store the plurality of candidate data in a resource pool of the data structure layer; The resource determination module is configured to determine the plurality of candidate data stored in the resource pool of the data structure layer storing data; The data query module is configured to obtain target data containing the target field from the plurality of candidate data by using the target field in the query statement.

6. An electronic device, comprising: comprise: at least one processor; and a memory connected with the at least one processor in communication; wherein the memory stores instructions executable by the at least one processor, and the instructions are executed by the at least one processor to enable the at least one processor to perform the method of any one of claims 1-4.

Citation Information

Patent Citations

  • Query script generation method and device

    CN108241620A

  • Data query method, device and equipment and storage medium

    CN111159227A

  • Multi-element test data source generation method and device, equipment and medium

    CN113220782A