Data testing method, device, electronic device, storage medium, and program

By classifying and enumerating the input and output data types of operators, the problem of low efficiency in data flow functional syntax testing in the existing technology is solved, automated testing is achieved, and testing efficiency and accuracy are improved.

CN114880237BActive Publication Date: 2025-10-10BEIJING BAIDU NETCOM SCI & TECH CO LTD
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202210582173.3
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2022-05-26
Publication Date
2025-10-10
Estimated Expiration
2042-05-26

AI Technical Summary

Technical Problem

The data flow-based functional syntax testing in existing technologies is difficult to effectively cover the correctness of the execution process, logical correctness and exception handling, resulting in difficulty in verifying the overall correctness and validity of the syntax and potential vulnerabilities.

Method used

By obtaining the input and output data types of operators, classifying and enumerating connections, we can implement automated testing of operators, reduce invalid connections, and improve testing efficiency.

Benefits of technology

It realizes the automated coverage testing of the operator's execution process correctness, logical correctness and exception handling, improves the testing efficiency and reduces labor costs.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN114880237B_ABST
    Figure CN114880237B_ABST
Patent Text Reader

Abstract

The present disclosure provides a data testing method and device, electronic equipment and storage medium, relates to the field of artificial intelligence, further relates to the field of computer deep learning, and aims to at least solve the technical problem of low data testing efficiency in the prior art. The specific implementation scheme is: obtaining a plurality of operators and a plurality of operators corresponding to a first data type and a second data type, wherein the first data type is used to represent the input data type of the plurality of operators, and the second data type is used to represent the output data type of the plurality of operators; classifying the plurality of operators based on the first data type and the second data type respectively to obtain a classification result; performing enumeration connection on the plurality of operators based on the classification result to obtain a connection result; and testing the plurality of operators based on the connection result to obtain a test result, wherein the test result is used to indicate whether an abnormality occurs in the execution process of the plurality of operators.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present disclosure relates to the field of artificial intelligence technology, specifically to the field of computer deep learning, and more particularly to a data testing method, device, electronic device, storage medium, and program. Background Art

[0002] Syntax testing is a necessary means to verify the correctness of the grammar execution process, logical correctness, and exception handling. The higher the degree of automation of the test method, the greater the help in reducing the labor cost of testing and improving the efficiency of grammar testing. The characteristic of functional grammar testing based on data flow in the existing technology is that each grammar function is abstracted into a corresponding grammar operator. Each grammar operator receives the result of the upstream operator as input, executes its own logic, and generates an output to the downstream. The data flows between the operators in sequence to form a data flow. In this case, it is difficult to conduct effective coverage testing for the correctness of the grammar execution process, logical correctness, and exception handling, resulting in difficulty in fully verifying the correctness and effectiveness of the grammar as a whole, which lays a hidden danger for potential loopholes in the grammar. Summary of the Invention

[0003] The present disclosure provides a data testing method to at least solve the technical problem of low data testing efficiency in the prior art.

[0004] According to one aspect of the present disclosure, a data testing method is provided, including: obtaining multiple operators and first data types and second data types corresponding to the multiple operators, wherein the first data type is used to represent the input data type of the multiple operators, and the second data type is used to represent the output data type of the multiple operators; classifying the multiple operators based on the first data type and the second data type, respectively, to obtain classification results; enumerating and connecting the multiple operators based on the classification results to obtain a connection result, wherein the connection result is used to characterize that the second data type of the first operator is the same as the first data type of the second operator in the two connected operators; testing the multiple operators based on the connection result to obtain a test result, wherein the test result is used to indicate whether an abnormality occurs in the execution process of the multiple operators.

[0005] According to another aspect of the present disclosure, a data testing device is provided, including: an acquisition module for acquiring multiple operators and a first data type and a second data type corresponding to the multiple operators; a classification module for classifying the multiple operators based on the first data type and the second data type, respectively, to obtain a classification result; a connection module for enumerating and connecting the multiple operators based on the classification result, to obtain a connection result, wherein the connection result is used to characterize that the second data type of the first operator is the same as the first data type of the second operator in the two connected operators; a testing module for testing the multiple operators based on the connection result, to obtain a test result, wherein the test result is used to indicate whether an abnormality occurs in the execution process of the multiple operators.

[0006] According to another aspect of the present disclosure, an electronic device is provided, comprising: at least one processor; and a memory communicatively connected to the at least one processor; wherein the memory stores instructions executable by the at least one processor, and the instructions are executed by the at least one processor to enable the at least one processor to execute the data testing method proposed in the present disclosure.

[0007] According to another aspect of the present disclosure, a non-transitory computer-readable storage medium storing computer instructions is provided, wherein the computer instructions are used to enable a computer to execute the data testing method proposed in the present disclosure.

[0008] According to another aspect of the present disclosure, a computer program product is provided, including a computer program. When a processor executes the data testing method proposed in the present disclosure, the computer program executes the data testing method proposed in the present disclosure.

[0009] In the present disclosure, a plurality of operators and first and second data types corresponding to the plurality of operators are first obtained, wherein the first data type is used to represent the input data type of the plurality of operators, and the second data type is used to represent the output data type of the plurality of operators; the plurality of operators are then classified based on the first and second data types to obtain classification results; the plurality of operators are enumerated and connected based on the classification results to obtain connection results, wherein the connection results are used to characterize that the second data type of the first operator is the same as the first data type of the second operator in the two connected operators; and finally, the plurality of operators are tested based on the connection results to obtain test results, wherein the test results are used to indicate whether an abnormality occurs in the execution process of the plurality of operators. Thus, the performance of the operators is tested. It is easy to imagine that the operators are first classified and then enumerated and connected, which can make the enumeration connection more targeted, thereby reducing invalid connections and improving test efficiency, thereby solving the technical problem of low data testing efficiency in the prior art.

