Model-based data resource automatic testing method and system
By generating test case models for data resources, the system automatically identifies and updates changes to data resources, solving the automation challenge of data resource development and testing. This achieves an efficient and fully automated testing process, improving the efficiency of data resource development.
Patent Information
- Application Number
- CN202411906161.7
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2024-12-23
- Publication Date
- 2025-12-19
- Estimated Expiration
- 2044-12-23
AI Technical Summary
Existing technologies cannot achieve continuous automated testing of data resource development, and existing methods cannot detect changes in data resources or cover changes in multiple data resources, resulting in low testing efficiency.
By generating test case models for data resources, the system automatically identifies changes in data resources, continuously automates testing, generates new test case models, and saves the execution result tags before and after the test case changes, thus achieving fully automated testing.
It achieves full automation of data resource development and testing, is applicable to dynamically changing scenarios, improves testing efficiency and sustainability, and reduces enterprise costs.
Smart Images

Figure CN120029903B_ABST
Abstract
Description
TECHNICAL FIELD
[0001] The present application relates to the technical field of data resource development testing, in particular to a model-based data resource automatic testing method and system. BACKGROUND
[0002] At present, all units in all industries in China attach great importance to data resource development testing work. However, at the present stage, most units cannot automatically test data resource development through scientific and sustainable methods. Although a few well-funded enterprises solve the problem of data resource development testing by hiring a data development and testing team, this method is usually one-time and cannot be automatically executed, and must continue to invest in capital costs, so it is not universal for most enterprises.
[0003] The current automatic testing of data resource development mostly uses the method of generating a random test set and a preset case set, however, this method cannot find the changes of the same data resource, cannot cover the changes of multiple data resources, and cannot improve the efficiency of data resource development testing. SUMMARY
[0004] Therefore, the purpose of the present application is to provide a model-based data resource automatic testing method and system, which can automatically identify data resource changes, continuously automatically test, make up for and optimize the technical gap in the field of data resource development testing, not only automatically maintain data resource test case models, but also be applicable to different data resource dynamic change scenarios, update or discard the original case model according to the result analysis, generate a new test case model, and save the execution result tags before and after the data resource test case changes, so as to facilitate the user to trace the data resource and improve the data resource development efficiency.
[0005] The present application provides a model-based data resource automatic testing method, comprising the following steps:
[0006] S1, access the database corresponding to the data resource (and test the database connection to be successful); access the target database where the data resource needs to be stored (and test the database connection to be successful, the target database is the data resource center); configure the metadata collection task of the data resource, copy the metadata of the data resource in the target database; generate the test case suite name of the data resource, and generate the test case model name of different levels of the data resource;
[0007] S2, configure a scheduling task from a collection task configuration in different databases, select a running period (minute, hour, day, week, month) according to a data resource iteration frequency, set a running validity period, set a failed task to run again, publish metadata collection tasks in a scheduling list after the scheduling task configuration is completed, and the state is effective; read data resources for each test case, and process and handle to write data resources; use the test case to perform testing;
[0008] S3, publish and mark the test case whose test execution is successful as a data resource test case model, including: selecting one or more test cases marked as valid and publishing as a data resource test case model; configuring a data resource test case model scheduling task, selecting a data resource test case model, selecting a running period (minute, hour, day, week, month), setting a running validity period, setting a failed task to run again, and publishing the data resource test case model in a scheduling list after the task configuration is completed, and the state is effective;
[0009] S4, analyze the execution result of the scheduling task, extract the execution result information and compare it with the original test case information, when the execution result is successful, the test case remains unchanged; when the execution result is failed, the information of the data resource change part in the execution log is obtained, and the data resource information of the original test case is compared, the original test case is automatically marked, and the data resource test case model is regenerated after the data resource changes.
[0010] Specifically, the data resource change includes the following cases:
[0011] The data resource table name is modified: the original test case model is offline, the original variable component is modified, the date and change information are recorded in the identification field, the original test case model becomes an invalid test case and is no longer executed, a new test case model is automatically generated according to the new table name, and the scheduling component is started to publish the new test case as an effective state;
[0012] The data resource table name is added: a new test case is automatically generated according to the table name, the table field is assigned to the component variable, a new data resource test case model is formed, and the scheduling component is started to publish the new test case as an effective state;
[0013] The data resource table name is deleted: the original test case model is automatically offline and marked, and the test case becomes an invalid test case and is no longer automatically executed;
[0014] The data resource table field is modified: the original test case model is offline, the original field is changed to new field information, the date and change information are recorded in the identification field, and the scheduling component is started to publish the new test case as an effective state;
[0015] The data resource field is added: the original use case model is offline, the target table adds a field according to the meta model, the identification field records the date and change information, and the scheduling component starts to publish the new test case to the effective state.
[0016] The data resource field is deleted: the original use case model is offline, the target table deletes a field according to the meta model, the identification field records the date and change information, and the scheduling component starts to publish the new test case to the effective state.
[0017] Further, the method for generating the test case suite name of the data resource in the S1 step includes naming the main suite name in the name of the data resource A to the data resource N, and the lower layer of the main suite name successively contains the following hierarchical sub-suite names: ODS data resource paste source layer, DWD standard layer cleaning and conversion, DWS data resource summary layer, and test case suite name of the generated data resource.
[0018] The method for generating the test case model name of different layers of the data resource in the S1 step includes using SQL statements to obtain the table names of the data resource A to the data resource N, placing them in a small model, and naming the test case model of the data resource as ODS_table name 1_data resource A, ODS_table name 1_data resource N, DWD_table name 1_data resource A, and DWD_table name 1_data resource N.
[0019] Further, the method for completing reading the data resource and processing to writing the data resource for each test case in the S2 step includes:
[0020] Using SQL statements to obtain the field name of the data resource, completing variable assignment of the field name, inserting an operation time field on the corresponding metadata of the target database (i.e., the data resource center) which is consistent with the data resource structure, judging whether it is a partition table, if it is a non-partition table, then converting the non-partition table into a partition table, if it is a partition table, then reading the data resource library after successfully processing the partition table, selecting the meta model, selecting the entity table resource name, selecting the field to be processed, completing the reading operation of the data resource, selecting the target table to which the data resource is written, selecting the meta model and the target table name to be copied, selecting the column to be written, selecting the number of concurrent operations, and completing the writing operation of the data resource.
[0021] Further, the method for configuring the meta data collection task of the data resource in the S1 step includes:
[0022] Adding a collection task of the data resource from different databases, running the collection task to obtain the meta data of the data resource, and changing the collected meta data to a published state.
[0023] Further, the method of the S1 step of copying the metadata of the data resource in the target database comprises:
[0024] The metadata of one or more data resources is selected for copying or batch copying, and the metadata consistent with the structure of the data resource is generated in the target database for subsequent data resource exchange.
[0025] Further, the method of the S4 step of analyzing the execution result of the scheduling task comprises:
[0026] The data resource test case model is automatically executed according to the scheduling setting time, and the date and execution success or failure identification information are marked in the data resource target table.
[0027] Further, the method of the S3 step of publishing the test case with successful test execution as the data resource test case model comprises:
[0028] According to the execution log information analysis, each test case is marked as a valid data resource test case after successful execution, and one or more marked valid data resource test cases are selected and published as a data resource test case model.
[0029] The application also provides a model-based data resource automatic test system for executing the model-based data resource automatic test method as described above, comprising:
[0030] The data resource test case model name generation module is used for accessing the database corresponding to the data resource, accessing the target database where the data resource needs to be stored, configuring the metadata collection task of the data resource, copying the metadata of the data resource in the target database, generating the test case suite name of the data resource, and generating the test case model name of different levels of the data resource;
[0031] The data resource test case generation module is used for configuring the scheduling task from the collection task in different databases, selecting the running period and running validity period according to the iteration frequency of the data resource, setting the failure task to run again, publishing the metadata collection task in the scheduling list after the scheduling task configuration is completed, and the state is effective; each test case completes reading the data resource, and processes and handles to write the data resource; the test case is used to perform the test;
[0032] The data resource test case model generation module is configured to mark the test case of successful test execution as a data resource test case model, including: according to the execution log information analysis, each test case is marked as a valid data resource test case after successful execution; one or more test cases marked as valid are selected and released as a data resource test case model; a data resource test case model scheduling task is configured, the data resource test case model is selected, a running period and a running validity period are selected, a failure task is set to be re-run, and after the task configuration is completed, the data resource test case model is released in the scheduling list, and the state is effective;
[0033] The data resource test case model automatic maintenance module is configured to analyze the execution result of the scheduling task, extract the execution result information and compare the original test case information, when the execution result is successful, the test case is kept unchanged; when the execution result is failed, the information of the data resource change part in the execution log is obtained, and the original test case data resource information is compared, the original test case is automatically marked, and the data resource test case model is regenerated after the data resource changes.
[0034] The model-based data resource automatic test method and system provided by the application have a closed-loop process of automatically obtaining data resource development test data, cover data resource connection, test suite and test case generation, test case forms a case model, model task triggers scheduling execution, execution result analysis, case automatic maintenance, and have good timeliness; according to the data resource change subdivision scene, the data resource automatic test is more targeted, and the test result is more accurate; in the automatic maintenance test case stage, a model formed by a plurality of components is used, the process and result of case maintenance are more scientific, and the quantitative result can be intuitively compared with peers; the model-based data resource automatic test method is executed through a computer program in the whole process, realizes full automation, effectively improves the sustainability and reusability of data resource automatic test, can replace manual case writing and common script execution mode, and reduces enterprise cost.
[0035] The application further provides a computer readable storage medium, which stores a computer program, and the program is executed by a processor to realize the steps of the model-based data resource automatic test method.
[0036] The application further provides a computer device, which comprises a memory, a processor and a computer program stored on the memory and executable on the processor, and the processor realizes the steps of the model-based data resource automatic test method when executing the program.
[0037] Compared with the prior art, the application has the advantages that:
[0038] The model-based data resource automatic test method and system provided by the application can automatically identify data resource changes, continuously automatically test, make up and optimize the technical blank in the field of data resource development test, automatically maintain data resource test case models, and be applicable to different data resource dynamic change scenes, update iteration or discard the original case model according to the result analysis, generate a new test case model, and save the execution result labels before and after the data resource test case changes, so that the user can trace the data resource, and the data resource development efficiency is improved. BRIEF DESCRIPTION OF DRAWINGS
[0039] Various other advantages and benefits will become apparent to those of ordinary skill in the art upon reading the following detailed description of the preferred embodiments. The accompanying drawings are included to provide a description of the preferred embodiments and are not intended to limit the scope of the application.
[0040] In the drawings:
[0041] Figure 1 is a basic flow diagram of the model-based data resource automatic test of the embodiment of the application;
[0042] Figure 2 is a simple diagram of the data resource test case model of the embodiment of the application;
[0043] Figure 3 is a data resource metadata change, component automatic update and automatic maintenance of the data resource test case model diagram of the embodiment of the application;
[0044] Figure 4 is a model-based data resource automatic test method flowchart of the application;
[0045] Figure 5 is a schematic diagram of the computer device of the embodiment of the application. DETAILED DESCRIPTION
[0046] The exemplary embodiments will be described in detail herein with reference to the attached drawings. The following description is with reference to the drawings, in which like numerals refer to like elements throughout. The embodiments of the disclosure described herein are not meant to be all inclusive or to be the only embodiments that implement the disclosure. Rather, they are merely examples of apparatus and product that are consistent with some aspects of the disclosure as detailed in the appended claims.
[0047] The terminology used in the disclosure is for the purpose of describing particular embodiments only and is not intended to be limiting of the disclosure. As used in this disclosure and the appended claims, the singular forms "a," "an" and "the" are intended to include the plural forms as well, unless the context clearly indicates otherwise. It will also be understood that the term "and / or" as used herein refers to and encompasses any and all possible combinations of one or more of the associated listed items.
[0048] It is to be understood that, although the terms first, second, third, etc. can be used herein to describe various information, these terms are not intended to denote a particular order or hierarchy. These terms are used only to distinguish one from another. For example, a first information can be termed a second information, and, similarly, a second information can be termed a first information, without departing from the scope of the present disclosure. Depending on the context, the word "if' as used herein can be interpreted to mean "when" or "in response to determining" or "in response to a determination".
[0049] The embodiments of the present application are further described below.
[0050] The embodiments of the present application provide a model-based data resource automatic testing method, referring to Figure 4 as shown, comprising the following steps:
[0051] S1, access the database corresponding to the data resource; access the target database (i.e. data resource center) where the data resource needs to be stored; configure the metadata collection task of the data resource, copy the metadata of the data resource in the target database; generate the test case suite name of the data resource, generate the test case model name of different levels of the data resource;
[0052] The method for generating the test case suite name of the data resource includes: naming the main suite name in the name of data resource A to data resource N, and the lower layer of the main suite name successively contains the following level of sub-suite name: ODS data resource paste source layer, DWD standard layer cleaning conversion, DWS data resource summary layer, test case suite name of the data resource generated;
[0053] The method for generating the test case model name of different levels of the data resource includes: using SQL statements to obtain the table name of data resource A to data resource N, placing them in a small model, and naming the test case model of the data resource as ODS_table name 1_data resource A, ODS_table name 1_data resource N, DWD_table name 1_data resource A, DWD_table name 1_data resource N, respectively.
[0054] The method for configuring the metadata collection task of the data resource includes:
[0055] The method comprises the following steps: adding a collection task of a data resource from different databases, running the collection task to obtain metadata of the data resource, and changing the collected metadata into a publishing state.
[0056] The method for copying metadata of a data resource in a target database comprises the following steps:
[0057] The method comprises the following steps: selecting metadata of one or more data resources for copying or batch copying, generating metadata consistent with the structure of the data resource in a target database, and using the metadata for subsequent data resource exchange. Figure 2
[0058] S2, configure a scheduling task of the collection task from different databases, select a running period (minute, hour, day, week, month) according to a data resource iteration frequency, set a failure task re-run, and publish the metadata collection task in a scheduling list in a state of having taken effect after the scheduling task configuration is completed; read data resources of each test case, and process and write the data resources; and use the test case to perform testing.
[0059] The method for reading data resources of each test case and processing and writing the data resources comprises the following steps:
[0060] The method comprises the following steps: obtaining a field name of a data resource by using an SQL statement, completing variable assignment of the field name, inserting an operation time field on metadata corresponding to the data resource structure in a target database (a data resource center), judging whether the table is a partition table, converting a non-partition table into a partition table if the table is not a partition table, reading a data resource library after successfully processing the partition table if the table is a partition table, selecting a meta model, selecting an entity table resource name, selecting a field to be processed, completing reading of the data resource, selecting a target table to which data is to be written, selecting a meta model and a target table name to be copied, selecting a column to be written, selecting a number of concurrent operations, and completing writing of the data resource.
[0061] S3, publish and mark test cases successfully tested as a data resource test case model, which comprises the following steps: selecting one or more test cases identified as valid, and publishing the test cases as the data resource test case model; configuring a scheduling task of the data resource test case model, selecting the data resource test case model, selecting a running period (minute, hour, day, week, month) and a running valid period, setting a failure task re-run, and publishing the data resource test case model in a scheduling list in a state of having taken effect after the task configuration is completed.
[0062] The method for publishing and marking test cases successfully tested as a data resource test case model comprises the following steps:
[0063] According to the execution log information analysis, each test case is marked as a valid data resource test case after successful execution; one or more marked valid data resource test cases are selected and released as a data resource test case model.
[0064] S4, analyze the execution result of the scheduling task, extract the execution result information and compare it with the original test case information, when the execution result is successful, the test case remains unchanged; when the execution result is failure, the information of the data resource change part in the execution log is obtained and compared with the data resource information of the original test case, the original test case is automatically marked, and the data resource test case model is regenerated after the data resource changes, as shown in Figure 3 .
[0065] The method for analyzing the execution result of the scheduling task comprises:
[0066] The data resource test case model is automatically executed according to the scheduling setting time, and the date and execution success or failure identification information are marked in the data resource target table.
[0067] The data resource change includes the following cases:
[0068] The data resource table name is modified: the original test case model is offline, the original variable component is modified, the date and change information are recorded in the identification field, the original test case model becomes invalid and is no longer executed, and a new test case model is automatically generated according to the new table name, and the scheduling component is started to release the new test case as valid;
[0069] The data resource table name is added: a new test case is automatically generated according to the table name, the table field is assigned to the component variable, a new data resource test case model is formed, and the scheduling component is started to release the new test case as valid;
[0070] The data resource table name is deleted: the original test case model is automatically offline and marked, and the test case becomes invalid and is no longer automatically executed;
[0071] The data resource table field is modified: the original test case model is offline, the original field is changed to new field information, the date and change information are recorded in the identification field, and the scheduling component is started to release the new test case as valid;
[0072] The data resource field is added: the original test case model is offline, the target table adds a new field according to the meta model, the date and change information are recorded in the identification field, and the scheduling component is started to release the new test case as valid;
[0073] Data resource field has deletion: original use case model offline, target table deletes field according to meta model, identification field records date and change information, and scheduling component starts to publish new test case as effective state.
[0074] Figure 1 The basic flow of the model-based data resource automatic test of the embodiment is shown.
[0075] The embodiment of the application further provides a model-based data resource automatic test system for executing the model-based data resource automatic test method as described above, comprising:
[0076] The data resource test case model name generation module is configured to access the database corresponding to the data resource, access the target database in which the data resource is stored, configure the metadata collection task of the data resource, copy the metadata of the data resource in the target database, generate the test case suite name of the data resource, and generate the test case model name of different levels of the data resource.
[0077] The data resource test case generation module is configured to configure the scheduling task from the collection task in different databases, select the running period and the running effective period according to the iteration frequency of the data resource, set the failure task to run again, publish the metadata collection task in the scheduling list after the scheduling task configuration is completed, and set the state as effective; read the data resource for each test case, and process and write the data resource; and use the test case to perform the test.
[0078] The data resource test case model generation module is configured to publish the test case that is successfully executed as the data resource test case model, comprising: according to the execution log information analysis, each test case is marked as an effective data resource test case after successful execution; one or more test cases are selected and published as the data resource test case model; the data resource test case model scheduling task is configured, the data resource test case model is selected, the running period and the running effective period are selected, the failure task is set to run again, and the data resource test case model is published in the scheduling list after the task configuration is completed, and the state is set as effective.
[0079] The data resource test case model automatic maintenance module is configured to analyze the execution result of the scheduling task, extract the execution result information and compare it with the original test case information, when the execution result is successful, the test case remains unchanged; when the execution result is failure, the information of the changed part of the data resource in the execution log is obtained, and the data resource information of the original test case is compared, the original test case is automatically marked, and the data resource test case model is regenerated after the data resource is changed.
[0080] The model-based data resource automatic test method and system of the embodiment can automatically identify continuous automatic test after data resource changes, make up and optimize the technical blank in the field of data resource development test, automatically maintain the data resource test case model, and be applicable to different data resource dynamic change scenes, update iteration or discard the original use case model according to the result analysis, generate a new test case model, and save the execution result labels before and after the data resource test case changes, so as to facilitate the user to trace the data resource.
[0081] The embodiment of the present application also provides a computer device, Figure 5 is a structural schematic diagram of a computer device provided by the embodiment of the present application; as shown in the figure Figure 5 The computer device includes an input system 23, an output system 24, a memory 22 and a processor 21; the memory 22 is used for storing one or more programs; when the one or more programs are executed by the one or more processors 21, the one or more processors 21 implement the model-based data resource automatic test method provided by the above embodiment; wherein the input system 23, the output system 24, the memory 22 and the processor 21 can be connected through a bus or other means, Figure 5 For example, the bus connection in the embodiment.
[0082] The memory 22 is a readable and writable storage medium of a computing device, which can be used for storing software programs, computer executable programs, such as program instructions of the model-based data resource automatic test method provided by the embodiment of the present application; the memory 22 can mainly include a program storage area and a data storage area, wherein the program storage area can store an operating system and at least one application program required by a function; the data storage area can store data created according to the use of the device and the like; in addition, the memory 22 can include a high-speed random access memory, and can also include a non-volatile memory, such as at least one magnetic disk storage device, a flash memory device or other non-volatile solid-state storage device; in some examples, the memory 22 can further include a memory remotely arranged relative to the processor 21, and these remote memories can be connected to the device through a network. Examples of the above network include but are not limited to the Internet, an intranet, a local area network, a mobile communication network and a combination thereof.
[0083] The input system 23 can be used to receive input digital or character information, and generate key signal input related to the user settings and function control of the device; the output system 24 can include a display device such as a display screen.
[0084] The processor 21 performs various function applications and data processing of the device by running software programs, instructions and modules stored in the memory 22, i.e. implements the model-based data resource automatic test method described above.
[0085] The computer device provided above can be used to execute the model-based data resource automatic test method provided in the above-described embodiments, and has corresponding functions and advantages.
[0086] The embodiments of the present application also provide a storage medium containing computer executable instructions, which, when executed by a computer processor, are used to execute the model-based data resource automatic test method provided in the above-described embodiments. The storage medium is any various types of memory device or storage device, and the storage medium includes: installation media such as CD-ROM, floppy disk or tape system; computer system memory or random access memory such as DRAM, DDR RAM, SRAM, EDO RAM, Rambus RAM, etc.; non-volatile memory such as flash memory, magnetic media (e.g. hard disk or optical storage); register or other similar types of memory elements, etc.; the storage medium can also include other types of memory or combinations thereof; in addition, the storage medium can be located in the first computer system in which the program is executed, or can be located in a different second computer system, which is connected to the first computer system through a network (such as the Internet); the second computer system can provide program instructions to the first computer for execution. The storage medium includes two or more storage media that can reside in different locations (e.g. in different computer systems connected through a network). The storage medium can store program instructions (e.g. specifically implemented as a computer program) executable by one or more processors.
[0087] Of course, the storage medium containing computer executable instructions provided by the embodiments of the present application is not limited to the model-based data resource automatic test method described in the above embodiments, and can also execute related operations in the model-based data resource automatic test method provided by any embodiments of the present application.
[0088] So far, the technical solutions of the present application have been described in combination with preferred embodiments, but those skilled in the art can easily understand that the protection scope of the present application is obviously not limited to these specific embodiments. Those skilled in the art can make equivalent changes or replacements to related technical features without departing from the principles of the present application, and the technical solutions after the changes or replacements will fall within the protection scope of the present application.
[0089] The above merely illustrates the preferred embodiments of the present application, and is not used to limit the present application; for those skilled in the art, the present application can have various modifications and changes. Any modification, equivalent replacement, improvement, etc. within the spirit and principle of the present application shall be included in the protection scope of the present application.
Claims
1. A model-based data resource automated testing method, characterized in that, The method comprises the following steps: S1, accessing a database corresponding to a data resource; S1, accessing a target database where the data resource is to be stored; configuring a metadata collection task of the data resource, copying metadata of the data resource in the target database; generating a test case suite name of the data resource, and generating test case model names of different levels of the data resource; S2, configuring a scheduling task for collection tasks from different databases, selecting a running period and a running validity period according to a data resource iteration frequency, setting a failed task to be run again, and publishing the metadata collection task in a scheduling list after the scheduling task configuration is completed, with a state of being effective; reading data resources of each test case and processing and writing the data resources; S3, publishing test cases that are successfully executed in the test as data resource test case models, comprising: according to execution log information analysis, marking each test case as an effective data resource test case after successful execution; selecting one or more test cases marked as effective and publishing them as data resource test case models; configuring a data resource test case model scheduling task, selecting a data resource test case model, selecting a running period and a running validity period, setting a failed task to be run again, and publishing the data resource test case model in the scheduling list after the task configuration is completed, with a state of being effective; S4, analyzing execution results of the scheduling task, extracting execution result information and comparing it with original test case information, when the execution result is successful, keeping the test case unchanged; when the execution result is failed, obtaining information of a changed part of the data resource in the execution log and comparing it with data resource information of the original test case, automatically marking the test case, and regenerating a data resource test case model after the data resource is changed. The method for generating the test case suite name of the data resource in the S1 step comprises: naming a main suite name in the manner of data resource A to data resource N, and the lower level of the main suite name comprises the following level of sub-suite names: ODS data resource sticking source layer, DWD standard layer cleaning and conversion, DWS data resource summary layer, and the test case suite name of the data resource; 2. The model-based data resource automated testing method of claim 1, wherein, The method for generating the test case model name of the data resource in the S1 step comprises: obtaining table names of data resource A to data resource N by using SQL statements, placing them in a small model, and naming the test case model of the data resource as ODS_table name 1_data resource A, ODS_table name 1_data resource N, DWD_table name 1_data resource A, and DWD_table name 1_data resource N. The method for reading the data resources of each test case and processing and writing the data resources in the S2 step comprises:
3. The model-based data resource automated testing method of claim 1, wherein, The SQL statement is used to obtain the field name of the data resource, and variable assignment of the field name is completed; an operation time field is inserted on the metadata corresponding to the target database and consistent with the data resource structure; it is judged whether it is a partition table, if it is a non-partition table, the non-partition table is converted into a partition table; if it is a partition table, the data resource library is read after the partition table is processed successfully, the meta model is selected, the entity table resource name is selected, the field to be processed is selected, and the operation of reading the data resource is completed; the target table corresponding to the data resource to which the data resource is written is selected, the meta model and the target table name to be copied are selected, the column to be written is selected, the number of concurrent is selected, and the operation of writing the data resource is completed.
4. The model-based data resource automated testing method of claim 1, wherein, The method for collecting the metadata of the configuration data resource in the S1 step comprises: Adding the collection task of the data resource from different databases, running the collection task to obtain the metadata of the data resource, and changing the collected metadata into a publishing state.
5. The model-based data resource automated testing method of claim 1, wherein, The method for copying the metadata of the data resource in the target database in the S1 step comprises: Selecting the metadata of one or more data resources for copying or batch copying, and generating the metadata consistent with the structure of the data resource in the target database.
6. The model-based data resource automated testing method of claim 1, wherein, The method for analyzing the execution result of the scheduling task in the S4 step comprises: The data resource test case model is automatically executed according to the scheduling setting time, and the date and execution success or failure identification information are marked in the data resource target table.
7. A model-based data resource automated testing system, characterized by, The model-based data resource automatic test method according to any one of claims 1-6 is executed, comprising: The data resource test case model name generation module is used for accessing the database corresponding to the data resource, accessing the target database where the data resource needs to be stored, configuring the metadata collection task of the data resource, copying the metadata of the data resource in the target database, and generating the test case suite name of the data resource and the test case model name of different levels of the data resource; The data resource test case generation module is used for configuring the scheduling task from the collection task in different databases, selecting the running period and the running validity period according to the iteration frequency of the data resource, setting the failure task to run again, publishing the metadata collection task in the scheduling list after the scheduling task configuration is completed, and the state is effective; each test case is completed to read the data resource and processed to write the data resource; the test case is used to execute the test; The data resource test case model generation module is used for publishing the test case that is successfully executed as a data resource test case model, comprising: according to the execution log information analysis, each test case is marked as a valid data resource test case after successful execution; one or more test cases are selected and marked as valid test cases, and are published as data resource test case models; the data resource test case model scheduling task is configured, the data resource test case model is selected, the running period and the running validity period are selected, the failure task is set to run again, and the data resource test case model is published in the scheduling list after the task configuration is completed, and the state is effective; The data resource test case model automatic maintenance module is used for analyzing the execution result of the scheduling task, extracting the execution result information and comparing the original test case information, keeping the test case unchanged when the execution result is successful, obtaining the information of the data resource change part in the execution log when the execution result is failed, comparing the data resource information of the original test case, automatically marking the original test case, and regenerating the data resource test case model after the data resource changes.
8. A computer-readable storage medium having stored thereon a computer program, characterized in that, The program is executed by the processor to implement the steps of the model-based data resource automatic test method in any one of claims 1-6.
9. A computer device comprising a memory, a processor, and a computer program stored on the memory and executable on the processor, characterized in that, The processor executes the program to implement the steps of the model-based data resource automatic test method in any one of claims 1-6.
Citation Information
Patent Citations
Data warehouse test method, device and equipment
CN115203024A
Regression testing method, device and equipment based on SDK (Software Development Kit) and medium
CN119127691A