CN117194255A - Test data maintenance method, device, equipment and storage medium - Google Patents
Test data maintenance method, device, equipment and storage medium Download PDFInfo
- Publication number
- CN117194255A CN117194255A CN202311172597.3A CN202311172597A CN117194255A CN 117194255 A CN117194255 A CN 117194255A CN 202311172597 A CN202311172597 A CN 202311172597A CN 117194255 A CN117194255 A CN 117194255A
- Authority
- CN
- China
- Prior art keywords
- test
- data
- test data
- file
- script
- 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 370
- 238000012423 maintenance Methods 0.000 title claims abstract description 75
- 238000000034 method Methods 0.000 title claims abstract description 64
- 238000013515 script Methods 0.000 claims description 85
- 238000005192 partition Methods 0.000 claims description 10
- 238000012216 screening Methods 0.000 claims description 7
- 238000012545 processing Methods 0.000 abstract description 5
- 238000004891 communication Methods 0.000 description 6
- 238000010586 diagram Methods 0.000 description 6
- 230000008569 process Effects 0.000 description 6
- 238000004519 manufacturing process Methods 0.000 description 5
- 238000004458 analytical method Methods 0.000 description 3
- 238000004590 computer program Methods 0.000 description 3
- 238000013522 software testing Methods 0.000 description 3
- 208000025174 PANDAS Diseases 0.000 description 2
- 208000021155 Paediatric autoimmune neuropsychiatric disorders associated with streptococcal infection Diseases 0.000 description 2
- 240000004718 Panda Species 0.000 description 2
- 235000016496 Panda oleosa Nutrition 0.000 description 2
- 239000003086 colorant Substances 0.000 description 2
- 238000001514 detection method Methods 0.000 description 2
- 238000000605 extraction Methods 0.000 description 2
- 230000006870 function Effects 0.000 description 2
- 230000008676 import Effects 0.000 description 2
- 238000012795 verification Methods 0.000 description 2
- 241000282326 Felis catus Species 0.000 description 1
- 230000005540 biological transmission Effects 0.000 description 1
- 238000009960 carding Methods 0.000 description 1
- 238000010835 comparative analysis Methods 0.000 description 1
- 238000005516 engineering process Methods 0.000 description 1
- 239000000284 extract Substances 0.000 description 1
- 238000001914 filtration Methods 0.000 description 1
- 238000011835 investigation Methods 0.000 description 1
- 239000000203 mixture Substances 0.000 description 1
- 230000003287 optical effect Effects 0.000 description 1
- 230000008439 repair process Effects 0.000 description 1
- 230000004044 response Effects 0.000 description 1
- 230000008719 thickening Effects 0.000 description 1
Abstract
The application discloses a test data maintenance method, a device, equipment and a storage medium, wherein the test data maintenance method comprises the following steps: acquiring test data of multiple tables; forming a test file by adopting a preset storage format based on the test data and the category information of the test data, wherein the test file contains test data of each table; and carrying out data test on the test file to obtain a test result. The application belongs to the technical field of data processing, and adopts a preset storage format to maintain test data of each table in the same test file, thereby realizing the purpose of maintaining test data of a plurality of tables on one file page and reducing the maintenance cost related to page switching.
Description
Technical Field
The present application relates to the field of data processing technologies, and in particular, to a test data maintenance method, apparatus, device, and storage medium.
Background
In the field of software testing, test scripts are often required to handle complex business scenarios. The complex business scene involves a plurality of original tables, and the association relationship between the original tables is complex, so that the maintenance cost of the tester for the data is high.
In the related art, the csv file is generally adopted to maintain the test data, so that the time consumption of the test personnel for checking and carding the data is reduced. However, in the process of using the csv files, each csv file can only independently maintain one file, so that a tester needs to open a plurality of csv files simultaneously for comparison analysis when editing an automatic test case, and the maintenance cost is high.
Disclosure of Invention
The application mainly aims to provide a test data maintenance method, a device, equipment and a storage medium, which aim to solve the technical problem of high maintenance cost in the prior art.
In order to achieve the above object, the present application provides a test data maintenance method, including:
acquiring test data of multiple tables;
forming a test file by adopting a preset storage format based on the test data and the category information of the test data, wherein the test file contains test data of each table;
and carrying out data test on the test file to obtain a test result.
Optionally, the storage format is an Excel format.
Optionally, the step of forming a test file by adopting a preset storage format based on the test data and the category information of the test data includes:
dividing a target area based on the category information of the test data;
and filling the test data into the corresponding target area by adopting a preset storage format to form a test file.
Optionally, the step of acquiring test data of multiple tables includes:
acquiring test scripts of multiple tables;
extracting script contents of the test script according to the script path of the test script;
analyzing the script content to obtain header fields of each table;
acquiring a data block corresponding to the header field;
and forming test data of multiple tables based on the data blocks and the header fields.
Optionally, the step of performing data testing on the test file to obtain a test result includes:
extracting target data corresponding to the data block in the test file, and clearing a partition corresponding to a field in the data block;
importing the target data into a test table;
executing a test script based on the test table to obtain a corresponding result table;
and checking the result table to obtain a test result.
Optionally, the step of parsing the script content to obtain header fields of each table includes:
performing keyword matching on the script content by adopting a mode of matching keywords in a regular way to obtain the table names of the original tables of each table related to the test script;
determining a field name related to the original table based on the table name;
and screening the field names to obtain the header fields of the tables.
Optionally, after the step of forming a test file by adopting a preset storage format based on the test data and the category information of the test data, the method includes:
acquiring an annotation block and an identification instruction;
executing the identification operation corresponding to the identification instruction on the test data in the test file to obtain identified test data;
filling the comment block into a preset area in the test file to obtain comment block data;
forming an updated test file based on the test data and the comment block data;
the step of performing data test on the test file to obtain a test result comprises the following steps:
and carrying out data test on the updated test file to obtain a test result.
The application also provides a test data maintenance device, which comprises:
the acquisition module is used for acquiring test data of multiple tables;
the forming module is used for forming a test file by adopting a preset storage format based on the test data and the category information of the test data, wherein the test file contains the test data of each table;
and the test module is used for carrying out data test on the test file to obtain a test result.
The present application also provides a test data maintenance apparatus comprising: a memory, a processor and a program stored on the memory for implementing the test data maintenance method,
the memory is used for storing a program for realizing the test data maintenance method;
the processor is configured to execute a program for implementing the test data maintenance method to implement the steps of the test data maintenance method.
The present application also provides a storage medium having stored thereon a program for implementing a test data maintenance method, the program for implementing the test data maintenance method being executed by a processor to implement the steps of the test data maintenance method.
The application adopts the preset storage format to maintain the test data of each table in the same test file, thereby realizing the purpose of maintaining the test data of a plurality of tables on one file page and reducing the maintenance cost related to page switching.
Drawings
The accompanying drawings, which are incorporated in and constitute a part of this specification, illustrate embodiments consistent with the application and together with the description, serve to explain the principles of the application. In order to more clearly illustrate the embodiments of the application or the technical solutions of the prior art, the drawings which are used in the description of the embodiments or the prior art will be briefly described, and it will be obvious to a person skilled in the art that other drawings can be obtained from these drawings without inventive effort.
FIG. 1 is a flowchart of a test data maintenance method according to a first embodiment of the present application;
FIG. 2 is a diagram of an Excel page of the test data maintenance method of the present application;
FIG. 3 is a diagram of an Excel results page of the test data maintenance method of the present application;
FIG. 4 is a schematic diagram of a data testing flow of the test data maintenance method of the present application;
FIG. 5 is a schematic block diagram of a test data maintenance device according to the present application;
FIG. 6 is a schematic diagram of a device architecture of a hardware operating environment according to an embodiment of the present application.
The achievement of the objects, functional features and advantages of the present application will be further described with reference to the accompanying drawings, in conjunction with the embodiments.
Detailed Description
It should be understood that the specific embodiments described herein are for purposes of illustration only and are not intended to limit the scope of the application.
Referring to fig. 1, fig. 1 is a flowchart of a first embodiment of a test data maintenance method according to the present application.
In a first embodiment, the test data maintenance method includes the steps of:
step S100, test data of multiple tables are obtained;
the main body of the test data maintenance method is a test data maintenance device, preferably, the test data maintenance device is a PC terminal, and may be other terminals having data transmission and data processing functions, which are not particularly limited herein.
It is understood that the test data refers to data used for software testing, the object of the software testing is a test script (preferably a HYSQL script), the basic logic of the script is to acquire data from a specified few original tables, process the data according to service logic, and then drop the result into a specified target table. The original table can be a table subjected to layer-by-layer processing, the most source of data can be the front end input of a certain system or an input file of a certain external system, so that the original system is not required to be traced to be specially and manufactured layer by layer, the number can be directly manufactured in the original table of the script, and the manufactured data is required to be paid attention to, accords with the field definition of the table and covers all possible business scenes.
In a specific implementation, because a scene related to a test script is complex, each scene or a plurality of scenes is used as a table, wherein the table is a specific physical table, the scene is an abstract logic concept, one scene can be a plurality of physical tables or data of a plurality of scenes in the same table, and the device stores test data of a plurality of tables in one page or one file, so that maintenance cost related to page switching is reduced, namely a tester only needs to open one test file when editing an automatic test case, and comparative analysis of the test data of a plurality of scenes can be performed, so that maintenance cost related to page switching is reduced.
In a specific implementation, the method for obtaining test data of multiple tables by the device further comprises the following steps:
firstly, the device acquires test scripts of multiple tables; secondly, extracting script contents of the test script by the device according to the script path of the test script; the device analyzes the script content to obtain the header fields of each table; the device acquires a data block corresponding to the header field; and finally, the device forms test data of multiple tables based on the data block and the header field.
It is understood that a test script is a logic application developed by a tester for data testing, and one test script may include tables of a plurality of tables, or may be a table of one test script corresponding to one table.
In a specific implementation, the device extracts the specific implementation mode of the script content of the test script according to the script path of the test script as follows: the device configures a storage path of a test script in a designated configuration file, connects to a deployment machine of the test environment through a python paramiko library by an SSH protocol, searches a script file with py as a suffix under the path of the script, executes a cat command to acquire script contents, and intercepts out target SQL sentences in a regular matching contract keywords (hiveSql, impalaSql and the like) mode, namely the script contents of the test script.
It should be noted that, the header field of each table is a related category for field data in each table, including, but not limited to, a mode name, a table name, a field name, and a field remark; the data blocks corresponding to the header fields are related data for testing, the data blocks are in one-to-one correspondence with the header, and the device can acquire the data blocks corresponding to the header fields manually. For example, referring to FIG. 2, where paragraphs 16, 48, 66 are the heads of the tables of the different tables, respectively, and where paragraphs 17-27, 49-52, and 67-69 are the data blocks under the heads of the tables of the different tables, respectively.
It is understood that the data block and header combination whole field is used as the test data in the present embodiment, that is, the test data includes the data block and header combination whole field.
In a specific implementation, the method for analyzing the script content to obtain the header fields of each table by the device further comprises the following steps:
firstly, the device adopts a regular keyword matching mode to match keywords to the script content to obtain the table names of the original tables of each table related to the test script; secondly, the device determines the field names related to the original table based on the table names; and finally, the device performs screening treatment on the field names to obtain the header fields of the tables.
The device analyzes the script content, and generates each table header in the test file (or data page) according to the fields of each table used by the script.
In the specific implementation, the device matches the table names of all original tables used by the script in a mode of regularly matching keywords; the device is connected with the hive library again, and the table structure of each original table is obtained in a desc table name mode, so that the names of all fields of the table are obtained; and finally, further screening out field names appearing in the script to generate the header of each original table, wherein the format of the header can be 'mode name, table name, field remark', which is used for writing the test file later.
It can be understood that, since many tables can have fields irrelevant to business logic such as record operators, operation time, creator, creation time, etc., and these fields do not affect logic tests when testing creation numbers, if these redundant data are maintained on data pages, important business data can appear to be less obvious, and the maintenance cost of test data is increased. For the partially redundant field, the present application selects the same field value of a random record of the table to populate.
Step 200, forming a test file by adopting a preset storage format based on the test data and the category information of the test data, wherein the test file contains the test data of each table;
in a specific implementation, the storage format is an Excel format, specifically, because the Excel format supports single sheet page maintenance multi-table data, the purpose of maintaining test data of a plurality of tables on one file page is achieved, and therefore maintenance cost related to page switching is reduced.
Furthermore, the Excel format also supports cell color identification and text remarks, and the text of the annotation class is added to explain the service scene corresponding to the test data, so that the legibility of the test file is improved.
It should be noted that, referring to the relevant page of the test file in fig. 2, the relevant page includes test data (including header, comment block and data block) of each table, where 16, 48, and 66 sections are respectively the header of the tables of different tables, and 17-27 sections, 49-52 sections, and 67-69 sections are respectively the data blocks under the header of the tables of different tables.
In a specific implementation, the device adopts a preset storage format based on the test data and the category information of the test data, and the method for forming the test file further comprises the following steps:
firstly, dividing a target area by a device based on category information of the test data; and secondly, filling the test data into the corresponding target area by the device by adopting a preset storage format to form a test file.
It is understood that the target area refers to that the device divides different types of test data into different areas on the page of the test file, specifically, referring to fig. 2, different target tables are separated by empty rows, so that when the data block fields of the tables of different tables are read, the distinction and the reading can be performed later.
And step S300, performing data test on the test file to obtain a test result.
It is understood that the main workflow of data class testing can be generalized as: through understanding and abstracting business logic, test data under each business scene is designed, the data is written into each original table, a HYSQL script to be tested is executed, then whether the data falling into each target table accords with expectations is checked manually, if so, the results are recorded, in the follow-up regression test, the test data of each scene is automatically updated into each original table again (the test environment data is prevented from being tampered by other people), then the HYSQL script to be tested is executed, whether the target table data accords with the expected results recorded before or not is checked automatically through the script, and if so, the automatic regression test is passed.
In a specific implementation, the device performs data testing on the test file, wherein the device automatically imports data of a data page into a hive table, and then the device executes a data script, if the data script is executed for the first time, a tester is required to manually check whether a result of the result table accords with expectations or not, if the result does not accord with expectations, the device feeds back, develops and repairs; the results were recorded into an Excel results page as expected.
In a specific implementation, the device performs data testing on the test file, and the method for obtaining the test result further comprises the following steps:
extracting target data corresponding to the data block in the test file, and clearing a partition corresponding to a field in the data block; importing the target data into a test table; executing a test script based on the test table to obtain a corresponding result table; and checking the result table to obtain a test result.
In a specific implementation, referring to fig. 2, the device may parse the content of the data page of Excel using the pandas library, first retrieve the cell content row by row, and distinguish different original tables by empty rows; the cells of the header of each original table are in a fixed format generated in the previous automation step, so that the header cells and remark cells can be distinguished through the fixed format, and further the number-making column and the remark column of the original table are distinguished, and only the content of the data column of each original table needs to be taken out in the step.
Next, with reference to fig. 4, the apparatus collects the partitions related to the number of creation of each table for manual detection of the data script, clears the related partitions, and prevents the number of creation from being repeated. Then connecting the hive database to obtain the partition field names and all field names of each original table, for the fields defined in the manufacture Excel, using the values of Excel as filling values, for the fields not defined in the manufacture Excel, and for the fields not defined in the manufacture Excel, considering the values irrelevant to the logic of the test script, such as the creator of the record and the creation time field, so that reasonable random values are needed, and because the types of different fields are different, the reasonable random values are also different, such as the random value of the creator field is a random character string, and the random value of the creation time is a random time stamp, the application adopts the same field value of the random row in the table as the filling value of the fields. Based on the above, a final insert statement can be spliced, namely, a row of random data is taken out from the table and the table, all fields of the random data are taken, the fields defined by Excel are replaced by specific values, other fields are taken from the corresponding fields of the random row data, the SQL statement is executed, and the data are inserted into the corresponding partitions to finish the number generation.
Further, the device uses a paramiko library to connect to a test environment in an SSH protocol, enters a deployment path of a script, executes a python command to run the script to be tested, checks whether data falling in each target table accords with the expectation of each manufacturing number scene after the execution is successful, and records the data of each target table into a result page of Excel if the data accords with the expectation of each manufacturing number scene. Wherein the result page can refer to fig. 3, the result page records data of a plurality of target tables, the format is consistent with the data page, and the table head is identified in a mode name, table name, field remark format.
For automatic detection of the data script, the device firstly automatically imports the data of the data page into the hive table, secondly executes the data script, verifies whether the result of the result table is consistent with the result of the result page in Excel, and if so, the case passes. And reading expected results of the target tables from a result page of Excel, supporting reading a plurality of target tables, separating different target tables by empty lines, and supporting remark characters. And connecting the hive database through query sentences of each target table configured by the cases to obtain the actual results of each target table. And filtering the rows of which the expected result set is completely consistent with the actual result set by using the duplicate removal function of the pandas, so that the rows needing to be concerned, namely inconsistent rows, rows of which the actual result set is excessive and rows of which the actual result set is missing, can be obtained.
In order to implement an automatic test flow, the application designs an Excel analysis system which can analyze the Excel file with the specified format, automatically translate the Excel file into SQL sentences and insert data into a hive specified partition.
The application adopts the preset storage format to maintain the test data of each table in the same test file, thereby realizing the purpose of maintaining the test data of a plurality of tables on one file page and reducing the maintenance cost related to page switching.
Based on the above first embodiment, the present application further provides another embodiment, referring to fig. 2, in step S200, after the step of forming a test file by adopting a preset storage format based on the test data and the category information of the test data, the method further includes the following steps:
acquiring an annotation block and an identification instruction; executing the identification operation corresponding to the identification instruction on the test data in the test file to obtain identified test data; filling the comment block into a preset area in the test file to obtain comment block data; forming an updated test file based on the test data and the comment block data; and carrying out data test on the updated test file to obtain a test result.
It can be understood that the application manually maintains the test data of each table according to the test scene, and adds a text annotation block and related field labels, wherein the field labels are the identification instructions which are issued by the device in response to the test personnel, the device carries out the identification operation corresponding to the identification instructions on the test data in the test file, so as to obtain the identified test data, and the field labels comprise but are not limited to font thickening and background colors or font colors on the field labels.
In a specific implementation, a tester converts a test scene into specific test data in each table, and for associated fields among different tables, the same background color or font color can be marked, so that the associated relation is more clear at a glance, key fields can be thickened, remark characters can be added behind each row of test data to identify the test scene to which the data belong, the maintenance cost of the test data is reduced, and the data problem investigation efficiency is improved.
The present application also provides a test data maintenance apparatus, referring to fig. 5, comprising:
an acquisition module 10, configured to acquire test data of multiple tables;
the forming module 20 is configured to form a test file according to the test data and the category information of the test data, and a preset storage format is adopted, where the test file includes test data of each table;
and the test module 30 is used for performing data test on the test file to obtain a test result.
Optionally, the forming module 20 includes:
the region dividing module is used for dividing a target region based on the category information of the test data;
and the file forming module is used for filling the test data into the corresponding target area by adopting a preset storage format to form a test file.
Optionally, the acquiring module 10 includes:
the script acquisition module is used for acquiring test scripts of multiple tables;
the extraction module is used for extracting script contents of the test script according to the script path of the test script;
the analysis module is used for analyzing the script content to obtain header fields of each table;
the data block acquisition module is used for acquiring the data block corresponding to the header field;
and the composition module is used for composing test data of multiple tables based on the data block and the header field.
Optionally, the test module 30 includes:
the extraction module is used for extracting target data corresponding to the data block in the test file and clearing a partition corresponding to a field in the data block;
the importing module is used for importing the target data into a test table;
the script execution module is used for executing the test script based on the test table to obtain a corresponding result table;
and the verification module is used for carrying out verification processing on the result table to obtain a test result.
Optionally, the parsing module includes:
the matching module is used for matching keywords with the script content in a regular keyword matching mode to obtain the table names of the original tables of the tables related to the test script;
the field determining module is used for determining the field names related to the original table based on the table names;
and the screening module is used for screening the field names to obtain the header fields of the tables.
Optionally, the test data maintenance device further comprises:
the identification acquisition module is used for acquiring the annotation block and the identification instruction;
the instruction implementation module is used for implementing the identification operation corresponding to the identification instruction on the test data in the test file to obtain the identified test data;
the filling module is used for filling the comment block into a preset area in the test file to obtain comment block data;
the file updating module is used for forming an updated test file based on the test data and the comment block data;
and the data testing module is used for carrying out data testing on the updated testing file to obtain a testing result.
The specific implementation manner of the test data maintenance device of the present application is basically the same as that of each embodiment of the test data maintenance method, and will not be repeated here.
Referring to fig. 6, fig. 6 is a schematic diagram of a terminal structure of a hardware running environment according to an embodiment of the present application.
As shown in fig. 6, the terminal may include: a processor 1001, such as a CPU, a network interface 1004, a user interface 1003, a memory 1005, a communication bus 1002. Wherein the communication bus 1002 is used to enable connected communication between these components. The user interface 1003 may include a Display, an input unit such as a Keyboard (Keyboard), and the optional user interface 1003 may further include a standard wired interface, a wireless interface. The network interface 1004 may optionally include a standard wired interface, a wireless interface (e.g., WI-FI interface). The memory 1005 may be a high-speed RAM memory or a stable memory (non-volatile memory), such as a disk memory. The memory 1005 may also optionally be a storage device separate from the processor 1001 described above.
Optionally, the test data maintenance device may further include a rectangular user interface, a network interface, a camera, an RF (Radio Frequency) circuit, a sensor, an audio circuit, a WiFi module, and the like. The rectangular user interface may include a Display screen (Display), an input sub-module such as a Keyboard (Keyboard), and the optional rectangular user interface may also include a standard wired interface, a wireless interface. The network interface may optionally include a standard wired interface, a wireless interface (e.g., WI-FI interface).
It will be appreciated by those skilled in the art that the test data maintenance device structure shown in FIG. 1 is not limiting of the test data maintenance device and may include more or fewer components than shown, or may combine certain components, or a different arrangement of components.
As shown in fig. 6, an operating system, a network communication module, and a test data maintenance program may be included in the memory 1005 as one type of storage medium. An operating system is a program that manages and controls the hardware and software resources of the test data maintenance device, supporting the operation of the test data maintenance program and other software and/or programs. The network communication module is used to enable communication between components within the memory 1005 and with other hardware and software in the test data maintenance system.
In the test data maintenance device shown in fig. 6, a processor 1001 is configured to execute a test data maintenance program stored in a memory 1005, and implement the steps of the test data maintenance method described in any one of the above.
The specific implementation manner of the test data maintenance device of the present application is basically the same as that of each embodiment of the test data maintenance method, and will not be repeated here.
The present application also provides a storage medium having stored thereon a program for implementing a test data maintenance method, the program for implementing the test data maintenance method being executed by a processor to implement the test data maintenance method as follows:
acquiring test data of multiple tables;
forming a test file by adopting a preset storage format based on the test data and the category information of the test data, wherein the test file contains test data of each table;
and carrying out data test on the test file to obtain a test result.
Optionally, the storage format is an Excel format.
Optionally, the step of forming a test file by adopting a preset storage format based on the test data and the category information of the test data includes:
dividing a target area based on the category information of the test data;
and filling the test data into the corresponding target area by adopting a preset storage format to form a test file.
Optionally, the step of acquiring test data of multiple tables includes:
acquiring test scripts of multiple tables;
extracting script contents of the test script according to the script path of the test script;
analyzing the script content to obtain header fields of each table;
acquiring a data block corresponding to the header field;
and forming test data of multiple tables based on the data blocks and the header fields.
Optionally, the step of performing data testing on the test file to obtain a test result includes:
extracting target data corresponding to the data block in the test file, and clearing a partition corresponding to a field in the data block;
importing the target data into a test table;
executing a test script based on the test table to obtain a corresponding result table;
and checking the result table to obtain a test result.
Optionally, the step of parsing the script content to obtain header fields of each table includes:
performing keyword matching on the script content by adopting a mode of matching keywords in a regular way to obtain the table names of the original tables of each table related to the test script;
determining a field name related to the original table based on the table name;
and screening the field names to obtain the header fields of the tables.
Optionally, after the step of forming a test file by adopting a preset storage format based on the test data and the category information of the test data, the method includes:
acquiring an annotation block and an identification instruction;
executing the identification operation corresponding to the identification instruction on the test data in the test file to obtain identified test data;
filling the comment block into a preset area in the test file to obtain comment block data;
forming an updated test file based on the test data and the comment block data;
the step of performing data test on the test file to obtain a test result comprises the following steps:
and carrying out data test on the updated test file to obtain a test result.
The specific implementation manner of the storage medium of the present application is basically the same as that of each embodiment of the test data maintenance method described above, and will not be repeated here.
The application also provides a computer program product comprising a computer program which, when executed by a processor, implements the steps of the test data maintenance method described above.
The specific implementation manner of the computer program product of the present application is substantially the same as that of the above-mentioned embodiments of the test data maintenance method, and will not be described herein.
It should be noted that, in this document, the terms "comprises," "comprising," or any other variation thereof, are intended to cover a non-exclusive inclusion, such that a process, method, article, or apparatus that comprises a list of elements does not include only those elements but may include other elements not expressly listed or inherent to such process, method, article, or apparatus. Without further limitation, an element defined by the phrase "comprising one … …" does not exclude the presence of other like elements in a process, method, article, or apparatus that comprises the element.
The foregoing embodiment numbers of the present application are merely for the purpose of description, and do not represent the advantages or disadvantages of the embodiments.
From the above description of the embodiments, it will be clear to those skilled in the art that the above-described embodiment method may be implemented by means of software plus a necessary general hardware platform, but of course may also be implemented by means of hardware, but in many cases the former is a preferred embodiment. Based on such understanding, the technical solution of the present application may be embodied essentially or in a part contributing to the prior art in the form of a software product stored in a storage medium (e.g. ROM/RAM, magnetic disk, optical disk) as described above, comprising instructions for causing a terminal device (which may be a mobile phone, a computer, a server, an air conditioner, or a network device, etc.) to perform the method according to the embodiments of the present application.
The foregoing description is only of the preferred embodiments of the present application, and is not intended to limit the scope of the application, but rather is intended to cover any equivalents of the structures or equivalent processes disclosed herein or in the alternative, which may be employed directly or indirectly in other related arts.
Claims (10)
1. A test data maintenance method, characterized in that the test data maintenance method comprises:
acquiring test data of multiple tables;
forming a test file by adopting a preset storage format based on the test data and the category information of the test data, wherein the test file contains test data of each table;
and carrying out data test on the test file to obtain a test result.
2. The test data maintenance method of claim 1, wherein the storage format is an Excel format.
3. The test data maintenance method of claim 1, wherein the step of forming a test file using a preset storage format based on the test data and class information of the test data comprises:
dividing a target area based on the category information of the test data;
and filling the test data into the corresponding target area by adopting a preset storage format to form a test file.
4. The test data maintenance method of claim 1, wherein the step of obtaining test data of multiple tables comprises:
acquiring a test script;
extracting script contents of the test script according to the script path of the test script;
analyzing the script content to obtain header fields of each table;
acquiring a data block corresponding to the header field;
and forming test data of multiple tables based on the data blocks and the header fields.
5. The method for maintaining test data as claimed in claim 4, wherein the step of performing the data test on the test file to obtain the test result comprises:
extracting target data corresponding to the data block in the test file, and clearing a partition corresponding to a field in the data block;
importing the target data into a test table;
executing a test script based on the test table to obtain a corresponding result table;
and checking the result table to obtain a test result.
6. The test data maintenance method of claim 4, wherein the step of parsing the script content to obtain header fields of each table comprises:
performing keyword matching on the script content by adopting a mode of matching keywords in a regular way to obtain the table names of the original tables of each table related to the test script;
determining a field name related to the original table based on the table name;
and screening the field names to obtain the header fields of the tables.
7. The test data maintenance method according to claim 1, wherein after the step of forming a test file using a predetermined storage format based on the test data and the class information of the test data, the method comprises:
acquiring an annotation block and an identification instruction;
executing the identification operation corresponding to the identification instruction on the test data in the test file to obtain identified test data;
filling the comment block into a preset area in the test file to obtain comment block data;
forming an updated test file based on the test data and the comment block data;
the step of performing data test on the test file to obtain a test result comprises the following steps:
and carrying out data test on the updated test file to obtain a test result.
8. A test data maintenance device, the test data maintenance device comprising:
the acquisition module is used for acquiring test data of multiple tables;
the forming module is used for forming a test file by adopting a preset storage format based on the test data and the category information of the test data, wherein the test file contains the test data of each table;
and the test module is used for carrying out data test on the test file to obtain a test result.
9. A test data maintenance device, the test data maintenance device comprising: a memory, a processor and a program stored on the memory for implementing the test data maintenance method,
the memory is used for storing a program for realizing the test data maintenance method;
the processor is configured to execute a program implementing the test data maintenance method to implement the steps of the test data maintenance method according to any one of claims 1 to 7.
10. A storage medium having stored thereon a program for implementing a test data maintenance method, the program for implementing the test data maintenance method being executed by a processor to implement the steps of the test data maintenance method according to any one of claims 1 to 7.
Priority Applications (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN202311172597.3A CN117194255A (en) | 2023-09-12 | 2023-09-12 | Test data maintenance method, device, equipment and storage medium |
Applications Claiming Priority (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN202311172597.3A CN117194255A (en) | 2023-09-12 | 2023-09-12 | Test data maintenance method, device, equipment and storage medium |
Publications (1)
Publication Number | Publication Date |
---|---|
CN117194255A true CN117194255A (en) | 2023-12-08 |
Family
ID=89001225
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
CN202311172597.3A Pending CN117194255A (en) | 2023-09-12 | 2023-09-12 | Test data maintenance method, device, equipment and storage medium |
Country Status (1)
Country | Link |
---|---|
CN (1) | CN117194255A (en) |
Cited By (2)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN117408231A (en) * | 2023-12-14 | 2024-01-16 | 上海孤波科技有限公司 | Method and device for converting format of chip test result and electronic equipment |
CN117408231B (en) * | 2023-12-14 | 2024-04-19 | 上海孤波科技有限公司 | Method and device for converting format of chip test result and electronic equipment |
-
2023
- 2023-09-12 CN CN202311172597.3A patent/CN117194255A/en active Pending
Cited By (2)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN117408231A (en) * | 2023-12-14 | 2024-01-16 | 上海孤波科技有限公司 | Method and device for converting format of chip test result and electronic equipment |
CN117408231B (en) * | 2023-12-14 | 2024-04-19 | 上海孤波科技有限公司 | Method and device for converting format of chip test result and electronic equipment |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
US10289541B2 (en) | Source code flow analysis using information retrieval | |
US20130332905A1 (en) | Test code generation based on test documentation | |
CN110765639B (en) | Electrical simulation modeling method and device and readable storage medium | |
US20180268081A1 (en) | Data extraction | |
CN109858021B (en) | Service problem statistics method, device, computer equipment and storage medium thereof | |
CN114372006A (en) | Method and system for automatically generating test case, computer equipment and storage medium | |
CN111488314A (en) | Simulation log analysis method based on Python | |
CN111475405A (en) | Regression testing method and device, computer equipment and storage medium | |
CN117194255A (en) | Test data maintenance method, device, equipment and storage medium | |
CN115757174A (en) | Database difference detection method and device | |
CN113312485B (en) | Log automatic classification method and device and computer readable storage medium | |
CN110188106B (en) | Data management method and device | |
CN113094265B (en) | Analysis method and analysis device for test script and electronic equipment | |
JP4767389B2 (en) | Logging device and recording medium | |
CN111352824A (en) | Test method and device and computer equipment | |
CN115470127B (en) | Page compatibility processing method, device, computer equipment and storage medium | |
CN112597040A (en) | Interface automatic testing method and device and electronic equipment | |
CN113821482A (en) | Information processing method and device, electronic equipment and readable storage medium | |
CN115357625A (en) | Structured data comparison method and device, electronic equipment and storage medium | |
CN116126721A (en) | Method and device for converting format of test case document, computer equipment and storage medium | |
CN115658552A (en) | Test data recommendation method and device, storage medium and electronic equipment | |
CN116991744A (en) | Automatic test method, device, electronic equipment and storage medium | |
CN113255818A (en) | Method, device, equipment and storage medium for acquiring information of report file | |
CN116881603A (en) | Webpage data extraction method and device, terminal equipment and storage medium | |
CN116483698A (en) | Front-end affected function point analysis 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 |