[0010] It should be appreciated that the description set forth herein does not in any way intend to limit or otherwise inhibit the scope of the embodiments of the present disclosure. Other features of the present disclosure will become apparent from the following description. BRIEF DESCRIPTION OF DRAWINGS

[0011] The accompanying drawings are used to better understand the present scheme and do not limit the present disclosure. Among them:

[0012] Figure 1 is a hardware structure block diagram of a computer terminal (or mobile device) for implementing a data testing method according to an embodiment of the present disclosure;

[0013] Figure 2 is a data testing method flowchart provided according to an embodiment of the present disclosure;

[0014] Figure 3 is an operator input source schematic diagram provided according to an embodiment of the present disclosure;

[0015] Figure 4 is an operator overall execution schematic diagram provided according to an embodiment of the present disclosure;

[0016] Figure 5 is a data testing device schematic diagram provided according to an embodiment of the present disclosure. DETAILED DESCRIPTION

[0017] Exemplary embodiments of the present disclosure are described below with reference to the accompanying drawings, which include various details of the embodiments of the present disclosure to assist in understanding, and should be considered as merely exemplary. Therefore, those of ordinary skill in the art should recognize that various changes and modifications can be made to the embodiments described herein without departing from the scope and spirit of the present disclosure. Also, in order to be clear and concise, descriptions of well-known functions and structures are omitted in the following description.

[0018] It should be noted that the terms "first", "second", and the like in the specification and claims of the present disclosure and the above-described drawings are used to distinguish similar objects, and do not necessarily describe a specific order or sequence. It should be understood that the data used in this way can be interchanged under appropriate circumstances, so that the embodiments of the present disclosure described herein can be implemented in an order other than those illustrated or described herein. In addition, the terms "include" and "have" and any variations thereof are intended to cover non-exclusive inclusion, for example, a process, method, system, product or device that includes a series of steps or units does not necessarily limit to those steps or units clearly listed, but can include other steps or units not clearly listed or inherent to these processes, methods, products or devices.

[0019] At present, the data testing methods in the prior art are mainly divided into the following two categories:

[0020] Solution 1, cumulative testing:

[0021] Accumulate retrieval requirements and test the accumulated requirements.

[0022] The sources of accumulation mainly include the following two aspects: subjective ideas and search requirements proposed by customers; and previously reported search errors.

[0023] Solution 2, brute force enumeration operator combination test:

[0024] We artificially select some commonly used operators, combine them within a given syntax length limit, and brute force enumerate each combination for testing.

[0025] There are some problems in the relevant technologies, which are as follows:

[0026] Solution 1 relies solely on conjecture and accumulated customer needs. The number of search scenarios is small and growing slowly, making it difficult to effectively cover the grammar, resulting in low grammar coverage. Furthermore, because the primary test event is based on existing search requests, it is impossible to proactively test and identify potential issues in search requests that have not yet appeared, thus failing to discover potential vulnerabilities in the grammar.

[0027] Solution 2 relies solely on experience and conjecture to select a few commonly used grammatical operators for the full set of enumeration. The selection and rejection of operators lack a valid theoretical basis, resulting in a lack of valid basis for the selection of the full set of operators. Operators that were not selected may also be used in some search scenarios, which would not be covered in the test. This creates a hidden danger of potential vulnerabilities in the grammar. Furthermore, the enumerated combinations in this solution contain a large number of invalid grammatical combinations, most of which require manual removal, a labor-intensive process.

[0028] In light of this, this paper proposes a semi-automated testing method for dataflow-based functional grammars. This method requires only a small amount of manual intervention at the beginning of testing to achieve automated coverage testing of grammar execution correctness, logical correctness, and exception handling.

[0029] According to an embodiment of the present disclosure, a data testing method is provided. It should be noted that the steps shown in the flowchart of the accompanying drawings can be executed in a computer system such as a set of computer executable instructions, and although a logical order is shown in the flowchart, in some cases, the steps shown or described can be executed in an order different from that shown here.

[0030] The method embodiments provided in the embodiments of the present disclosure can be executed in a mobile terminal, a computer terminal or a similar electronic device. The electronic device is intended to represent various forms of digital computers, such as laptop computers, desktop computers, workstations, personal digital assistants, servers, blade servers, mainframe computers, and other suitable computers. The electronic device can also represent various forms of mobile devices, such as personal digital processing, cellular phones, smart phones, wearable devices and other similar computing devices. The components shown herein, their connections and relationships, and their functions are merely examples and are not intended to limit the implementation of the present disclosure described and / or required herein. Figure 1 The present invention shows a hardware structure block diagram of a computer terminal (or mobile device) for implementing a data testing method.

[0031] like Figure 1 As shown, the computer terminal 100 includes a computing unit 101, which can perform various appropriate actions and processes according to a computer program stored in a read-only memory (ROM) 102 or a computer program loaded from a storage unit 108 into a random access memory (RAM) 103. Various programs and data required for the operation of the computer terminal 100 can also be stored in the RAM 103. The computing unit 101, the ROM 102, and the RAM 103 are connected to each other via a bus 104. An input / output (I / O) interface 105 is also connected to the bus 104.

[0032] Multiple components in the computer terminal 100 are connected to the I / O interface 105, including an input unit 106, such as a keyboard, a mouse, etc.; an output unit 107, such as various types of displays, speakers, etc.; a storage unit 108, such as a magnetic disk, an optical disk, etc.; and a communication unit 109, such as a network card, a modem, a wireless communication transceiver, etc. The communication unit 109 allows the computer terminal 100 to exchange information / data with other devices via a computer network such as the Internet and / or various telecommunication networks.

