CN117873860A - Data automatic testing method and device, electronic equipment and storage medium - Google Patents
Data automatic testing method and device, electronic equipment and storage medium Download PDFInfo
- Publication number
- CN117873860A CN117873860A CN202311640663.5A CN202311640663A CN117873860A CN 117873860 A CN117873860 A CN 117873860A CN 202311640663 A CN202311640663 A CN 202311640663A CN 117873860 A CN117873860 A CN 117873860A
- Authority
- CN
- China
- Prior art keywords
- data
- test
- tested
- database
- standard
- 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
Links
- 238000012360 testing method Methods 0.000 title claims abstract description 240
- 238000012545 processing Methods 0.000 claims abstract description 50
- 238000013515 script Methods 0.000 claims abstract description 40
- 238000000034 method Methods 0.000 claims abstract description 29
- 238000007689 inspection Methods 0.000 claims description 47
- 230000014509 gene expression Effects 0.000 claims description 20
- 238000010998 test method Methods 0.000 claims description 17
- 230000008859 change Effects 0.000 claims description 3
- 238000004590 computer program Methods 0.000 claims description 3
- 230000008569 process Effects 0.000 description 8
- 238000010586 diagram Methods 0.000 description 6
- 238000007726 management method Methods 0.000 description 6
- 230000003287 optical effect Effects 0.000 description 6
- 230000006870 function Effects 0.000 description 4
- 230000002159 abnormal effect Effects 0.000 description 3
- 238000006243 chemical reaction Methods 0.000 description 3
- 238000004458 analytical method Methods 0.000 description 2
- 238000004891 communication Methods 0.000 description 2
- 238000013506 data mapping Methods 0.000 description 2
- 238000011161 development Methods 0.000 description 2
- 238000000605 extraction Methods 0.000 description 2
- 238000001914 filtration Methods 0.000 description 2
- 239000013307 optical fiber Substances 0.000 description 2
- 230000008520 organization Effects 0.000 description 2
- 230000002093 peripheral effect Effects 0.000 description 2
- 230000000644 propagated effect Effects 0.000 description 2
- 238000012795 verification Methods 0.000 description 2
- 101000822425 Arthrobacter sp. (strain KUJ 8602) Guanidinobutyrase Proteins 0.000 description 1
- 230000005856 abnormality Effects 0.000 description 1
- 230000002547 anomalous effect Effects 0.000 description 1
- 238000003491 array Methods 0.000 description 1
- 230000006399 behavior Effects 0.000 description 1
- 230000009286 beneficial effect Effects 0.000 description 1
- 238000004364 calculation method Methods 0.000 description 1
- 238000004883 computer application Methods 0.000 description 1
- 238000013523 data management Methods 0.000 description 1
- 238000005516 engineering process Methods 0.000 description 1
- 238000013100 final test Methods 0.000 description 1
- 238000007667 floating Methods 0.000 description 1
- 238000002372 labelling Methods 0.000 description 1
- 238000005457 optimization Methods 0.000 description 1
- 230000035515 penetration Effects 0.000 description 1
- 230000003334 potential effect Effects 0.000 description 1
- 230000008707 rearrangement Effects 0.000 description 1
- 230000001105 regulatory effect Effects 0.000 description 1
- 238000012827 research and development Methods 0.000 description 1
- 239000004065 semiconductor Substances 0.000 description 1
- 230000035945 sensitivity Effects 0.000 description 1
- 238000006467 substitution reaction Methods 0.000 description 1
Classifications
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F11/00—Error detection; Error correction; Monitoring
- G06F11/36—Preventing errors by testing or debugging software
- G06F11/3668—Software testing
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 application discloses a data automatic testing method, a device, electronic equipment and a storage medium; the method comprises the following steps: receiving test parameters of data to be tested, which are input by a tester on an automatic test interface; wherein the test parameters include: database type, database server IP address, database server port number, database name, database user password, concurrency number, and multiple rows of input parameters; generating a background processing script of the data to be tested according to the test parameters; and carrying out data standard combination test on the data to be tested through a background processing script to obtain a data standard combination test report corresponding to the data to be tested. The embodiment of the application can uniformly check rules and can also simultaneously carry out data standard combination test on different data table field values, thereby improving the test efficiency and reducing the test cost.
Description
Technical Field
The embodiment of the application relates to the technical field of computer application, in particular to a data automatic testing method, a device, electronic equipment and a storage medium.
Background
The data standard combination test is a software test method used for verifying whether the data output by the system is consistent with the expected result. In the data-to-standard test, a tester would predefine a set of input data and determine its expected output results. Then, the input data are input into the system for processing, and the actual output result of the system is obtained. Finally, the tester compares the actual output result with the expected output result to determine whether the system is operating as expected.
In the prior art, a manual test mode is generally adopted, a tester checks the data standard combination condition of each system by manually writing and verifying the structured query language (Structured Query Language, SQL), and the check rules may not be uniform, so that the test quality of standard penetration of the same data in different systems is inconsistent, the test efficiency is lower, and the test cost is higher.
Disclosure of Invention
The application provides a data automation test method, a device, electronic equipment and a storage medium, which can uniformly check rules and can also perform data standard combination test on different data table field values at the same time, so that the test efficiency can be improved, and the test cost can be reduced.
In a first aspect, an embodiment of the present application provides a method for automatically testing data, where the method includes:
receiving test parameters of data to be tested, which are input by a tester on an automatic test interface; wherein the test parameters include: database type, database server IP address, database server port number, database name, database user password, concurrency number, and multiple rows of input parameters;
generating a background processing script of the data to be tested according to the test parameters;
and carrying out data standard combination test on the data to be tested through the background processing script to obtain a data standard combination test report corresponding to the data to be tested.
In a second aspect, embodiments of the present application further provide a data automation testing device, where the device includes: the device comprises a receiving module, a generating module and a testing module; wherein,
the receiving module is used for receiving the test parameters of the data to be tested, which are input by the tester at the automatic test interface; wherein the test parameters include: database type, database server IP address, database server port number, database name, database user password, concurrency number, and multiple rows of input parameters;
The generation module is used for generating a background processing script of the data to be tested according to the test parameters;
and the test module is used for carrying out data standard combination test on the data to be tested through the background processing script to obtain a data standard combination test report corresponding to the data to be tested.
In a third aspect, an embodiment of the present application provides an electronic device, including:
one or more processors;
a memory for storing one or more programs,
the one or more programs, when executed by the one or more processors, cause the one or more processors to implement the data automation test method described in any of the embodiments of the present application.
In a fourth aspect, embodiments of the present application provide a storage medium having stored thereon a computer program which, when executed by a processor, implements the data automation test method of any of the embodiments of the present application.
The embodiment of the application provides a data automation test method, a device, electronic equipment and a storage medium, wherein when a test task is executed, test parameters of data to be tested, which are input by a tester on an automation test interface, are received first; wherein the test parameters include: database type, database server IP address, database server port number, database name, database user password, concurrency number, and multiple rows of input parameters; then generating a background processing script of the data to be tested according to the test parameters; and finally, carrying out data standard combination test on the data to be tested through a background processing script to obtain a data standard combination test report corresponding to the data to be tested. In other words, in the technical scheme of the application, the data base is provided for the test task after execution by receiving the test parameters of the data to be tested, which are input by the tester at the automated test interface. And generating a background processing script of the data to be tested according to the test parameters to help improve the test efficiency, reduce the test cost, enhance the test reliability and adapt to different test requirements. And finally, carrying out data standard combination test on the data to be tested through a background processing script to obtain a data standard combination test report corresponding to the data to be tested, so that the test efficiency is improved, the repeatability and the reproducibility are improved, the test reliability is enhanced, the test cost is reduced, and the labor input is reduced. Therefore, compared with the prior art, the data automation testing method, the device, the electronic equipment and the storage medium provided by the embodiment of the application not only can uniformly check rules, but also can simultaneously perform data standard combination testing on different data table field values, so that the testing efficiency can be improved, and the testing cost can be reduced; in addition, the technical scheme of the embodiment of the application is simple and convenient to realize, convenient to popularize and wider in application range.
Drawings
In order to more clearly illustrate the technical solutions of the embodiments of the present application, the drawings that are needed in the description of the embodiments will be briefly introduced below, and it is obvious that the drawings in the following description are only some embodiments of the present application, and that other drawings may be obtained according to these drawings without inventive effort for a person skilled in the art.
FIG. 1 is a schematic flow chart of a data automatic test method according to an embodiment of the present disclosure;
FIG. 2 is a schematic diagram of a second flow chart of a data automatic test method according to an embodiment of the present disclosure;
FIG. 3 is a flowchart of a method for inputting test parameters of data to be tested through an automated test interface according to an embodiment of the present application;
fig. 4 is a schematic structural diagram of a data automation testing device according to an embodiment of the present application;
fig. 5 is a schematic structural diagram of an electronic device according to an embodiment of the present application.
Detailed Description
The present application is described in further detail below with reference to the drawings and examples. It is to be understood that the specific embodiments described herein are merely illustrative of the application and not limiting thereof. It should be further noted that, for convenience of description, only some, but not all of the structures related to the present application are shown in the drawings.
Example 1
Fig. 1 is a schematic flow chart of a first flow chart of a data automation test method provided in an embodiment of the present application, where the method may be performed by a data automation test device or an electronic device, and the device or the electronic device may be implemented by software and/or hardware, and the device or the electronic device may be integrated into any intelligent device with a network communication function. As shown in fig. 1, the data automation test method may include the steps of:
step 110, receiving test parameters of data to be tested, which are input by a tester at an automatic test interface.
Wherein, the automatic test refers to a process of converting the test behavior driven by human into machine execution, namely, simulating manual test steps to automatically test software through test scripts written in an execution program language, and comparing actual results with expected results for checking whether certain specific software requirements are met. The automatic test interface is a front page displayed to a user when the user uses an automatic tool to test, and is used for receiving data input by the user. The test parameters include: database type, database server IP address, database server port number, database name, database user password, concurrency number, and multiple line input parameters. The database type may be Oracle, mySQL, TDSQL, GBase or DB2, which is not limited by the embodiments of the present application. The concurrency number is the maximum value of the number of input parameter lines set according to actual conditions or requirements. The multiple line input parameters include, but are not limited to, a data table name, a field name, a query condition, and/or a number of query bars.
Specifically, after receiving the test parameters of the data to be tested, which are input by the tester at the automated test interface, the received data are verified, and the verification may include data format check, range check, validity check, and/or the like. And then processing the input data according to the verification result. If the data is invalid or unsatisfactory, a prompt message may be sent to prompt the tester to reenter, for example: "you input data format is wrong, please re-input-! ". If the data is valid, a subsequent test process may be performed.
In this embodiment, by receiving the test parameters of the data to be tested input by the tester at the automated test interface, a data base is provided for the test task after execution.
And 120, generating a background processing script of the data to be tested according to the test parameters.
Specifically, after receiving test parameters of data to be tested, which are input by a tester on an automatic test interface, a background processing script of the data to be tested is generated according to the test parameters. The processing script at least comprises the steps of analyzing data, generating data to be tested according to the test parameters, processing abnormal conditions, storing the data to be tested and the like. Specifically, the test parameters may be parsed according to the format of the test parameters. For example: for test parameters in CSV format, commas may be used to separate each column and convert each row into a data item or object. The parsed test parameters may need further processing, which may be data format conversion, data filtering, data mapping or data difference, etc., which is not limited in the embodiment of the present application. The processes can be customized according to actual requirements. Illustratively, the test parameter after 1, parsing may be a string, but the test requires conversion to an integer or floating point number. At this time, the parsed test parameters need to be subjected to data format conversion for subsequent testing. 2. The parsed test parameters may contain some invalid or anomalous data, so data filtering is required to ensure the accuracy and integrity of the test data. Such as: undesirable characters, null values, out-of-range values, etc. may be filtered out. 3. The parsed test parameters may require data mapping to be converted to different data types or formats. Such as: the user ID may be mapped to a corresponding user name, or the date and time may be mapped to a specified formatting string, etc. 4. The parsed test parameters may require data interpolation to generate more test data. Such as: a new purchase record may be generated based on the existing user ID and purchase quantity, or a smaller data set may be expanded into a larger data set, etc.
And then generating data to be tested according to the analyzed test parameters. For example, if the test parameters are an item ID and an item number, new shopping cart data may be generated based on the existing item ID and item number. Meanwhile, in the process of generating the data to be tested, possible abnormal situations need to be considered, for example: parameter invalidation, data collision, etc. For these exception cases, appropriate processing logic needs to be written, such as: throwing out an abnormality, giving an error prompt, etc. The generated data to be tested is then stored, and may optionally be stored in a memory, a database, or other medium suitable for storing and reading data, which is not limited in the embodiment of the present application.
In this embodiment, the background processing script of the data to be tested is generated according to the test parameters, which can help to improve the test efficiency, reduce the test cost, enhance the test reliability, and adapt to different test requirements.
And 130, performing data standard combination test on the data to be tested through a background processing script to obtain a data standard combination test report corresponding to the data to be tested.
The data standard combination test is a test for carrying out standard combination requirements of related data in research and development projects of bank applications, and belongs to a part of system function tests.
Specifically, the scope and standard of the data benchmarking test are determined prior to performing the test tasks. For example, test rules and standards in terms of data format, data scope, data integrity, etc. may be formulated. And then, when the test task is executed, the background processing script performs data standard combination test on the data to be tested according to the test rule and the standard. And recording the related execution condition, passing condition, error information, abnormal condition and the like in the test process. And then generating a corresponding test report according to the test result and the record. Test reports may include, but are not limited to, performance of the test, analysis and specification of error information and anomalies, and corresponding charts and statistics, among others. And finally, outputting the test report to corresponding testers or developers so as to carry out subsequent test management and development work.
In this embodiment, the background processing script performs the data standard combination test on the data to be tested to obtain the data standard combination test report corresponding to the data to be tested, so as to improve the test efficiency, enhance the test reliability, reduce the test cost and reduce the manpower input.
In the data automation test method provided by the embodiment of the application, when a test task is executed, test parameters of data to be tested, which are input by a tester on an automation test interface, are received; wherein the test parameters include: database type, database server IP address, database server port number, database name, database user password, concurrency number, and multiple rows of input parameters; then generating a background processing script of the data to be tested according to the test parameters; and finally, carrying out data standard combination test on the data to be tested through a background processing script to obtain a data standard combination test report corresponding to the data to be tested. In other words, in the technical scheme of the application, the data base is provided for the test task after execution by receiving the test parameters of the data to be tested, which are input by the tester at the automated test interface. And generating a background processing script of the data to be tested according to the test parameters to help improve the test efficiency, reduce the test cost, enhance the test reliability and adapt to different test requirements. And finally, carrying out data standard combination test on the data to be tested through a background processing script to obtain a data standard combination test report corresponding to the data to be tested, so that the test efficiency is improved, the repeatability and the reproducibility are improved, the test reliability is enhanced, the test cost is reduced, and the labor input is reduced. Therefore, compared with the prior art, the data automation test method provided by the embodiment of the application not only can uniformly check rules, but also can simultaneously carry out data standard combination test on different data table field values, thereby improving the test efficiency and reducing the test cost; in addition, the technical scheme of the embodiment of the application is simple and convenient to realize, convenient to popularize and wider in application range.
Example two
Fig. 2 is a second flow chart of the data automatic testing method according to the embodiment of the present application. Further optimization and expansion based on the above technical solution can be combined with the above various alternative embodiments.
As shown in fig. 2, the data automation test method may include the steps of:
step 210, receiving test parameters of data to be tested, which are input by a tester at an automatic test interface.
For example, fig. 3 is a flowchart of a method for inputting test parameters of data to be tested through an automated test interface according to an embodiment of the present application, as shown in fig. 3, a tester may input a database type of Oracle, a database server IP address of 10.225.102.11, a database server port number of 80, a database NAME of wasehouse, a database User NAME of User, a database User password of 12345678, a concurrence number of 2, and a multi-line input parameter of table_name 1 at the automated test interface; COLUMN_NAME1; q/10001-2021; column_name_1=0; 10000TABLE_NAM E2; COLUMN_NAME2; q/10002-2022; column_name_2=0; 200000, then receiving test parameters of the data to be tested, which are input by the tester at the automatic test interface.
Further, before step 210, the method may further include:
acquiring the value fields of the data standards according to the data types of the data standards;
generating a corresponding regular expression checking rule according to the value domain of each data standard;
and storing the data standard numbers of the data standards and the regular expression checking rules corresponding to the data standard numbers into a checking rule library.
The data standard is a specification document formed by carrying out consistent agreement on various important data widely used by banks across systems or across fields according to expressions, formats and definitions of the important data. The data type refers to the data type adopted by the data item according to the service definition and the common expression form definition of the data item, and comprises one of the following components: code class, time class, and code class. The data item refers to basic detail data generated in the daily business development process of the bank. A value range refers to a range of acceptable business values for a data item, i.e., a collection of allowable values for the data item. The value domain of the coding type data is a number set conforming to coding rules, such as an identity card number and a customer code; the value field of the code class data is a code value and a code name, such as a gender code and a occupation code; the value range of the money class data is the upper limit and the lower limit of the money specified in the related business or process; the value range of the value class data is the upper and lower limit ranges of the values acceptable in the related business or process. The checking rule base comprises one or more database tables; the database table includes four fields, respectively: data standard number, standard name, inspection rules, and trusted data source system.
Illustratively, one database table in the inspection rule base may be as shown in Table 1:
data standard numbering | Standard name | Checking rules | Trusted data source system |
Q/11001-2022 | Gender standard name | ^(?:0|1|2)$ | Customer management system |
Q/11002-2022 | Time standard name | ^([0-1]\d|2[0-3])([0-5]\d)([0-5]\d)$ | Time management system |
Q/11003-2022 | Nickname standard name | ^(\d|[A-Z]|[a-z]){1,40}$ | User login system |
Table 1 checking rule base table
Specifically, it is first necessary to determine the data type of each data standard, for example: code class, time class, code class, etc. The value range of the data standard is then determined based on the data type. For example: the value range of the gender code may include the following values: 0: unknown, 1: male, 2: female. The value range of the current day withdrawal amount may be: 0 to 5000. Corresponding regular expression checking rules may then be generated from the value fields of the respective data standards, such as: the value range of the current day withdrawal amount is: 0 to 5000, and the corresponding regular expression checking rule is ≡0| [1-4] \d {3} |5000) $. And finally, the data standard numbers of the data standards and the regular expression checking rules corresponding to the data standard numbers can be stored in a checking rule base, specifically, the data standards of the data standards can be numbered, and then the data standard numbers and the standard names and the checking rules corresponding to the data standard numbers, namely the regular expression checking rules, are stored in the checking rule base by a trusted data source system.
For example, assuming that the data type of the Q/11001-2022 data standard is a code class and the value range of the Q/11001-2022 data standard is 00 or 01 or 02, the data standard number corresponding to the Q/11001-2022 is ≡00|01|02 $.
For example, assuming that the data type of the Q/11002-2022 data standard is a time class and the value range of the Q/11002-2022 data standard is in an hmmss time format, the regular expression checking rule corresponding to the Q/11002-2022 is ≡a ([ 0-1] \d|2[0-3 ]) ([ 0-5] \d) $.
By way of example, assuming that the data type of the Q/11003-2022 data standard is a coding class and the value range of the Q/11003-2022 data standard is no more than 40 characters in length, the regular expression checking rule corresponding to the Q/11003-2022 is ++d| [ A-Z ] | [ a-Z ]) {1,40} $.
In this embodiment, the validity and consistency of the data are ensured by determining the valid value range of the data type of each data standard, and the format of the data can be effectively checked by generating the corresponding regular expression checking rule, so that the standardability and readability of the data are ensured, and then the data are stored in a unified checking rule base, so that the subsequent data processing and analysis are convenient. Meanwhile, the data standard numbers and the corresponding regular expression checking rules are associated, so that quick searching and quoting can be performed when needed, and the working efficiency is improved.
In addition, the data item criteria include service attributes, technical attributes, and management attributes of the data item. The following describes the contents of the data item criteria, taking an assumed "organization code" data criteria as an example, as shown in table 2:
table 2 assumed "organization code" data Standard Table
As can be seen from Table 2, the data item business attributes describe the properties of the data item associated with the business, mainly including Chinese names, definitions, value fields, business rules, standard basis, related data, and related data relationships. The Chinese names refer to unified Chinese names of the data items, and the standard Chinese names of the data items distinguish different data from service and are easy to understand and identify by data users. Definition refers to detailed description of data item service caliber and related service scene based on the service flow for creating the data item, and is natural language expression of data item service meaning. The value field is the acceptable service value range of the data item, namely the set of allowed values of the data item. The business rule refers to specific description of constraint conditions of banking business on data items, and comprises business conditions which need to be met by data value, frequency of data updating, calculation method and formula of data, coding rule of data and the like. The standard basis is a business basis source of data item standards, including but not limited to national laws and regulations, national standards, industry standards, group standards, external regulatory requirements, international standards, foreign advanced standards, internal management systems, system specifications, and the like. The related data refers to other data items with association relation with the data item, and the association relation type of the data items and the other data items is described in the attribute of 'related data relation'. The relation with the related data refers to the relation type of the related data, and mainly comprises a reference class and a combination class. The reference refers to the service value of the data using the service value of the related data; combining means that data and related data need to be used in combination to fully express business meaning, or that related data define and constrain business meaning of the data.
The data item technical attributes describe characteristics of the data item associated with the information technology implementation, including data type, data format. The data type refers to the data type adopted by the data item according to the service definition and the common expression form of the data item. The data format refers to definition of the data item in terms of accuracy, length, morphology, including maximum and/or minimum character length allowed, representation format of the data item, etc.
The data item management attributes describe characteristics of the data item associated with data management, including data definer, data processor, usage system, trusted data source table, trusted data source field, data security level. The data definer refers to a department with final service interpretation rights for the service attribute of the data item, and is usually the authority of the banking service to which the data item relates. A data processor refers to a department that legally collects, has limited control, and uses related data items. The data processor will assist in auditing the advice of changes to the data item criteria and identifying potential effects and problems. The usage system refers to an information system using the data item. The trusted data source system, source list and source field refer to the source system executing the data standard and the data of which is the source system of the general public recognition authority and the corresponding list and field. The data security level refers to the sensitivity of the data corresponding to the standard.
Step 220, extracting the data standard number of the data to be tested from the multiple rows of input parameters.
Wherein the plurality of rows of input parameters includes N rows of input parameters; n is a natural number greater than 1; each of the N rows of input parameters meets a predetermined requirement of a multi-row input parameter format; the multi-line input parameter format includes, but is not limited to, one or more of the following fields: english table name, english field name, data standard number, custom query condition and custom segment query number. For example, the multi-line input parameter format may be as shown in table 3:
TABLE_NAME1;COLUMN_NAME1;Q/10001-2021;COLUMN_NAME_1=0;10000 |
TABLE_NAME2;COLUMN_NAME2;Q/10002-2022;COLUMN_NAME_2=0;200000 |
table 3 example table of multi-line input parameter formats
As can be seen from table 3, the multi-line input parameter format may be: english table name; english field name; data standard numbering; customizing query conditions; the number of segmented query bars is customized.
Specifically, a plurality of rows of input parameters are first read and stored in an appropriate data structure, such as: a list or array. Each input row should contain the data standard number of the data to be tested and other relevant information. For example: english table name, english field name, custom query condition and custom segment query number. And then extracting the data standard number of the data to be tested from the input row according to the extraction rule defined in advance. For example: the extraction rules may involve splitting the input line using separators or looking up the data standard number according to a particular string pattern match. Finally, the extracted data standard number is stored in a new data structure, for example: a list or array. In addition, the extracted data may be cleaned and validated to ensure that the extracted data standard number is valid and accurate.
In this embodiment, the data standard number of the data to be tested is extracted from the multiple rows of input parameters, and a data base is provided for searching the corresponding inspection rule.
Step 230, searching for an inspection rule corresponding to the data standard number of the data to be tested in a pre-constructed inspection rule base.
The checking rule library includes a corresponding relation between a data standard number and a checking rule, and the checking rule library may be Oracle, IBM DB2, SQL Server, mySQL, postgreSQL, or the like, which is not limited in the embodiment of the present application.
Specifically, a connection is first established with a checking rule base, for example: the API interface of the inspection database is accessed directly. Then, according to the acquired data standard number of the data to be tested, constructing a corresponding query statement, for example: SQL statements. And searching the checking rule corresponding to the data standard number of the data to be tested according to the constructed query statement.
In the embodiment, the checking rule corresponding to the data standard number of the data to be tested is searched in the checking rule base constructed in advance, so that the working efficiency is improved, and the time is saved.
Step 240, if an inspection rule corresponding to the data standard number of the data to be tested is found in the inspection rule library, generating a background processing script of the data to be tested according to the inspection rule corresponding to the data standard number of the data to be tested.
Specifically, after finding the inspection rule corresponding to the data standard number of the data to be tested in the inspection rule base, generating a background processing script of the data to be tested according to the found regular expression inspection rule and the corresponding programming language. The programming language may be Python, java, javaScript, or the like, which is not limited by the embodiments of the present application.
And 250, carrying out data standard combination test on the data to be tested through a background processing script to obtain a data standard combination test report corresponding to the data to be tested.
Wherein, the data mark combining test report comprises: inspection report overview, data inspection results, and data details that do not conform to inspection rules; wherein the examination report overview comprises the following fields: database type, database server IP address, database server port number, database name, inspection time; the data inspection result includes the following fields: english table name, english field name, data standard number, checking rule, query condition, number of non-conforming rule, total number of query and data standard rate; the non-compliance check rule data details include the following fields: check statement SQL and detail data.
Specifically, the data standard combination test is carried out on the data to be tested through the generated background processing script, and a data standard combination test report corresponding to the data to be tested is obtained. Specifically, the data to be tested is matched with the retrieved inspection rule. For example, regular expressions are used to verify whether the format, content, and other requirements of the data meet prescribed data standards. And then obtaining a final test result according to the matching result, and recording the test result. And generating a data standard combination test report according to the test result.
Illustratively, the data benchmarking test report may be as shown in Table 4:
table 4 data co-labeling test report example table
As can be seen from Table 4, after the test is successfully executed, the tester can check the generated data combined label test report, and can click a download link to download the data combined label test report to the local.
In this embodiment, the background processing script performs the data standard combination test on the data to be tested to obtain the data standard combination test report corresponding to the data to be tested, so that the test efficiency can be improved, the subsequent work of the tester can be facilitated, the work efficiency can be improved, the time can be saved, and the cost can be reduced.
Further, after step 250, the method further includes:
responding to clicking operation of a tester for a task serial number link corresponding to data to be tested, and displaying a test log display interface to the tester;
and responding to clicking operation of the tester for the control console, and outputting a test log of the data to be tested to the tester.
The test log display interface at least comprises the following options: state set, change record, console output, view generation information.
Specifically, when an operation for triggering acquisition of the test log is received, that is, a clicking operation of a task serial number link corresponding to data to be tested by a tester, corresponding test log data is acquired from a corresponding database according to the operation, and the corresponding test log data is processed according to a certain format, for example: the formatted output is or converted to JSON format. And then outputting a test log of the data to be tested to the tester.
In this embodiment, by acquiring the test log, more detailed and accurate information can be provided for the tester, which is helpful for the tester to accurately locate the problem and improve the accuracy of the test.
In the data automation test method provided by the embodiment of the application, when a test task is executed, test parameters of data to be tested, which are input by a tester on an automation test interface, are received; then extracting the data standard number of the data to be tested from the multi-row input parameters; searching an inspection rule corresponding to the data standard number of the data to be tested in a pre-constructed inspection rule base; if the checking rule corresponding to the data standard number of the data to be tested is found in the checking rule library, generating a background processing script of the data to be tested according to the checking rule corresponding to the data standard number of the data to be tested; and finally, carrying out data standard combination test on the data to be tested through a background processing script to obtain a data standard combination test report corresponding to the data to be tested. In other words, in the technical scheme of the application, the data base is provided for the test task after execution by receiving the test parameters of the data to be tested, which are input by the tester at the automated test interface. And extracting the data standard number of the data to be tested from the multi-line input parameters, and providing a data basis for searching the corresponding check rule. And then searching an inspection rule corresponding to the data standard number of the data to be tested in a pre-constructed inspection rule base, so as to improve the working efficiency and save the time. If the checking rule corresponding to the data standard number of the data to be tested is found in the checking rule library, generating a background processing script of the data to be tested according to the checking rule corresponding to the data standard number of the data to be tested, so as to adapt to different testing requirements. And finally, carrying out data standard combination test on the data to be tested through a background processing script to obtain a data standard combination test report corresponding to the data to be tested, so that the test efficiency is improved, the later work of a tester is facilitated, the work efficiency is improved, the time is saved, and the cost is reduced. Therefore, compared with the prior art, the data automation test method provided by the embodiment of the application not only can uniformly check rules, but also can simultaneously carry out data standard combination test on different data table field values, thereby improving the test efficiency and reducing the test cost; in addition, the technical scheme of the embodiment of the application is simple and convenient to realize, convenient to popularize and wider in application range.
Example III
Fig. 4 is a schematic structural diagram of a data automation testing device according to an embodiment of the present application. As shown in fig. 4, the data automation test device includes: a receiving module 410, a generating module 420 and a testing module 430; wherein,
the receiving module 410 is configured to receive test parameters of data to be tested, which are input by a tester at an automated test interface; wherein the test parameters include: database type, database server IP address, database server port number, database name, database user password, concurrency number, and multiple rows of input parameters;
the generating module 420 is configured to generate a background processing script of the data to be tested according to the test parameter;
the test module 430 is configured to perform a data standard merging test on the data to be tested through the background processing script, so as to obtain a data standard merging test report corresponding to the data to be tested.
Further, the generating module 420 is specifically configured to extract a data standard number of the data to be tested from the multiple rows of input parameters; searching an inspection rule corresponding to the data standard number of the data to be tested in a pre-constructed inspection rule base; wherein, the checking rule library comprises the corresponding relation between the data standard number and the checking rule; if the inspection rule corresponding to the data standard number of the data to be tested is found in the inspection rule library, generating a background processing script of the data to be tested according to the inspection rule corresponding to the data standard number of the data to be tested.
Further, the receiving module 410 is further configured to obtain a value range of each data standard according to the data type of each data standard before receiving the test parameters of the data to be tested, which are input by the tester at the automated test interface; wherein the data type includes, but is not limited to, one of the following: code class, time class, and code class; generating a corresponding regular expression checking rule according to the value domain of each data standard; and storing the data standard numbers of the data standards and the regular expression checking rules corresponding to the data standard numbers into the checking rule library.
In one embodiment, the inspection rule base includes one or more database tables therein; the database table comprises four fields, namely: data standard number, standard name, inspection rules, and trusted data source system.
In one embodiment, the plurality of rows of input parameters includes N rows of input parameters; n is a natural number greater than 1; each of the N rows of input parameters meets the requirement of a predetermined multi-row input parameter format; the multi-line input parameter format includes, but is not limited to, one or more of the following fields: english table name, english field name, data standard number, custom query condition and custom segment query number.
Further, the apparatus further comprises:
responding to clicking operation of the task serial number link corresponding to the data to be tested by the tester, and displaying a test log display interface to the tester; the test log display interface at least comprises the following options: state set, change record, console output and view generation information;
and responding to clicking operation of the tester for the console output, and outputting a test log of the data to be tested to the tester.
In one embodiment, the data benchmarking test report includes: inspection report overview, data inspection results, and data details that do not conform to inspection rules; wherein the inspection report overview comprises the following fields: database type, database server IP address, database server port number, database name, inspection time; the data inspection result includes the following fields: english table name, english field name, data standard number, checking rule, query condition, number of non-conforming rule, total number of query and data standard rate; the non-compliance check rule data details include the following fields: check statement SQL and detail data.
The data automation testing device can execute the method provided by any embodiment of the application, and has the corresponding functional modules and beneficial effects of the execution method. Technical details not described in detail in this embodiment may be found in the data automation test method provided in any embodiment of the present application.
Example IV
Fig. 5 is a schematic structural diagram of an electronic device according to an embodiment of the present application. Fig. 5 illustrates a block diagram of an exemplary electronic device suitable for use in implementing embodiments of the present application. The electronic device 5 shown in fig. 5 is only an example and should not be construed as limiting the functionality and scope of use of the embodiments of the present application.
As shown in fig. 5, the electronic device 5 is in the form of a general purpose computing device. The components of the electronic device 5 may include, but are not limited to: one or more processors or processing units 16, a system memory 28, a bus 18 that connects the various system components, including the system memory 28 and the processing units 16.
Bus 18 represents one or more of several types of bus structures, including a memory bus or memory controller, a peripheral bus, an accelerated graphics port, a processor, and a local bus using any of a variety of bus architectures. By way of example, and not limitation, such architectures include Industry Standard Architecture (ISA) bus, micro channel architecture (MAC) bus, enhanced ISA bus, video Electronics Standards Association (VESA) local bus, and Peripheral Component Interconnect (PCI) bus.
The electronic device 5 typically includes a variety of computer system readable media. Such media can be any available media that is accessible by the electronic device 5 and includes both volatile and non-volatile media, removable and non-removable media.
The system memory 28 may include computer system readable media in the form of volatile memory, such as Random Access Memory (RAM) 30 and/or cache memory 32. The electronic device 5 may further include other removable/non-removable, volatile/nonvolatile computer system storage media. By way of example only, storage system 34 may be used to read from or write to non-removable, nonvolatile magnetic media (not shown in FIG. 5, commonly referred to as a "hard disk drive"). Although not shown in fig. 5, a magnetic disk drive for reading from and writing to a removable non-volatile magnetic disk (e.g., a "floppy disk"), and an optical disk drive for reading from or writing to a removable non-volatile optical disk (e.g., a CD-ROM, DVD-ROM, or other optical media) may be provided. In such cases, each drive may be coupled to bus 18 through one or more data medium interfaces. Memory 28 may include at least one program product having a set (e.g., at least one) of program modules configured to carry out the functions of the embodiments of the present application.
A program/utility 40 having a set (at least one) of program modules 42 may be stored in, for example, memory 28, such program modules 42 including, but not limited to, an operating system, one or more application programs, other program modules, and program data, each or some combination of which may include an implementation of a network environment. Program modules 42 generally perform the functions and/or methods in the embodiments described herein.
The electronic device 5 may also communicate with one or more external devices 14 (e.g., keyboard, pointing device, display 24, etc.), one or more devices that enable a user to interact with the electronic device 5, and/or any devices (e.g., network card, modem, etc.) that enable the electronic device 5 to communicate with one or more other computing devices. Such communication may occur through an input/output (I/O) interface 22. Also, the electronic device 12 may communicate with one or more networks such as a Local Area Network (LAN), a Wide Area Network (WAN) and/or a public network, such as the Internet, through a network adapter 20. As shown, the network adapter 20 communicates with other modules of the electronic device 5 via the bus 18. It should be appreciated that although not shown in fig. 5, other hardware and/or software modules may be used in connection with the electronic device 5, including, but not limited to: microcode, device drivers, redundant processing units, external disk drive arrays, RAID systems, tape drives, data backup storage systems, and the like.
The processing unit 16 executes various functional applications and data processing, such as implementing the data automation test method provided by the embodiments of the present application, by running programs stored in the system memory 28.
Example five
Embodiments of the present application provide a computer storage medium.
Any combination of one or more computer readable media may be employed in the computer readable storage media of the embodiments herein. The computer readable medium may be a computer readable signal medium or a computer readable storage medium. The computer readable storage medium can be, for example, but not limited to, an electronic, magnetic, optical, electromagnetic, infrared, or semiconductor system, apparatus, or device, or a combination of any of the foregoing. More specific examples (a non-exhaustive list) of the computer-readable storage medium would include the following: an electrical connection having one or more wires, a portable computer diskette, a hard disk, a Random Access Memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM or flash memory), an optical fiber, a portable compact disc read-only memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination of the foregoing. In this document, a computer readable storage medium may be any tangible medium that can contain, or store a program for use by or in connection with an instruction execution system, apparatus, or device.
The computer readable signal medium may include a propagated data signal with computer readable program code embodied therein, either in baseband or as part of a carrier wave. Such a propagated data signal may take any of a variety of forms, including, but not limited to, electro-magnetic, optical, or any suitable combination of the foregoing. A computer readable signal medium may also be any computer readable medium that is not a computer readable storage medium and that can communicate, propagate, or transport a program for use by or in connection with an instruction execution system, apparatus, or device.
Program code embodied on a computer readable medium may be transmitted using any appropriate medium, including but not limited to wireless, wireline, optical fiber cable, RF, etc., or any suitable combination of the foregoing.
Computer program code for carrying out operations of the present application may be written in one or more programming languages, including an object oriented programming language such as Java, smalltalk, C ++ and conventional procedural programming languages, such as the "C" programming language or similar programming languages. The program code may execute entirely on the user's computer, partly on the user's computer, as a stand-alone software package, partly on the user's computer and partly on a remote computer or entirely on the remote computer or server. In the case of a remote computer, the remote computer may be connected to the user's computer through any kind of network, including a Local Area Network (LAN) or a Wide Area Network (WAN), or may be connected to an external computer (for example, through the Internet using an Internet service provider).
Note that the above is only a preferred embodiment of the present application and the technical principle applied. Those skilled in the art will appreciate that the present application is not limited to the particular embodiments described herein, but is capable of numerous obvious changes, rearrangements and substitutions as will now become apparent to those skilled in the art without departing from the scope of the present application. Therefore, while the present application has been described in connection with the above embodiments, the present application is not limited to the above embodiments, but may include many other equivalent embodiments without departing from the spirit of the present application, the scope of which is defined by the scope of the appended claims.
Claims (10)
1. A method of automated testing of data, the method comprising:
receiving test parameters of data to be tested, which are input by a tester on an automatic test interface; wherein the test parameters include: database type, database server IP address, database server port number, database name, database user password, concurrency number, and multiple rows of input parameters;
generating a background processing script of the data to be tested according to the test parameters;
and carrying out data standard combination test on the data to be tested through the background processing script to obtain a data standard combination test report corresponding to the data to be tested.
2. The method of claim 1, wherein generating a background processing script of the data to be tested based on the test parameters comprises:
extracting a data standard number of the data to be tested from the multiple rows of input parameters;
searching an inspection rule corresponding to the data standard number of the data to be tested in a pre-constructed inspection rule base; wherein, the checking rule library comprises the corresponding relation between the data standard number and the checking rule;
if the inspection rule corresponding to the data standard number of the data to be tested is found in the inspection rule library, generating a background processing script of the data to be tested according to the inspection rule corresponding to the data standard number of the data to be tested.
3. The method of claim 2, wherein prior to receiving test parameters of the data to be tested entered by the tester at the automated test interface, the method further comprises:
acquiring the value fields of the data standards according to the data types of the data standards; wherein the data type includes, but is not limited to, one of the following: code class, time class, and code class;
generating a corresponding regular expression checking rule according to the value domain of each data standard;
And storing the data standard numbers of the data standards and the regular expression checking rules corresponding to the data standard numbers into the checking rule library.
4. A method according to claim 3, wherein the checking rule base comprises one or more database tables; the database table comprises four fields, namely: data standard number, standard name, inspection rules, and trusted data source system.
5. The method of claim 1, wherein the plurality of rows of input parameters comprises N rows of input parameters; n is a natural number greater than 1; each of the N rows of input parameters meets the requirement of a predetermined multi-row input parameter format; the multi-line input parameter format includes, but is not limited to, one or more of the following fields: english table name, english field name, data standard number, custom query condition and custom segment query number.
6. The method according to claim 1, wherein the method further comprises:
responding to clicking operation of the task serial number link corresponding to the data to be tested by the tester, and displaying a test log display interface to the tester; the test log display interface at least comprises the following options: state set, change record, console output and view generation information;
And responding to clicking operation of the tester for the console output, and outputting a test log of the data to be tested to the tester.
7. The method of claim 1, wherein the data benchmarking test report includes: inspection report overview, data inspection results, and data details that do not conform to inspection rules; wherein the inspection report overview comprises the following fields: database type, database server IP address, database server port number, database name, inspection time; the data inspection result includes the following fields: english table name, english field name, data standard number, checking rule, query condition, number of non-conforming rule, total number of query and data standard rate; the non-compliance check rule data details include the following fields: check statement SQL and detail data.
8. A data automation test device, the device comprising: the device comprises a receiving module, a generating module and a testing module; wherein,
the receiving module is used for receiving the test parameters of the data to be tested, which are input by the tester at the automatic test interface; wherein the test parameters include: database type, database server IP address, database server port number, database name, database user password, concurrency number, and multiple rows of input parameters;
The generation module is used for generating a background processing script of the data to be tested according to the test parameters;
and the test module is used for carrying out data standard combination test on the data to be tested through the background processing script to obtain a data standard combination test report corresponding to the data to be tested.
9. An electronic device, comprising:
one or more processors;
a memory for storing one or more programs,
the one or more programs, when executed by the one or more processors, cause the one or more processors to implement the data automation test method of any of claims 1 to 7.
10. A storage medium having stored thereon a computer program, which when executed by a processor implements a data automation test method according to any of claims 1 to 7.
Priority Applications (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN202311640663.5A CN117873860A (en) | 2023-12-01 | 2023-12-01 | Data automatic testing method and device, electronic equipment and storage medium |
Applications Claiming Priority (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN202311640663.5A CN117873860A (en) | 2023-12-01 | 2023-12-01 | Data automatic testing method and device, electronic equipment and storage medium |
Publications (1)
Publication Number | Publication Date |
---|---|
CN117873860A true CN117873860A (en) | 2024-04-12 |
Family
ID=90587256
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
CN202311640663.5A Pending CN117873860A (en) | 2023-12-01 | 2023-12-01 | Data automatic testing method and device, electronic equipment and storage medium |
Country Status (1)
Country | Link |
---|---|
CN (1) | CN117873860A (en) |
-
2023
- 2023-12-01 CN CN202311640663.5A patent/CN117873860A/en active Pending
Similar Documents
Publication | Publication Date | Title |
---|---|---|
Khan et al. | Guidelines for assessing the accuracy of log message template identification techniques | |
US9652513B2 (en) | Generating data pattern information | |
CN115827895A (en) | Vulnerability knowledge graph processing method, device, equipment and medium | |
CN112559523A (en) | Data detection method and device, electronic equipment and storage medium | |
US10339035B2 (en) | Test DB data generation apparatus | |
US9213543B2 (en) | Software internationalization estimation model | |
CN110389941A (en) | Database method of calibration, device, equipment and storage medium | |
CN112612716B (en) | Method, system, equipment and storage medium for enhancing marking of coverage rate of difference line codes | |
CN111858377B (en) | Quality evaluation method and device for test script, electronic equipment and storage medium | |
CN117435189A (en) | Test case analysis method, device, equipment and medium of financial system interface | |
CN111767213A (en) | Method and device for testing database check points, electronic equipment and storage medium | |
CN112131296A (en) | Data exploration method and device, electronic equipment and storage medium | |
CN116340172A (en) | Data collection method and device based on test scene and test case detection method | |
CN113220594B (en) | Automatic test method, device, equipment and storage medium | |
CN117873860A (en) | Data automatic testing method and device, electronic equipment and storage medium | |
US20160027123A1 (en) | Automatic tagging of trial balance | |
CN113238940B (en) | Interface test result comparison method, device, equipment and storage medium | |
CN114706856A (en) | Fault processing method and device, electronic equipment and computer readable storage medium | |
CN111767222A (en) | Data model verification method and device, electronic equipment and storage medium | |
CN113641572B (en) | Debugging method for massive big data computing development based on SQL | |
Yatkın et al. | Logical analysis and contradiction detection in high-level requirements during the review process using sat-solver | |
Zhi et al. | LLM-powered Zero-shot Online Log Parsing | |
CN118093560A (en) | Cross-validation method and device for detecting data accuracy in examination industry | |
CN116483377A (en) | Code detection method and device, electronic equipment and storage medium | |
CN115470149A (en) | Database preprocessing function testing method, device, equipment and storage medium |
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 |