[0033] The computing unit 101 can be a variety of general and / or special processing components with processing and computing capabilities. Some examples of the computing unit 101 include, but are not limited to, a central processing unit (CPU), a graphics processing unit (GPU), various dedicated artificial intelligence (AI) computing chips, various computing units that run machine learning model algorithms, digital signal processors (DSPs), and any appropriate processors, controllers, microcontrollers, etc. The computing unit 101 performs the data testing method described herein. For example, in some embodiments, the data testing method can be implemented as a computer software program that is tangibly contained in a machine-readable medium, such as a storage unit 108. In some embodiments, part or all of the computer program can be loaded and / or installed on the computer terminal 100 via the ROM 102 and / or the communication unit 109. When the computer program is loaded into the RAM 103 and executed by the computing unit 101, one or more steps of the data testing method described herein can be performed. Alternatively, in other embodiments, the computing unit 101 can be configured to perform the data testing method by any other appropriate means (e.g., by means of firmware).

[0034] Various embodiments of the systems and techniques described herein can be implemented in digital electronic circuit systems, integrated circuit systems, field programmable gate arrays (FPGAs), application specific integrated circuits (ASICs), application specific standard products (ASSPs), system-on-chip systems (SOCs), complex programmable logic devices (CPLDs), computer hardware, firmware, software, and / or combinations thereof. These various embodiments can include being implemented in one or more computer programs that are executable and / or interpreted on a programmable system that includes at least one programmable processor, which can be a special purpose or general purpose programmable processor that can receive data and instructions from a storage system, at least one input device, and at least one output device, and transmit data and instructions to the storage system, the at least one input device, and the at least one output device.

[0035] It should be noted that, in some optional embodiments, the above Figure 1 The electronic device shown may include hardware elements (including circuits), software elements (including computer code stored on a computer-readable medium), or a combination of hardware elements and software elements. Figure 1 This is merely one example of a particular embodiment and is intended to illustrate the types of components that may be present in the electronic device described above.

[0036] Under the above operating environment, the present disclosure provides the following Figure 2 The data testing method shown in Figure 1 The computer terminal or similar electronic device shown is used for execution. Figure 2 is a data test method flowchart provided by an embodiment of the disclosure. As shown in the figure, the method can include the following steps: Figure 2

[0037] In step S20, a plurality of operators and first data types and second data types corresponding to the plurality of operators are obtained, wherein the first data types are used to represent input data types of the plurality of operators, and the second data types are used to represent output data types of the plurality of operators.

[0038] The above operator can be a mapping relationship, which can map a function into a function or a number. Alternatively, the operator can be a syntax operator, which can abstract each syntax function of a data flow-based functional syntax into a corresponding syntax operator. Each syntax operator receives the result of an upstream operator as input, executes its own logic, and generates an output to a downstream. Wherein, data can flow between operators in sequence to form a data flow.

[0039] The plurality of operators described above can be a plurality of syntax operators in a syntax model. The plurality of operators described above can also be a plurality of search operators in a search model. It should be noted that the plurality of operators in the present application can be a plurality of operators included in a model in any scenario.

[0040] The first data type described above can be all input data types that the entire test system can support. Alternatively, the input data types can include parameter types, character types, formula types, and numerical types.

[0041] The parameter type can include constant parameters, such as the operator sum(1, 2) that performs the operation of "1+2" and outputs the sum. The 1 and 2 in the operator are parameters of the operator, and both 1 and 2 are numerical constants, thereby determining the parameter type. Alternatively, for some nested operators, the parameter type can be determined according to the operator execution result. For example, in a query language of a graph database (also known as BGremlin language), the shortest path operator between two points is used as an example, which is in the form of shortestPath(g.v(′Euler′), g.v(′Gauss′)). The operator searches for the shortest relationship path from Euler to Gauss, wherein the source node (Euler) and the target node (Gauss) are generated by the execution result of other operators.

[0042] The second data type described above can be all output data types that the entire test system can support. Alternatively, the output data types can include character types, formula types, and numerical types.

[0043] Figure 3 is a schematic diagram of an operator input source provided by an embodiment of the disclosure, as shown in the figure, Figure 3 ​As shown, the input data type of the operator can be determined by the data stream or parameters, wherein the data stream can be generated by the execution result of the upstream operator, wherein the parameters can be determined by the execution result of the upstream operator and constants.

[0044] Figure 4 is a schematic diagram of an overall execution of an operator provided according to an embodiment of the present disclosure, such as Figure 4 As shown, the input type of the operator can be determined by the data flow and parameters. Further, after the input data type of the operator is determined, the operator will flow into the data flow with the same input data type.

[0045] In an optional embodiment, the user can input the operator to be tested and provide the first and second data types of the operator. Optionally, the system can also retrieve the operator from the operator library and determine the first and second data types of the operator. After obtaining multiple operators and the first and second data types corresponding to the operators, the system can execute the test process for the operators. In other words, only a small amount of manual intervention is required at the beginning of the test to achieve automated coverage testing of the correctness of the grammatical execution process, logical correctness, and exception handling.

[0046] Step S21 , classifying multiple operators based on the first data type and the second data type respectively to obtain classification results.

[0047] In an optional embodiment, operators can be classified according to their first data type and second data type. Optionally, operators with the same first data type can be classified into one category to form a set, and operators with the same second data type can be classified into another category to form another set. Optionally, if there are multiple first data types, a set can be formed according to each different type, that is, multiple different sets can be generated. Similarly, if there are multiple second data types, multiple different sets can also be formed. Among them, the sets can all be finite sets. In addition to the elements of the conventional data types, there is also a special element in the set, which can be denoted as t0. In which, t0 does not represent any data type and is used to correspond to the situation where the operator has no relevant input or output. This type of element can be used as the initial operator when enumerating and connecting in the subsequent process, that is, an operator that is executed without relying on the results of other operators, and can also be called a boundary operator. Optionally, t0 may exist in both the first set and the second set. The set formed by t0 can be denoted as T, and the set formed by the valid outputs of other operators can be denoted as T O .

[0048] Where T = {t|t is all data types supported by the retrieval system or no type}, This completes the classification of multiple operators.

[0049] By the above steps, the plurality of operators are classified according to the first data type and the second data type, and in the case of completing the classification, the connection can be enumerated based on the classification result, wherein the connection can be enumerated for connecting the operators of the same type, and it is easy to think that the operators are classified before the connection is enumerated, thereby avoiding invalid connection caused by different types, and further improving the test efficiency.

[0050] In step S22, the plurality of operators are connected based on the classification result, and a connection result is obtained, wherein the connection result is used to represent that the second data type of the first operator in the two connected operators is the same as the first data type of the second operator.

[0051] The above first operator and the second operator can be two operators used for enumerated connection.

[0052] The above enumerated connection can be an effective connection of the operators of the same type, that is, the second data type of the first operator of the two connected operators is the same as the first data type of the second operator of the two connected operators.

[0053] In an optional embodiment, the operators can be classified according to the first data type and the second data type, and the operators of each type are independently stored, and the data stream input type and the output data type of each type of operator are marked, and then the operator type satisfying the boundary condition can be selected from the set T, wherein the boundary operator can be an operator that does not depend on the results of other operators, and this type of operator can be used as the initial operator of the operator enumerated connection, and the rule of the operator effective connection, that is, the second data type and the first data type of the operator are the same, is used for the syntax of the enumerated connection, wherein the enumerated connection is covered, that is, each execution statement contains.

[0054] For any length of the statement, the boundary operator can be used as the start, and the operator whose second data type and first data type are the same is connected, and the input and output data types of the operator classification are matched and connected, wherein the matching connection can be matching the same type of operators according to the operator type. The matched operators of each type can be sequentially enumerated according to the input and output types, that is, the enumeration of all effective search conditions of the fixed-length statement, so as to obtain a data set, which can be used for testing the operators. A large number of repeated matching and enumeration in the process of matching and enumerated connection can be automatically completed by the program script.

[0055] In step S23, the plurality of operators are tested based on the connection result, and a test result is obtained, wherein the test result is used to represent whether the execution process of the plurality of operators is abnormal.

[0056] The above test can be used to detect whether the operator is normally available during execution.

[0057] In an optional embodiment, a test dataset obtained through enumeration and concatenation can be obtained. Based on the concatenation results, multiple operators can be tested using the test dataset to obtain test results. The test results can be used to indicate whether the operators are functioning properly during execution. Alternatively, for grammatical operators, testing is intended to identify important methods that guarantee correctness during execution, logical correctness, and the ability to handle exceptions.

[0058] According to the above steps S20 to S23 of the present disclosure, first, a plurality of operators and the first data type and the second data type corresponding to the plurality of operators are obtained, wherein the first data type is used to represent the input data type of the plurality of operators, and the second data type is used to represent the output data type of the plurality of operators; then, the plurality of operators are classified based on the first data type and the second data type respectively to obtain classification results; based on the classification results, the plurality of operators are enumerated and connected to obtain a connection result, wherein the connection result is used to characterize that the second data type of the first operator is the same as the first data type of the second operator in the two operators after connection; finally, the plurality of operators are tested based on the connection result to obtain a test result, wherein the test result is used to indicate whether an abnormality occurs in the execution process of the plurality of operators. Thus, the performance of the operators is tested. It is easy to imagine that the operators are classified first and then enumerated and connected, which can make the enumeration connection more targeted, thereby reducing invalid connections and improving test efficiency, thereby solving the technical problem of low data testing efficiency in the prior art.

[0059] Optionally, multiple operators are enumerated and connected based on the classification result to obtain a connection result, including: determining at least one first data set and at least one second data set based on the classification result, wherein the first data type of the operators contained in each first data set is the same, and the second data type of the operators contained in each second data set is the same; matching at least one first data set and at least one second data set to determine a first target data set and a second target data set, wherein the first data type of the operators contained in the first target data set is the same as the second data type of the operators contained in the second target data set; enumerating and connecting multiple operators based on the first target data set and the second target data set to obtain a connection result.

[0060] The first data set may be a set formed by classifying operators of the same first data type into one category. Optionally, the first data set may be denoted as T.

[0061] The second data set may be a set formed by classifying operators of the same second data type into one category. Optionally, the second data set may be denoted as T O .

[0062] The first target data set may be a set selected from the first data set to be matched with the second target data set in the second data set.

[0063] The second target data set may be a set in the second data set to be matched with the first target data set. Optionally, the input data type of the operator in the second target data set is the same as the output data type of the operator in the first target data set.

[0064] In an optional embodiment, after classification is completed, at least one first data set can be determined based on operators with the same first data type, and at least one second data set can be determined based on operators with the same second data type. Optionally, a first target data set can be determined from the first data set, and a second target data set can be determined from the second data set, and the first target data set can be matched with the operators in the second target data set. Furthermore, after a successful match, multiple operators in the first target data set and the second target data set can be enumerated and connected.

[0065] In another optional embodiment, when the first data type of the operator is determined based on the current data stream, the set of its types can be determined as T IF ,in The complete set at this time is T O Instead of T, the data in the data stream can be generated by the execution results of the operator, so the full set at this time is T O , and the subset relation can be used to indicate that the second data type of an existing operator cannot be used as the first data type of any operator. This case generally occurs in the termination operator.

[0066] In another optional embodiment, when the first data type of the operator is determined based on parameters, the parameters of the operator can be divided into two cases. One is a constant parameter, which can include a string constant, a numeric constant, a Boolean constant, etc. Optionally, the set of constant parameter types can be recorded as T C ,but The data type of the parameter consisting of the operator execution result satisfies The set of data types of a single operator parameter can be represented as T SP =T C ∪T A , it should be noted that in the set T SPFor types that look very similar, such as "string constant" and "string" type, they belong to T C Collection and T A A collection actually represents different types, which are also different elements in the type set T.

[0067] Considering the uncertainty of the number of operator parameters and the fact that the order of parameters is not entirely negligible, the set of operator parameter data types satisfies

[0068]

[0069] Where n represents the number of operator parameters. Optionally, when n = 0, the element is an empty tuple, which can be used to indicate that the operator has no parameter input, that is, the boundary operator t0. When the number of parameters is finite, T IP It is also a finite set.

[0070] Through the above steps, the operators are classified to generate different sets, completing the effective division of the operators, facilitating more targeted enumeration and connection of the operators in the future, and further improving the accuracy of the operator test.

[0071] Optionally, classifying the multiple operators based on the first data type and the second data type respectively to obtain classification results includes: obtaining the classification result based on the Cartesian product of the first data type and the second data type.

[0072] The above-mentioned first data type includes a first parameter type and / or a data stream input type.

[0073] In an optional embodiment, a classification result can be obtained based on the Cartesian product of the parameter type, the data stream input type, and the second data type, thereby reducing the computational resources required for subsequent matching. In another optional embodiment, a classification result can be obtained based on the Cartesian product of the parameter type, the second data type, thereby reducing the computational resources required for subsequent matching. In yet another optional embodiment, a classification result can be obtained based on the Cartesian product of the data stream input type and the second data type, thereby improving the accuracy of subsequent matching.

[0074] In another optional embodiment, after analyzing the first data type and the second data type, the Cartesian product of the operator parameter type set, the data stream input type set, and the output data type set can be further classified according to their parameter type, received data type, and output data type, and mapped to an element in C, that is, C = P × T IF ×T O , thus completing an effective partition of all operators.

[0075] Through this step, before enumerating and connecting operators, operators can be matched first to select the set of operators required by the user, and then enumerate and connect them. This standardizes the enumeration and connection operation process, making the operation steps more regular and effective, and further improving the enumeration and connection efficiency.

[0076] Optionally, enumerating and connecting multiple operators based on the first target data set and the second target data set to obtain a connection result includes: determining a target operator among the multiple operators based on the first data type, wherein the input data of the target operator does not depend on the output data of other operators among the multiple operators; enumerating and connecting multiple operators based on the first target data set, the second target data set and the target operator to obtain a connection result.

[0077] The above-mentioned target operator can be a boundary operator, that is, the boundary of the operator connection, an operator that can be executed without relying on the results of other operators, and can be used as the initial element of the operator enumeration. Optionally, the output data type of the boundary operator can be the same as the input type of the operator in the first target data set.

[0078] In an optional embodiment, before performing the enumeration connection, the boundary operator, that is, the above-mentioned target operator, can be determined first, and then multiple operators whose input data types and output data types match each other in the first target data set and the second target data set are determined, so as to perform enumeration connection on the multiple operators and obtain the connection result.

[0079] Through the above steps, a set of unified rules can be established to effectively enumerate and connect operators of any length, thereby simplifying the operation process of enumeration and connection and further improving the efficiency of operator enumeration and connection.

[0080] Optionally, multiple operators are enumerated and connected based on the first target data set and the second target data set to obtain a connection result, including: mapping multiple operators based on the first target data set and the second target data set to obtain a mapping relationship among the multiple operators; enumerating and connecting multiple operators based on the mapping relationship to obtain a connection result, wherein the mapping relationship is used to indicate whether the connection relationship between the operators is a valid connection relationship.

[0081] In an optional embodiment, multiple operators can be mapped based on the first target data set and the second target data set, so as to map the multiple operators into a mapping set according to the data input type and the data output type, wherein the mapping set contains mapping relationships between multiple operators, and the multiple operators can be effectively connected according to the mapping relationships between the multiple operators in the mapping set to avoid connecting operators with non-corresponding input and output types, thereby improving the connection accuracy between operators, thereby reducing useless connections, and improving the efficiency of the connection between operators.

[0082] In another optional embodiment, a mapping f can be established for the elements in the set C, where f|C→C′(C′=T IF ×T O ), that is, any operator can be mapped to an element in C′ according to its first data type and second data type.

[0083] For any two elements c1 and c2 in C′, where c1= <t i1 ,t o1 >,c2= <t i2 ,t o2 >, satisfied

[0084] Under this operation rule, the connection of any two connectable operators can be mapped to In the set composed of. Among them, That is, it can continue to operate with itself, and the result of the operation of C' with itself is still C'. That is, for any n connectable operators, they can be mapped to C′ n So far, a unified set of rules can be used to perform effective enumeration and connection of operators of any length.

[0085] Optionally, testing the multiple operators based on the connection result to obtain the test result includes: acquiring a test data set; and testing the multiple operators using the test data set based on the connection result to obtain the test result.

[0086] The above tests can be used to test the performance of operators and whether they are safe and available when executing functions.

[0087] The above test data set may be a set of operators that need to be tested.

[0088] In an optional embodiment, after obtaining the operators, the operators are first classified according to the first data type and the second data type, thereby generating a first data set and a second data set. Based on the classification results, the operators are then enumerated and connected to obtain a connection result. Finally, the operators are tested based on the connection result to obtain an operator with safe and usable performance. Based on the above operations, the operational process of operator testing can be greatly simplified, thereby improving testing efficiency.

[0089] Optionally, the method also includes: obtaining a preset operator and a third data type and a fourth data type corresponding to the preset operator, wherein the preset operator is a newly added operator, the third data type is used to represent the input data type of the preset operator, and the fourth data type is used to represent the output data type of the preset operator; connecting the preset operator based on the third data type, the fourth data type and the connection result to obtain a target connection result; testing multiple operators and the preset operator based on the target connection result to obtain a target test result, wherein the target test result is used to indicate whether there is an abnormality in the execution process of the multiple operators and the preset operator.

[0090] The third data type mentioned above can be used to represent the input data type of the newly added operator. Optionally, the input data type can include parameter type, character type, formula type, number type, etc.

[0091] The fourth data type mentioned above can be used to represent the output data type of the newly added operator. Optionally, the output data type may include a character type, a formula type, a numeric type, and the like.

[0092] In an optional embodiment, for newly added operators, it is only necessary to classify them into one category according to the third data type and the fourth data type, and then the coverage test of the newly added syntax can be implemented according to the established process.

[0093] In another optional embodiment, any operator can be mapped to the set C=P×T according to its data flow input data type and output data type. IF ×T O Therefore, for T IF Quantity, If T IF If the component is a data type supported by the retrieval system, the T IF The component is the result of executing another operator, so T IF The components generate a recursive description. At the same time, T IF The bounds of the component should be untyped, i.e. the input data type of the operator is different from the current data stream.

[0094] For the P component, based on It can be determined that the component boundaries can be divided into two cases, n equals 0 and n is not equal to 0. When n is equal to 0, that is, the operator has no parameter input, and no recursive description of the operator parameters will be generated. When n is not equal to 0, it is necessary to examine the set T SP , by T SP =T C ∪T A It can be obtained that when a component t of the type tuple in the P component i It's from T A When the type component comes from T C When the operator is set, it can be determined that the parameter at that position comes from a constant, and no recursive description will be generated. Based on the two cases mentioned above, it can be determined that the boundary of the P component should be either no parameter input or constant parameter input. In other words, the boundary conditions of the operator connection should be that the input data type of the operator is different from the current data stream and there is no parameter input, or the input data of the operator only has constant parameters.

[0095] Through the above steps, newly added operators only need to be classified first, and then the operator can be tested using the established operations. In other words, only a small amount of manual intervention is required in the initial operator classification, screening of boundary operators, and parameter setting to achieve automated operator testing, reducing labor costs while improving testing efficiency.

[0096] Optionally, the first data type is used to represent the input data type of multiple operators, and the second data type is used to represent the output data type of multiple operators.

[0097] Optionally, the input data of the target operator is a constant parameter, or the target operator has no input data.

[0098] The present disclosure also provides a data testing device for implementing the above-mentioned embodiments and preferred embodiments. Details already described will not be repeated. As used below, the term "module" may refer to a combination of software and / or hardware that implements a predetermined function. Although the devices described in the following embodiments are preferably implemented in software, implementation using hardware, or a combination of software and hardware, is also possible and contemplated.

[0099] Figure 5 Schematic diagram of a data testing device provided according to an embodiment of the present disclosure. Figure 5 As shown, a data testing device includes: an acquisition module, a classification module, a connection module, and a testing module.

[0100] An acquisition module 501 is configured to acquire a plurality of operators and first and second data types corresponding to the plurality of operators;

[0101] A classification module 502, configured to classify the plurality of operators based on the first data type and the second data type, respectively, to obtain classification results;

[0102] a connection module 503, configured to enumerate and connect the multiple operators based on the classification result to obtain a connection result, wherein the connection result is used to indicate that the second data type of the first operator is the same as the first data type of the second operator in the two connected operators;

[0103] The testing module 504 is used to test the multiple operators based on the connection results to obtain test results, wherein the test results are used to indicate whether an abnormality occurs in the execution process of the multiple operators.

[0104] Optionally, the connection module includes: a determination unit for determining at least one first data set and at least one second data set based on the classification results, wherein the first data type of the operators contained in each first data set is the same, and the second data type of the operators contained in each second data set is the same; a matching unit for matching at least one first data set and at least one second data set to determine a first target data set and a second target data set, wherein the first data type of the operators contained in the first target data set is the same as the second data type of the operators contained in the second target data set; a connection unit for enumerating and connecting multiple operators based on the first target data set and the second target data set to obtain a connection result.

[0105] Optionally, the connection unit includes: a determination subunit, used to determine a target operator among multiple operators based on a first data type, wherein the input data of the target operator does not depend on the output data of other operators among the multiple operators; a connection subunit, used to enumerate and connect multiple operators based on the first target data set, the second target data set and the target operator to obtain a connection result.

[0106] Optionally, the classification module includes: a classification subunit, configured to obtain a classification result based on a Cartesian product of the first data type and the second data type.

[0107] Optionally, the test module includes: an acquisition unit for acquiring a test data set; and a testing unit for testing multiple operators using the test data set based on the connection result to obtain a test result.

[0108] It should be noted that the above modules can be implemented through software or hardware. For the latter, it can be implemented in the following ways, but not limited to: the above modules are all located in the same processor; or the above modules are located in different processors in any combination.

[0109] According to an embodiment of the present disclosure, the present disclosure further provides an electronic device comprising a memory and at least one processor, the memory storing computer instructions, and the processor being configured to execute the computer instructions to perform the steps in any of the above method embodiments.

[0110] Optionally, the electronic device described above can further comprise a transmission device connected with the processor and an input and output device connected with the processor.

[0111] Optionally, in the present disclosure, the processor can be configured to perform the following steps by means of a computer program:

[0112] S1, obtaining a plurality of operators and first data types and second data types corresponding to the plurality of operators, wherein the first data types are used to represent input data types of the plurality of operators, and the second data types are used to represent output data types of the plurality of operators.

[0113] S2, classifying the plurality of operators based on the first data types and the second data types respectively to obtain a classification result.

[0114] S3, performing enumeration connection on the plurality of operators based on the classification result to obtain a connection result, wherein the connection result is used to represent that the second data type of a first operator in the two connected operators is the same as the first data type of a second operator.

[0115] S4, testing the plurality of operators based on the connection result to obtain a test result, wherein the test result is used to represent whether an abnormality occurs in an execution process of the plurality of operators.

[0116] Optionally, specific examples in the present embodiment can refer to the examples described in the above embodiments and optional implementation manners, and the present embodiment will not be described here again.

[0117] According to an embodiment of the present disclosure, the present disclosure further provides a non-transitory computer readable storage medium storing computer instructions, wherein the computer instructions are configured to execute the steps in any of the above method embodiments when executed.

[0118] Optionally, in the present embodiment, the non-volatile storage medium described above can be configured to store a computer program for executing the following steps:

[0119] S1, obtaining a plurality of operators and first data types and second data types corresponding to the plurality of operators, wherein the first data types are used to represent input data types of the plurality of operators, and the second data types are used to represent output data types of the plurality of operators.

[0120] S2, classifying the multiple operators based on the first data type and the second data type respectively to obtain classification results.

[0121] S3. Enumerate and connect multiple operators based on the classification result to obtain a connection result, wherein the connection result is used to represent that the second data type of the first operator is the same as the first data type of the second operator in the two connected operators.

[0122] S4: Testing the multiple operators based on the connection results to obtain test results, where the test results are used to indicate whether an abnormality occurs in the execution process of the multiple operators.

[0123] Alternatively, in this embodiment, the non-transitory computer-readable storage medium may include, but is not limited to, electronic, magnetic, optical, electromagnetic, infrared, or semiconductor systems, devices, or any suitable combination of the above. More specific examples of readable storage media include electrical connections based on one or more wires, portable computer disks, hard disks, random access memories (RAM), read-only memories (ROM), erasable programmable read-only memories (EPROM or flash memory), optical fibers, portable compact disk read-only memories (CD-ROMs), optical storage devices, magnetic storage devices, or any suitable combination of the above.

[0124] According to an embodiment of the present disclosure, the present disclosure also provides a computer program product. The program code for implementing the method embodiment of the present disclosure can be written in any combination of one or more programming languages. These program codes can be provided to a processor or controller of a general-purpose computer, a special-purpose computer, or other programmable data processing device, so that when the program code is executed by the processor or controller, the functions / operations specified in the flow chart and / or block diagram are implemented. The program code can be executed entirely on the machine, partially on the machine, as a stand-alone software package, partially on the machine and partially on a remote machine, or entirely on a remote machine or server.

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

[0126] Through the description of the above embodiments, those skilled in the art can clearly understand that the method according to the above embodiment can be implemented by means of software plus the necessary general hardware platform, or of course by hardware, but in many cases the former is a better implementation method. Based on this understanding, the technical solution of the present disclosure, or the part that contributes to the prior art, can be embodied in the form of a software product, which is stored in a storage medium and includes a number of instructions for enabling a terminal device (which can be a mobile phone, computer, server, or network device, etc.) to execute the methods described in each embodiment of the present disclosure.

[0127] In the above embodiments of the present disclosure, the description of each embodiment has its own focus. For parts that are not described in detail in a certain embodiment, reference can be made to the relevant descriptions of other embodiments.

[0128] In the several embodiments provided in the present disclosure, it should be understood that the disclosed technical content can be implemented in other ways. Among them, the device embodiments described above are only exemplary. For example, the division of the units can be a logical function division. In actual implementation, there may be other division methods, such as multiple units or components can be combined or integrated into another system, or some features can be ignored or not executed. Another point is that the mutual coupling or direct coupling or communication connection shown or discussed can be through some interfaces, indirect coupling or communication connection of units or modules, which can be electrical or other forms.

[0129] The units described as separate components may or may not be physically separate, and the components shown as units may or may not be physical units, that is, they may be located in one place or distributed across multiple units. Some or all of the units may be selected according to actual needs to achieve the purpose of the present embodiment.

[0130] In addition, the functional units in the various embodiments of the present disclosure may be integrated into a single processing unit, or each unit may exist physically separately, or two or more units may be integrated into a single unit. The aforementioned integrated units may be implemented in the form of hardware or software functional units.

[0131] If the integrated unit is implemented in the form of a software functional unit and sold or used as an independent product, it can be stored in a computer-readable storage medium. Based on this understanding, the technical solution of the present disclosure is essentially or the part that contributes to the prior art or all or part of the technical solution can be embodied in the form of a software product, and the computer software product is stored in a storage medium, including a number of instructions for enabling a computer device (which can be a personal computer, a server or a network device, etc.) to perform all or part of the steps of the method described in each embodiment of the present disclosure. The aforementioned storage medium includes: various media that can store program codes, such as a U disk, a read-only memory (ROM), a random access memory (RAM), a mobile hard disk, a magnetic disk or an optical disk.

[0132] The above is only a preferred embodiment of the present disclosure. It should be pointed out that for ordinary technicians in this technical field, several improvements and modifications can be made without departing from the principles of the present disclosure. These improvements and modifications should also be regarded as within the scope of protection of the present disclosure.

Claims

1. A data testing method, comprising: Acquire multiple operators and first data types and second data types corresponding to the multiple operators, wherein the first data type is used to represent the input data type of the multiple operators, the second data type is used to represent the output data type of the multiple operators, and the first data type includes a parameter type and / or a data stream type; Classifying the multiple operators based on the first data type and the second data type respectively to obtain classification results; and enumerating and connecting the multiple operators based on the classification results to obtain a connection result, wherein the connection result is used to indicate that the second data type of the first operator and the first data type of the second operator are the same in the two connected operators; The multiple operators are tested based on the connection result to obtain a test result, wherein the test result is used to indicate whether an abnormality occurs in the execution process of the multiple operators.

2. The method according to claim 1, wherein The plurality of operators are enumerated and connected based on the classification result to obtain a connection result, including: Determining at least one first data set and at least one second data set based on the classification result, wherein the first data type of the operators included in each first data set is the same, and the second data type of the operators included in each second data set is the same; matching the at least one first data set and the at least one second data set to determine a first target data set and a second target data set, wherein the first data type of the operators included in the first target data set is the same as the second data type of the operators included in the second target data set; The plurality of operators are enumerated and connected based on the first target data set and the second target data set to obtain the connection result.

3. The method according to claim 2, wherein: Enumerating and connecting the multiple operators based on the first target data set and the second target data set to obtain the connection result includes: Mapping the multiple operators based on the first target data set and the second target data set to obtain a mapping relationship between the multiple operators; The plurality of operators are enumerated and connected based on the mapping relationship to obtain the connection result, wherein the mapping relationship is used to indicate whether the connection relationship between the operators is a valid connection relationship.

4. The method according to claim 2, wherein: Enumerating and connecting the multiple operators based on the first target data set and the second target data set to obtain the connection result includes: determining a target operator among the multiple operators based on the first data type, wherein input data of the target operator does not depend on output data of other operators among the multiple operators; The plurality of operators are enumerated and connected based on the first target data set, the second target data set, and the target operator to obtain the connection result.

5. The method according to claim 1, wherein Classifying the multiple operators based on the first data type and the second data type respectively to obtain classification results includes: The classification result is obtained based on a Cartesian product of the first data type and the second data type.

6. The method according to claim 1, wherein The plurality of operators are tested based on the connection result to obtain test results, including: Get the test dataset; The multiple operators are tested using the test data set based on the connection result to obtain the test result.

7. The method according to claim 1, wherein The method further comprises: Obtain a preset operator and a third data type and a fourth data type corresponding to the preset operator, wherein the preset operator is a newly added operator, the third data type is used to represent the input data type of the preset operator, and the fourth data type is used to represent the output data type of the preset operator; Connecting the preset operator based on the third data type, the fourth data type and the connection result to obtain a target connection result; The multiple operators and the preset operator are tested based on the target connection result to obtain a target test result, wherein the target test result is used to indicate whether an abnormality occurs in the execution process of the multiple operators and the preset operator.

8. The method according to claim 4, wherein The input data of the target operator is a constant parameter, or the target operator does not have the input data.

9. A data testing device comprising: an acquisition module, configured to acquire a plurality of operators and first data types and second data types corresponding to the plurality of operators, wherein the first data type is used to represent the input data type of the plurality of operators, the second data type is used to represent the output data type of the plurality of operators, and the first data type includes a parameter type and / or a data stream type; a classification module, configured to classify the plurality of operators based on the first data type and the second data type respectively to obtain classification results; a connection module, configured to enumerate and connect the plurality of operators based on the classification result to obtain a connection result, wherein the connection result is used to indicate that the second data type of the first operator is the same as the first data type of the second operator in the two connected operators; A testing module is used to test the multiple operators based on the connection result to obtain a test result, wherein the test result is used to indicate whether an abnormality occurs in the execution process of the multiple operators.

10. The device according to claim 9, wherein Connection module, including: a determining unit, configured to determine, based on the classification result, at least one first data set and at least one second data set, wherein the first data type of the operators included in each first data set is the same, and the second data type of the operators included in each second data set is the same; a matching unit, configured to match the at least one first data set and the at least one second data set to determine a first target data set and a second target data set, wherein the first data type of the operators included in the first target data set is the same as the second data type of the operators included in the second target data set; A connection unit is configured to perform enumeration connection on the multiple operators based on the first target data set and the second target data set to obtain the connection result.

11. The device according to claim 10, wherein Connecting unit, comprising: a mapping subunit, configured to map the multiple operators based on the first target data set and the second target data set to obtain a mapping relationship among the multiple operators; The connection subunit is used to enumerate and connect the multiple operators based on the mapping relationship to obtain the connection result, wherein the mapping relationship is used to indicate whether the connection relationship between the operators is a valid connection relationship.

12. The device according to claim 10, wherein Connecting unit, comprising: a determining subunit, configured to determine a target operator among the multiple operators based on the first data type, wherein input data of the target operator does not depend on output data of other operators among the multiple operators; A connection subunit is configured to perform enumeration connection on the multiple operators based on the first target data set, the second target data set, and the target operator to obtain the connection result.

13. The device according to claim 9, wherein Classification modules, including: The classification subunit is configured to obtain the classification result based on the Cartesian product of the first data type and the second data type.

14. The apparatus according to claim 9, wherein the testing module comprises: An acquisition unit, used to acquire a test data set; A testing unit is configured to test the plurality of operators using the test data set based on the connection result to obtain the test result.

15. An electronic device comprising: at least one processor; as well as a memory communicatively connected to the at least one processor; wherein, The memory stores instructions that can be executed by the at least one processor, and the instructions are executed by the at least one processor to enable the at least one processor to perform the method according to any one of claims 1 to 8.

16. A non-transitory computer-readable storage medium storing computer instructions, wherein: The computer instructions are used to cause the computer to execute the method according to any one of claims 1-8.

17. A computer program product comprising a computer program, which, when executed by a processor, implements the method according to any one of claims 1 to 8.

Citation Information

Patent Citations

  • Method for automatically generating testing case on basis of function block diagram testing module

    CN104991863A

  • Automatic test case generation method and system based on scene method

    CN110597730A