Unit testing components of the data flow graph
The data processing system isolates and tests components of dataflow graphs using emulated data, addressing the challenge of testing in non-production environments and ensuring efficient error identification and correction in data processing applications.
Patent Information
- Application Number
- JP2022535176
- Authority / Receiving Office
- JP · JP
- Patent Type
- Patents
- Current Assignee / Owner
- Priority Date
- 2020-05-27
- Filing Date
- 2020-12-16
- Publication Date
- 2025-09-24
- Estimated Expiration
- 2040-12-16
AI Technical Summary
Developers face challenges in testing data processing applications outside a production environment, where realistic data is unavailable, making it difficult to ensure correct operation with real data, and identifying errors in dataflow graphs is cumbersome due to the complexity of testing entire applications.
A data processing system isolates portions of a dataflow graph for unit testing, using emulated realistic input data to test individual components, allowing for precise error identification and correction without requiring the entire application to be tested.
Enables rapid and focused testing of dataflow graph components, ensuring proper functionality and facilitating error correction by providing detailed feedback and automated reporting, thus enhancing the reliability of data processing systems.
Smart Images

Figure 0007743403000001 
Figure 0007743403000002 
Figure 0007743403000003
Abstract
Description
[Technical Field]
[0001] (Priority Claim) This application claims priority to U.S. Provisional Patent Application No. 62 / 952,631, filed December 23, 2019, and U.S. Patent Application No. 16 / 884,138, filed May 27, 2020, the entire contents of each of which are incorporated herein by reference.
[0002] FIELD OF THE INVENTION This document relates to testing executable code, and more particularly to unit testing components of graph-based programs that represent executable code. [Background technology]
[0003] During development of a data processing application, developers may work outside of a production environment and may not have access to production data. Realistic data can be used during development and testing of the data processing application to ensure that the data processing application will operate correctly in production with real data. Summary of the Invention
[0004] The data processing system described herein is configured to test executable code of a computer program, such as a dataflow graph. More specifically, the data processing system is configured to configure a unit test of at least one executable component of the dataflow graph. The component of the dataflow graph includes executable code for performing at least one operation. The component operates on input data received by the component to generate output data by applying the at least one operation to the received input data. The data processing system is configured to isolate at least a portion of the dataflow graph, such as an executable component or components, based on input from a user (e.g., a developer), and provide test input data as input data to the executable component or components to enable testing of just that isolated portion (i.e., only) of the dataflow graph. The test input data can replicate realistic input data for the component. The test input data is generally configured to invoke (test) one or more operations (e.g., each operation) that may be performed by the executable component to ensure that each invoked (tested) operation of the component functions as intended by the user. Output data is generated by the executable component by executing the operations on the test input data. The output data may be analyzed by a data processing system to determine whether the component operated as intended. For example, the output data of the component may be compared to expected output data that should be produced by the component in response to receiving test input data if the component is functioning as intended. Results of the analysis of the output data by the data processing system may be stored as result data of the test. The data processing system may associate the result data with a version of the dataflow graph that includes the component. The result data may include a report indicating whether the test passed or failed, test results, etc.The result data can indicate how the component is operating and, if applicable, can provide information indicating how and / or why the component failed. The result data and / or structure data can also include data that provides guidance to a user or data processing system on how to correct errors associated with the failed component, particularly errors that cause the component to fail, to ensure proper future operation of the component. Modified input data, expected output data, and / or functionality of the associated executable component may be received, and the associated executable component may be re-executed according to the modifications to generate output data, where the error may not occur during the re-execution. This provides a guided human-machine interaction process to assist the user in performing the technical task of resolving errors that occurred during data processing testing. This can ensure proper execution of the software application and proper functioning of the underlying data processing system (even when performing tests outside of an actual production environment).
[0005] A data processing system is configured to unit test the functionality of at least a portion of a data flow graph forming an application. The unit test is configured to test the functionality of at least a portion of the data flow graph independently of the functionality of the remainder of the same or other data flow graphs of the application. The unit test is configured to isolate the functional logic of the tested portion of the data flow graph. Isolating the functional logic of the tested portion of the data flow graph can ensure that any errors introduced by the tested logic can be identified and corrected. This helps a developer determine where errors occur in the data flow graph forming the application for repair of those errors or other problems that cause undesirable results.
[0006] The type of unit test being performed is called a functional test because the functionality of a portion of a dataflow graph is being tested. The portion of the dataflow graph includes one or more executable components of the dataflow graph. The data processing system configures a test of the dataflow graph based on a set of parameters. The parameters specify how the test is configured. The parameters specify the input data and the data expected to be output from the components. However, the parameters can also specify additional aspects of the test configuration. For example, the parameters can specify which components of the dataflow to test, the location of source data for input to the components, etc. The test is precisely defined by setting the values of one or more parameters. The parameter values ensure that appropriate inputs are provided to the tested component, testing the desired functionality of the component, and enabling verification that the component's output data is correct.
[0007] A data processing system is configured to facilitate testing of only a portion of a computer program (e.g., an executable component or multiple components of a dataflow graph). For example, the input data of a component is replicated for unit testing. Generally, the input data of a component can be configured to invoke all or essentially all of the operations of the executable component when received and processed by the executable component to generate output data. The input data can be configured in this manner based on profiling of source data from an external data source (typically production data used in a production environment), where profiling includes analyzing the source data and obtaining statistical data about the source data, such as statistics of values occurring in the source data. For example, one may want to test a subset of the operations of a component, and the input data can be designed to invoke each operation of the subset of operations of the component. In some implementations, the components of a dataflow graph are configured to receive data from a remote source when the dataflow graph is executed, for example, in a production environment. Rather than using data from a remote source, the components are provided with this input data to test them. To test a component in a development environment, data from a remote source is emulated (e.g., replicated in a realistic manner as described above) so that the component is tested using realistic data, and thus output data from the component represents realistic output data. The emulated input data can cause the execution of all possible test cases of the component to ensure that each operation (e.g., each logic function, logic case, rule, etc.) of the component is invoked or triggered and a corresponding output is generated. In some implementations, the emulated data covers a subset of the component's possible test cases, such as to test a particular portion of the component's logic functionality that may have errors.
[0008] In some examples, output data of a first component is provided as input data of a second component connected to the first component by a data flow in the data flow graph. The described embodiments of the present invention configure a data processing system to overcome the technical difficulties introduced by simultaneously testing an entire data flow graph or an entire application, whereby a large number of possible test cases can potentially slow down the overall testing and prevent executable code not actually related to a particular test from executing and generating output data. In such cases, when a fault is detected when analyzing the output of the data flow graph, it can be difficult to determine which portion of the data flow graph failed. The data processing system enables testing precisely those portions of the data flow graph as needed, so that errors in the data flow graph can be more easily identified and corrected.
[0009] Furthermore, when executing tests of a component, it may be determined that it is not necessary to test every possible input. For example, a particular field of input data for a given component may not be used in the execution of the component. Tests may be updated to train the tests to focus on important input data and component behavior. In some implementations, a user (e.g., a developer) may want to repeatedly test a particular portion of a component. During a debugging operation, a developer (or other user) may want to focus tests on a small portion of the dataflow graph between updates to that particular portion of the dataflow graph. It is useful for a developer to receive feedback in the form of tests as they iterate through changes to the dataflow graph.
[0010] Implementations described herein may provide one or more of the following technical advantages. For example, the techniques described herein enable rapid configuration of unit tests for at least a portion of a dataflow graph in isolation, without having to configure other portions of the dataflow graph or other connected dataflow graphs. For example, it is not necessary to ensure that upstream components are operating as desired, that network resources (which may be referred to as data sources) are online, etc. For example, the location of a component's input data can be set to a data store containing test input data without modifying the dataflow graph itself. Parameter sets can be quickly updated to change which portions of the dataflow graph are being tested, what data is being analyzed or verified, what baseline data is used for comparison, the value of verification functions, etc.
[0011] Unit testing of dataflow graphs by a data processing system has additional advantages. Unit tests are integrated with the larger system. For example, a data processing system can integrate multiple unit tests. Results of each unit test executed on a dataflow graph or at least portions of multiple dataflow graphs can be combined into a comprehensive report. The unit tests are configured to interact with other parts of the system in production to emulate a production environment for the tested logic. The data processing system can schedule unit tests on different portions of the dataflow graph. The results of each unit test are stored in a version control database along with the version of the dataflow graph that was tested. If an error is discovered (e.g., during production, after an update, etc.), the data processing system can automatically revert the deployed logic to the most recent passing version and alert a system administrator that a failure has occurred. The result data and / or structured data can include data indicating that an error occurred (and possibly what type of error occurred), the location in the tested logic where the error occurred (e.g., in which operation or graph component the error occurred), and guidance on how to correct the error.
[0012] Unit testing of data flow graphs can be used for most applications. For example, data processing systems can be used to build and / or audit graph-based software for any application. For example, the data flow graph being tested can be configured for data warehouse or data lake management, data processing logistics, web service execution, etc. Each function of these applications can be testable. While several applications are listed here, the list is not exhaustive. Thus, unit tests enable functional testing of portions of a data flow graph integrated with a larger system, and the unit tests themselves can isolate the logic being tested. Data processing systems enable repeatable tests that are immutable and can be run at any time. Data processing systems enable parameterized tests, allowing unit tests to be configured for any system (e.g., client, server, etc.) and reconfigured to other systems at any time. Thus, unit tests are portable and facilitable. Data processing systems enable automated, versioned unit tests with visible results reported to a user (e.g., continuously) to implement guided human-machine interaction to ensure proper functioning of the underlying system.
[0013] In one aspect, a process performed by a data processing system defines a unit test for a data flow graph including multiple executable components. The process includes receiving an indication of a portion of the data flow graph for testing, the portion including at least one executable component of the data flow graph. The data processing system receives a parameter set including parameters indicating expected output data produced by execution of the at least one executable component. The data processing system receives input data for the at least one executable component. The input data is generally indicated by the parameter set and configured to test functionality of the at least one executable component. The data processing system defines a unit test for the at least one executable component based on the parameter set. The unit test is configured to provide the input data to one or more inputs of the data flow graph. The unit test is configured to cause processing of the input data by the at least one executable component of the data flow graph to generate output data. The unit test is configured to generate result data indicating a correspondence between the output data and the expected output data indicated by the parameters. The unit test is configured to cause generation of structured data indicating an association between the result data, the input data, and the data flow graph.
[0014] Implementations can include any one or more of the following features.
[0015] In some implementations, the expected data includes baseline data. Generating the result data includes comparing the output data to the baseline data. In some implementations, the baseline data includes multiple data sets from different sources. In some embodiments, the expected output data includes expected results of a validation function, and generating the result data includes applying the validation function to at least a portion of the output data to generate a result and comparing the result to the expected result.
[0016] In some implementations including features of any of the foregoing or subsequent implementations, the parameter set includes at least one additional parameter indicating one of at least one location in the data flow graph for extracting output data, a location of expected output data, a location of baseline data for comparing the output data, and the value of a validation function for validating the output data.
[0017] In some implementations, the process includes receiving an indication of one or more portions of input data to ignore during execution of the unit test, and updating the parameter set based on the received indication.
[0018] In some implementations including features of any of the foregoing or subsequent implementations, at least one executable component is configured to receive source data from a source external to the dataflow graph during execution, and the input data includes values corresponding to the source data from the source external to the dataflow graph.
[0019] In certain implementations including features of any of the preceding or subsequent implementations, the process includes retrieving a portion of a lookup file that provides input values to the at least one executable component for at least one function of the at least one executable component, the lookup file being provided by a remote source, and storing the portion of the lookup file in a data storage device accessible by the at least one executable component during execution of the at least one executable component.
[0020] In some implementations including features of any of the preceding or subsequent implementations, a process includes determining that a data source for at least one executable component includes a function call. For each function input of a set of function inputs of the function call, the process includes executing the function call to obtain a set of function outputs, each function output corresponding to the function input. The process includes storing the set of function outputs of the function call in a data storage device accessible by the at least one executable component during execution of the at least one executable component.
[0021] In certain implementations that include features of any of the preceding or subsequent implementations, a process includes traversing a dataflow graph to discover at least one dataflow of the dataflow graph, and inserting a probe into the at least one dataflow to indicate a location within the dataflow graph for extracting additional result data from execution of the at least one executable component.
[0022] In some implementations, the process includes traversing the dataflow graph to find locations within the dataflow graph at which to extract output data produced by execution of at least one executable component, and inserting probes at locations within the dataflow graph to extract the output data.
[0023] In some implementations that include features of any of the foregoing or subsequent implementations, the process includes traversing the data flow graph to find locations in the data flow graph from which to extract input data for at least one executable component, and inserting probes at the locations in the data flow graph to extract the input data.
[0024] In some implementations that include features of any of the foregoing or subsequent implementations, the process includes generating a hash of the structured data that represents a version of the structured data, and storing the hash of the version of the structured data in association with a corresponding version of the dataflow graph.
[0025] In certain implementations including features of any of the foregoing or subsequent implementations, the process includes generating a user interface that displays a representation of the dataflow graph, wherein the user interface displays, for the at least one executable component, an annotation that indicates a state of the at least one executable component.
[0026] In certain implementations including features of any of the preceding or following implementations, the user interface includes a representation of a state of at least one probe inserted into the dataflow graph, and an overlay layer that shows one or more of output data, input data, and result data associated with the dataflow graph in response to execution of at least one executable component of the dataflow graph.
[0027] In some implementations that include features of any of the foregoing or subsequent implementations, the process includes generating a user interface that displays a representation of the dataflow graph, the user interface displaying locations within the representation of the dataflow graph at which the dataflow graph receives input data.
[0028] In some implementations including those of any of the foregoing or subsequent implementations, the results data includes an indication that each function of the at least one executable component generated output data that matches the baseline data. In some implementations, the results data includes an indication that at least one function of the at least one executable component generated output data that does not match the expected output data. In some implementations, the results data includes an indication that at least one function of the at least one executable component did not generate output data.
[0029] In one aspect, a data processing system defines a unit test for a data flow graph including a plurality of executable components. The data processing system includes a data storage device that stores instructions and at least one processor configured to execute the instructions stored by the data storage device. The operations include receiving an indication of a portion of the data flow graph for testing. The portion includes at least one executable component of the data flow graph. The operations include receiving a parameter set including parameters indicating expected output data produced by execution of the at least one executable component and receiving input data for the at least one executable component. The input data is indicated by the parameter set and configured to test functionality of the at least one executable component. The operations include defining a unit test for the at least one executable component based on the parameter set. The unit test is configured to provide the input data to one or more inputs of the data flow graph. The unit test is configured to cause processing of the input data by the at least one executable component of the data flow graph to generate output data. The unit test is configured to generate result data indicating a correspondence between the output data and the expected output data indicated by the parameters. The unit tests are configured to cause the generation of structured data that indicates the associations between result data, input data, and a data flow graph.
[0030] Implementations can include any one or more of the following features.
[0031] In some implementations including those of any of the preceding or subsequent implementations, the expected data includes baseline data. Generating the result data includes comparing the output data to the baseline data. In some implementations, the baseline data includes multiple data sets from different sources. In some embodiments, the expected output data includes expected results of a validation function, and generating the result data includes applying the validation function to at least a portion of the output data to generate a result and comparing the result to the expected result.
[0032] In some implementations including features of any of the foregoing or subsequent implementations, the parameter set includes at least one additional parameter indicating one of at least one location in the data flow graph for extracting output data, a location of expected output data, a location of baseline data for comparing the output data, and the value of a validation function for validating the output data.
[0033] In some implementations that include features of any of the foregoing or subsequent implementations, the operations include receiving an indication of one or more portions of input data to ignore during execution of the unit test, and updating the parameter set based on the received indication.
[0034] In some implementations including features of any of the foregoing or subsequent implementations, at least one executable component is configured to receive source data from a source external to the dataflow graph during execution, and the input data includes values corresponding to the source data from the source external to the dataflow graph.
[0035] In some implementations including features of any of the foregoing or subsequent implementations, the operations include retrieving a portion of a lookup file that provides input values to the at least one executable component for at least one function of the at least one executable component, the lookup file being provided by a remote source, and storing the portion of the lookup file in a data storage device accessible by the at least one executable component during execution of the at least one executable component.
[0036] In some implementations including features of any of the foregoing or subsequent implementations, the operations include determining that a data source of at least one executable component includes a function call. For each function input of a set of function inputs of the function call, the operations include executing the function call to obtain a set of function outputs, each function output corresponding to the function input. The operations include storing the set of function outputs of the function call in a data storage device accessible by the at least one executable component during execution of the at least one executable component.
[0037] In some implementations including features of any of the preceding or following implementations, the operations include traversing the dataflow graph to discover at least one dataflow of the dataflow graph, and inserting a probe into the at least one dataflow to indicate a location in the dataflow graph for extracting additional result data from the execution of the at least one executable component.
[0038] In some implementations including features of any of the above or following implementations, the operations include traversing the dataflow graph to find locations in the dataflow graph to extract output data produced by execution of the at least one executable component, and inserting probes at locations in the dataflow graph to extract the output data.
[0039] In some implementations that include features of any of the foregoing or subsequent implementations, the operations include traversing the dataflow graph to find locations in the dataflow graph from which to extract input data to at least one executable component, and inserting probes at locations in the dataflow graph to extract the input data.
[0040] In some implementations that include features of any of the foregoing or subsequent implementations, the operations include generating a hash of the structured data that represents a version of the structured data, and storing the hash of the version of the structured data in association with a corresponding version of the dataflow graph.
[0041] In some implementations, the operations include generating a user interface that displays a representation of the dataflow graph, the user interface displaying, for the at least one executable component, an annotation that indicates a state of the at least one executable component.
[0042] In certain implementations including features of any of the preceding or following implementations, the user interface includes a representation of a state of at least one probe inserted into the dataflow graph, and an overlay layer that shows one or more of output data, input data, and result data associated with the dataflow graph in response to execution of at least one executable component of the dataflow graph.
[0043] In some implementations including features of any of the above or subsequent implementations, the operations include generating a user interface that displays a representation of the dataflow graph, the user interface displaying locations within the representation of the dataflow graph at which the dataflow graph receives input data.
[0044] In some implementations including those of any of the foregoing or subsequent implementations, the results data includes an indication that each function of the at least one executable component generated output data that matches the baseline data. In some implementations, the results data includes an indication that at least one function of the at least one executable component generated output data that does not match the expected output data. In some implementations, the results data includes an indication that at least one function of the at least one executable component did not generate output data.
[0045] In one aspect, one or more non-transitory computer-readable media store instructions for defining a unit test for a dataflow graph including a plurality of executable components. Generally, the instructions are configured to cause at least one processor to perform operations. The operations include receiving an indication of a portion of the dataflow graph for testing, the portion including at least one executable component of the dataflow graph. The operations include receiving a parameter set including parameters indicating expected output data produced by execution of the at least one executable component, and receiving input data for the at least one executable component. The input data is indicated by the parameter set and configured to test functionality of the at least one executable component. The operations include defining a unit test for the at least one executable component based on the parameter set. The unit test is configured to provide the input data to one or more inputs of the dataflow graph. The unit test is configured to cause processing of the input data by the at least one executable component of the dataflow graph to generate output data. The unit test is configured to generate result data indicating a correspondence between the output data and the expected output data indicated by the parameters. The unit tests are configured to cause the generation of structured data that indicates the associations between result data, input data, and a data flow graph.
[0046] Implementations can include any one or more of the following features.
[0047] In some implementations including those of any of the preceding or subsequent implementations, the expected data includes baseline data. Generating the result data includes comparing the output data to the baseline data. In some implementations, the baseline data includes multiple data sets from different sources. In some embodiments, the expected output data includes expected results of a validation function, and generating the result data includes applying the validation function to at least a portion of the output data to generate a result and comparing the result to the expected result.
[0048] In some implementations including features of any of the foregoing or subsequent implementations, the parameter set includes at least one additional parameter indicating one of at least one location in the data flow graph for extracting output data, a location of expected output data, a location of baseline data for comparing the output data, and the value of a validation function for validating the output data.
[0049] In some implementations that include features of any of the foregoing or subsequent implementations, the operations include receiving an indication of one or more portions of input data to ignore during execution of the unit test, and updating the parameter set based on the received indication.
[0050] In some implementations including features of any of the foregoing or subsequent implementations, at least one executable component is configured to receive source data from a source external to the dataflow graph during execution, and the input data includes values corresponding to the source data from the source external to the dataflow graph.
[0051] In some implementations including features of any of the foregoing or subsequent implementations, the operations include retrieving a portion of a lookup file that provides input values to the at least one executable component for at least one function of the at least one executable component, the lookup file being provided by a remote source, and storing the portion of the lookup file in a data storage device accessible by the at least one executable component during execution of the at least one executable component.
[0052] In some implementations including features of any of the foregoing or subsequent implementations, the operations include determining that a data source of at least one executable component includes a function call. For each function input of a set of function inputs of the function call, the operations include executing the function call to obtain a set of function outputs, each function output corresponding to the function input. The operations include storing the set of function outputs of the function call in a data storage device accessible by the at least one executable component during execution of the at least one executable component.
[0053] In some implementations including features of any of the preceding or following implementations, the operations include traversing the dataflow graph to discover at least one dataflow of the dataflow graph, and inserting a probe into the at least one dataflow to indicate a location in the dataflow graph for extracting additional result data from the execution of the at least one executable component.
[0054] In some implementations including features of any of the above or following implementations, the operations include traversing the dataflow graph to find locations in the dataflow graph to extract output data produced by execution of the at least one executable component, and inserting probes at locations in the dataflow graph to extract the output data.
[0055] In some implementations that include features of any of the foregoing or subsequent implementations, the operations include traversing the dataflow graph to find locations in the dataflow graph from which to extract input data to at least one executable component, and inserting probes at locations in the dataflow graph to extract the input data.
[0056] In some implementations that include features of any of the foregoing or subsequent implementations, the operations include generating a hash of the structured data that represents a version of the structured data, and storing the hash of the version of the structured data in association with a corresponding version of the dataflow graph.
[0057] In some implementations including features of any of the foregoing or following implementations, the operations include generating a user interface that displays a representation of the dataflow graph, wherein the user interface displays, for the at least one executable component, an annotation that indicates a state of the at least one executable component.
[0058] In certain implementations including features of any of the preceding or following implementations, the user interface includes a representation of a state of at least one probe inserted into the dataflow graph, and an overlay layer that shows one or more of output data, input data, and result data associated with the dataflow graph in response to execution of at least one executable component of the dataflow graph.
[0059] In some implementations including features of any of the above or subsequent implementations, the operations include generating a user interface that displays a representation of the dataflow graph, the user interface displaying locations within the representation of the dataflow graph at which the dataflow graph receives input data.
[0060] In some implementations including those of any of the foregoing or subsequent implementations, the results data includes an indication that each function of the at least one executable component generated output data that matches the baseline data. In some implementations, the results data includes an indication that at least one function of the at least one executable component generated output data that does not match the expected output data. In some implementations, the results data includes an indication that at least one function of the at least one executable component did not generate output data.
[0061] In one aspect, a computing system includes means for defining a unit test for a dataflow graph including a plurality of executable components. The computing system includes means for receiving an indication of a portion of the dataflow graph for testing. The portion includes at least one executable component of the dataflow graph. The computing system includes means for receiving a parameter set including parameters indicating expected output data produced by execution of the at least one executable component, and means for receiving input data for the at least one executable component. The input data is indicated by the parameter set and configured to test functionality of the at least one executable component. The computing system includes means for defining a unit test for the at least one executable component based on the parameter set. The unit test is configured to provide the input data to one or more inputs of the dataflow graph. The unit test includes means for causing processing of the input data by the at least one executable component of the dataflow graph to generate output data. The unit test includes means for generating result data indicating a correspondence between the output data and the expected output data indicated by the parameters. The unit test includes means for causing generation of structured data indicating an association between the result data, the input data, and the dataflow graph.
[0062] Implementations can include any one or more of the following features.
[0063] In some implementations including those of any of the preceding or subsequent implementations, the expected data includes baseline data. Generating the result data includes comparing the output data to the baseline data. In some implementations, the baseline data includes multiple data sets from different sources. In some embodiments, the expected output data includes expected results of a validation function, and generating the result data includes applying the validation function to at least a portion of the output data to generate a result and comparing the result to the expected result.
[0064] In some implementations including features of any of the foregoing or subsequent implementations, the parameter set includes at least one additional parameter indicating one of at least one location in the data flow graph for extracting output data, a location of expected output data, a location of baseline data for comparing the output data, and the value of a validation function for validating the output data.
[0065] In some implementations that include features of any of the foregoing or subsequent implementations, the computing system includes means for receiving an indication of one or more portions of input data to ignore during execution of the unit test, and updating the parameter set based on the received indication.
[0066] In some implementations including features of any of the foregoing or subsequent implementations, at least one executable component is configured to receive source data from a source external to the dataflow graph during execution, and the input data includes values corresponding to the source data from the source external to the dataflow graph.
[0067] In certain implementations including features of any of the preceding or subsequent implementations, the computing system includes means for retrieving a portion of a lookup file that provides input values to the at least one executable component for at least one function of the at least one executable component, the lookup file being provided by a remote source, and means for storing the portion of the lookup file in a data storage device accessible by the at least one executable component during execution of the at least one executable component.
[0068] In some implementations including features of any of the preceding or subsequent implementations, the computing system includes means for determining that the data source for the at least one executable component includes a function call. For each function input of a set of function inputs of the function call, the computing system includes means for executing the function call to obtain a set of function outputs, each function output corresponding to the function input. The computing system includes means for storing the set of function outputs of the function call in a data storage device accessible by the at least one executable component during execution of the at least one executable component.
[0069] In certain implementations including features of any of the preceding or following implementations, a computing system includes means for traversing a dataflow graph to discover at least one dataflow of the dataflow graph, and means for inserting probes into the at least one dataflow to indicate locations within the dataflow graph for extracting additional result data from execution of the at least one executable component.
[0070] In some implementations including features of any of the preceding or following implementations, the computing system includes means for traversing the dataflow graph to discover locations within the dataflow graph at which to extract output data produced by execution of the at least one executable component. The computing system includes means for inserting probes at locations within the dataflow graph to extract the output data.
[0071] In some implementations including features of any of the foregoing or subsequent implementations, the computing system includes means for traversing the dataflow graph to discover locations within the dataflow graph from which to extract input data for at least one executable component, and means for inserting probes at locations within the dataflow graph to extract the input data.
[0072] In some implementations including features of any of the foregoing or subsequent implementations, the computing system includes means for generating a hash of the structured data representing a version of the structured data and storing the hash of the version of the structured data in association with a corresponding version of the dataflow graph.
[0073] In some implementations including features of any of the preceding or following implementations, the computing system includes means for generating a user interface that displays a representation of the dataflow graph, the user interface displaying, for the at least one executable component, an annotation that indicates a state of the at least one executable component.
[0074] In certain implementations including features of any of the preceding or following implementations, the user interface includes a representation of a state of at least one probe inserted into the dataflow graph, and an overlay layer that shows one or more of output data, input data, and result data associated with the dataflow graph in response to execution of at least one executable component of the dataflow graph.
[0075] In some implementations including features of any of the foregoing or subsequent implementations, the computing system includes means for generating a user interface that displays a representation of the dataflow graph, the user interface displaying locations within the representation of the dataflow graph at which the dataflow graph receives input data.
[0076] In some implementations including those of any of the foregoing or subsequent implementations, the results data includes an indication that each function of the at least one executable component generated output data that matches the baseline data. In some implementations, the results data includes an indication that at least one function of the at least one executable component generated output data that does not match the expected output data. In some implementations, the results data includes an indication that at least one function of the at least one executable component did not generate output data.
[0077] The details of one or more embodiments are set forth in the accompanying drawings and the description below. Other features and advantages will be apparent from the description and drawings, and from the claims. [Brief explanation of the drawings]
[0078] [Figure 1] FIG. 1 is a block diagram of an exemplary computing environment.
[0079] [Figure 2A] Here is an example of testing part of a dataflow graph. [Figure 2B] Here is an example of testing part of a dataflow graph. [Figure 2C] Here is an example of testing part of a dataflow graph.
[0080] [Figure 3A] An example of a unit test is shown below. [Figure 3B]An example of a unit test is shown below. [Figure 3C] An example of a unit test is shown below. [Figure 3D] An example of a unit test is shown below. [Figure 3E] An example of a unit test is shown below. [Figure 3F] An example of a unit test is shown below. [Figure 3G] An example of a unit test is shown below. [Figure 3H] An example of a unit test is shown below.
[0081] [Figure 4] 1 shows an example of a user interface.
[0082] [Figure 5] A flow diagram is shown.
[0083] [Figure 6] FIG. 1 is a diagram of an exemplary computing system. DETAILED DESCRIPTION OF THE INVENTION
[0084] FIG. 1 illustrates an exemplary computing environment 100 for configuring and executing unit tests of executable logic of at least a portion of a computer program, such as an executable data flow graph. The executable logic can form an application. The unit tests are configured to test the functionality of the executable logic independently of the functionality of the rest of the application's executable logic. The unit tests are configured to isolate the functional logic of the tested portion of the data flow graph. Isolating the functional logic of the tested portion of the application, such as the data flow graph, can ensure that errors introduced by the tested logic are identified and corrected without requiring testing of the entire application. The unit tests can help a user determine where errors occur in the data flow graph that forms the application.
[0085] Environment 100 includes data processing system 102. Data processing system 102 can configure and / or execute unit tests for at least a portion of a dataflow graph. In some implementations, data processing system 102 is part of a production environment or part of a development environment. A user (e.g., a developer) can configure dataflow graphs in the development environment, such as for eventual execution in the production environment. Data processing system 102 is used by the user to configure and execute tests for those dataflow graphs.
[0086] In general, data processing system 102 is configured to test executable logic (labeled as testable logic 112) contained in an executable dataflow graph. An executable dataflow graph is a type of computer program that processes data using executable components (which include or represent executable code that performs data processing functions) contained in the dataflow graph. Data processing system 102 is configured to test a set of executable components in the dataflow graph. The set of executable components may include a single component or multiple components. For the purposes of this description, if the components in the dataflow graph are configured to perform actions, the dataflow graph is described as being configured to perform those actions. Executable components (also referred to as components), as described below with reference to FIGS. 2A-2B , may include data sources for reading or providing input data, data sinks for outputting or storing data processed by the graph, and data processing components configured to process data, such as the input data or data generated by processing by another component.
[0087] Each unit test executed is represented in the snapshot database 116 as a test snapshot 120. The test snapshot 120 includes or represents data input to the unit test, data output from the unit test, and data used to define the unit test. For example, the test snapshot 120 includes test result data representing the results of the unit test. The test snapshot 120 includes test input data processed by the tested logic 112 (e.g., the tested portion of the dataflow graph) during the unit test. The test snapshot 120 includes data accessed from function calls or other data from remote sources. The test snapshot 120 includes data representing the dataflow graph logic of the tested logic 112. The test snapshot 120 includes output data representing the processed data output from the tested logic. The test snapshot 120 includes expected output data (e.g., baseline data or verification result data). In addition to test parameters and data representing the tested logic of the unit test, the test snapshot 120 is stored in the snapshot database 116 to associate versions of the test result data with corresponding versions of the input data used for that unit test. For example, a test snapshot 120 may include input data, test result data from probes, validation / baseline data, and the recording format of each of these data. This data is packaged into a test snapshot 120 (which may comprise a single file) and referenced by a pointer in the version control database 118. The data snapshot contains all the data necessary for a unit test to be executed. This allows the unit test to be run as a self-contained program on any system. As described below, the data snapshot can be version controlled so that changes to a unit test can be reverted to a previous version.For example, if no changes to the unit test are noted, a previous version of the unit test can be restored. In some implementations, test snapshot 120 is referred to as a data fingerprint of the unit test. The data in test snapshot 120 is described in more detail below.
[0088] Test snapshots 120 can be linked to previous and subsequent versions of a unit test (e.g., other test snapshots). In this manner, test snapshots 120 represent structured data. Version control database 118 links each test snapshot 120a, 120b, 120c. For example, identifiers 126a, 126b, and 126c can be linked to each other and can reference associated snapshots 120a, 120b, and 120c, respectively. The structure of test snapshots is described further below.
[0089] 2A-2B, generally, data from one or more data sources (e.g., data sources 202a-n) is manipulated and processed by components of dataflow graph 200 and sent to one or more data sinks (e.g., data sink 212). An executable dataflow graph, such as dataflow graph 200, is represented as a directed graph that includes nodes representing components, such as components 204, 206, 208, 210, and 214. Components 204, 206, 208, 210, and 214 are data processing components, each representing executable code for processing data from at least one data input or source and providing the data to at least one data sink or output. Components 204, 206, 208, 210, and 214, data sources 202a-n, and data sink 212 are connected by directed links (e.g., link 244), sometimes referred to as data flows, representing the flow of data between components 204, 206, 208, 210, and 214, originating at data sources 202a-n and terminating at data sink 212, with each link 244 representing a flow of data. Data output ports 218a-e of upstream components are connected to data input ports 216a-g of downstream components to communicate data over the data flow links. Portions of dataflow graph 200, such as selected test region 220, may represent portions that are reused for different data sources and / or different data sinks, for example. The data structures and program code used to implement the dataflow graph may be parameterized to support multiple different configurations, for example, to allow data sources and / or data sinks to be easily substituted. A system for executing such data flow graphs is described in US Pat. No. 5,966,072, entitled "EXECUTING COMPUTATIONS EXPRESSED AS GRAPHS," which is incorporated herein by reference in its entirety.
[0090] An example of graph execution will now be described. After the initial graph is created, the driver controls the execution of the graph, and therefore the process represented by the graph. When the driver executes a graph, it does so by performing the following general phases AI: In phase A, the driver repeats step B1 below as long as any one of the process vertices is enabled. The driver may omit phases C, D, and I and may intermix the operations performed in steps B, C, E, and H. In phase B, the driver prepares the graph for execution. In this phase, the driver may identify executable process vertices, select communication methods for links, and create adapter nodes. Phase C: The driver activates data links. In this phase, the driver creates specific computational structures necessary to implement the communication methods. In phase D, the driver creates any other data structures or files required by the computational board. For the extension boards mentioned above, the driver creates link files, as described below. This allows programs to access graph connectivity information at runtime. In phase E, the driver starts processes. In phase F, the driver waits for processes to terminate. This phase is complete when all processes have terminated normally or when any process has terminated abnormally. In phase G, if any process has terminated abnormally, the execution of the graph is aborted. In phase H, otherwise, all process vertices in the runnable state are transitioned to the completed state. If no process vertices were in the runnable state, cleanup phase I is executed and control is returned to the caller (e.g., the user of the driver) with an indication that execution has stalled. In phase I, the driver cleans up data links and link files, which cleans up some of the data structures created in phases C and D.
[0091] The data processing system 102 is configured to allow a user (e.g., a developer) to isolate at least a portion of the dataflow graph 200, such as a set of one or more components of the dataflow graph, e.g., a set of components within a selected test area 220, and provide test input data as input data to the set of components. The test input data, in some implementations, replicates realistic input data. The test input data is generally configured to test one or more operations (e.g., each operation) performed by each of the one or more components in the set to ensure that each test operation of each component functions as intended by the user. Output data is generated by the components performing operations on the test input data. The output data is analyzed by the data processing system 102 to determine whether the component operated as intended. For example, the output data of the component is compared to expected output data that should be generated by the component in response to receiving the test input data if the component is functioning as intended. The results of the data processing system's analysis of the output data are stored as test result data.
[0092] In some implementations, the input data can be generated by an application during testing. For example, an executable application can be included in the test definition. The application can be configured to run during the test and provide input data to a data flow that is input to the component being tested. The application is included in the test data. The input data generated by the application for processing by the component can be generated over time.
[0093] 1, data processing system 102 includes test definition module 104, data capture module 106, unit test training module 108, data validation module 110, and load data module 112. Data processing system 102 enables specification (e.g., by user device 122) of values for test parameters 124 to configure unit tests. Data processing system 250 enables execution of unit tests.
[0094] Generally, the data processing system 102 enables at least a portion of the dataflow graph 200 to be independently and iteratively tested. For example, the data processing system 102 enables iterative modification of unit tests. The data processing system 102 enables storing versions of unit tests as test snapshots 120 that can be referenced later for execution or updates. The versions of the test are stored with all parameter values, test data, component logic, etc. The test snapshots 120 can be executed on any system as self-contained programs (e.g., system calls and data references point to data included in the test snapshots 120). If a unit test is modified, such as by changing test data or parameter values, the updates can be saved to a new version of the unit test. Another updated test snapshot is generated with the changes. Each version of a test can be stored as a snapshot referenced by a link in version control storage. In some implementations, differences in test results between a first version of a unit test and a second version of the unit test can be explicitly shown (e.g., how changes to the unit test from a previous version of the unit test affected the test results).
[0095] An overview of the process for configuring and / or running a unit test is as follows: Data processing system 102 receives a computer program, such as a graph of testable logic 112 (e.g., graph 200 of FIG. 2A) or at least a portion 220 thereof. Test definition module 104 allows for the definition of test parameters 124 (e.g., via user device 122) that specify the behavior of the unit test. Once the unit test is executed, data validation module 110 determines whether the test passed, failed, or partially passed.
[0096] The unit test training module 108 enables iterative updates to the unit test in response to the validation. For example, if changes are made to the unit test, differences in the test results can be highlighted to the user. In response, the user can either accept the changes and create a new test snapshot 120, or reject the changes and revert to a previous version of the unit test.
[0097] The unit test training module 108 displays trend analysis, shows comparisons with previous versions of the unit test, allows the user to set current results as a new baseline, and so on. The data capture module 106 captures data related to the unit tests used to execute the unit tests. The data capture module 108 stores this data, such as test result data, test input data, test parameters 124, and graph parameters, as structured data (test snapshots 120) for storage in a snapshot database 116. The data capture module 106 generates pointers to the test snapshots 120 and stores the pointers in a version control database 118. The data capture module uses a load data module 114 to store and retrieve data from the databases 116, 118.
[0098] Data for configuring or executing unit tests of testable logic 112 is stored in snapshot database 116 as part of test snapshot 120 accessible by data processing system 102. This data for configuring unit tests includes test parameter values that define the unit tests. As described below, different versions of unit data for unit tests can be stored in snapshot database 116 and referenced by pointers stored in version control database 118 for retrieval as needed for running or configuring unit tests.
[0099] The test snapshot 120 includes test input data for executing a unit test. The unit test training module 108 uses the test input data to emulate input data from the sources 202a-n of the components 204, 206, 208 being tested. In some implementations, the snapshot database 116 can include other data for configuring or executing a unit test. For example, if a component references a lookup table while processing input data received from a data source 202a-n, the lookup table is stored in the reference database 116 so that the data is available to the unit test or to configure the unit test. In some implementations, only entries that are actually referenced in the lookup table during a unit test are stored in the snapshot database 116 as part of the test snapshot 120. For example, if three references are made to a lookup table during unit test execution and two data entries in the lookup table are actually accessed, the data capture module 106 captures the two accessed entries and stores the data in the snapshot database 116 for access during subsequent unit tests. As unit tests change, other data from the lookup tables can be captured and stored in snapshot database 116. This ensures that the unit test snapshot contains as small a data footprint as possible so that all input data required to execute the behavior of the tested logic is available to the test, but raw data from data sources 202a-n is not unnecessarily stored. The test input data that data processing system 102 stores in snapshot database 116 and uses to test testable logic 112 is described in more detail below.
[0100] Testable logic 112 includes at least a portion of at least one dataflow graph 200, such as components 204, 206, and 208 of dataflow graph 200. Testable logic 112 can include a single component, multiple components, an entire dataflow graph, or multiple dataflow graphs, either in whole or in part. Components of testable logic can be connected with dataflow (links) or can be separate. When multiple dataflow graphs are included in testable logic, the dataflow graphs can be connected to each other (e.g., an upstream graph and a downstream graph, where the first graph is a subgraph of the second graph, etc.). In some implementations, dataflow graphs can be separate from each other (e.g., not connected by dataflow) but may be part of a larger application. For example, testable logic 112 can include two dataflow graphs that update a shared record. In some implementations, each portion of the received testable logic (e.g., each component, each dataflow graph, etc.) can be completely separate from other portions of testable logic 112. For example, testable logic 112 may contain different versions of a dataflow graph that do not interact with each other during testing.
[0101] Testable logic 112 includes the executable logic of a component and any associated data (e.g., metadata) that the component uses to execute the executable logic. For example, testable logic 112 may include values of graph parameters associated with the component being tested. Graph parameters may specify the behavior of the component. Graph parameters are distinct from test parameters, which specify the behavior of a unit test. When configuring a unit test, data processing system 102 may update the values of graph parameters received at testable logic 112 in addition to, or instead of, updating test parameters. In some implementations, graph parameters and test parameters may be updated via a user interface, as described below.
[0102] When a unit test is being executed, data processing system 102 selects a graph (such as graph 200) of testable logic 112 for testing. In some implementations, the particular graph selected is specified in the test configuration as a test parameter. Generally, a unit test is executed on graph 200 or a portion of a graph.
[0103] Data processing system 102 configures unit tests according to the values of user-definable test parameters that specify the behavior of the unit tests, such as how unit test results are reported, how unit tests are scheduled and executed, and how test unit results are versioned.
[0104] The test parameters include settings or configurations for the unit test. A test definition module 104 of the data processing system 102 configures the unit test for the graph 200 received by the data processing system 102. The test definition module 104 may include a user interface, such as a test definition editor (TDE), that allows a user to update the test parameters for configuring the test and to update the graph parameters of the graph 200 that define the behavior of the graph. The user interface is now described with reference to FIGS. 4-6.
[0105] The test definition module 104 allows for the definition of what logic of the testable logic should be tested in a unit test and what test results will be produced. The test definition module 104 selects input sources for the unit test, indicates what output data from the components will be reported, and specifies what result data will be produced.
[0106] To configure input sources, the test definition module 104 indicates one or more input source test parameters. The input source parameters specify which data sources are referenced by the tested component for each input to a selected test region of the dataflow graph (e.g., region 220 in FIG. 2A ). A data source (e.g., sources 202a-n) may include the output of another dataflow graph, a component (e.g., component 214), a lookup table, a data set, etc. Input data from an input source is data being processed by the tested graph 200 and includes test input data included as part of the test snapshot 120. Input data from an input source includes other data that is not part of the test input data but is used during testing by the tested graph 200. For example, input data that is not part of the test input data may include the results of a service call, a data dictionary, etc., as described further below.
[0107] In some implementations, the test input data is replaced with production data in one or more of the data sources specified by the input source parameter. The input source parameter can specify a database, file, or other data source that contains the test input data as the source of data for the tested component. In some implementations, additional values can be associated with the input source parameter for switching between the test input data and the production data (or a copy of the production data).
[0108] The input source parameter of a data source can provide further details about what data should be provided to the tested component from the data source. The input source parameter can specify a network address, a database address (e.g., a specific database record), a table reference (e.g., a field, a value, or both), a database key value, etc.
[0109] In some implementations, the input source parameters specify data to ignore from the input record. For example, if a record contains multiple fields but only a subset of those fields is being tested, the input source parameters can specify that fields that are not included in the subset of fields being tested can be ignored. Ignoring fields in a data record can prevent the data from being fetched over the network, reducing processing time and bandwidth costs. In some implementations, ignoring fields can specify that outputs associated with the ignored fields will not be reported to the user or included in the test result data. In some implementations, ignoring one or more fields includes completely skipping processing of those fields in the unit test, reducing the processing time to complete the unit test. In some implementations, input values can be set to specific values using the test definition module 104 rather than referencing a test input data file or other data source. In some implementations, additional input data can be inserted into the data flow in addition to the source data received from the data source.
[0110] In some implementations, the input source parameter can reference a location within the source 202a-n containing test input data to be used as input data for the component being tested by the unit test. The test input data can include specific fields, values, etc. to cover the entire functionality of the component being tested. For example, if the component is configured to execute a case structure with multiple cases, the test input data can include input data for triggering each case of the case structure. In another example, the test input data can include a predetermined range of values to test edge cases of the functionality. The test input data can be configured to test each branch of a decision tree represented in the component's logic. Other similar examples known in the art for testing component functionality can be used. In some implementations, the test input data can include output data from test results of a previous unit test. This can be done to explicitly indicate changes in the output of the tested portion of the dataflow graph between iterations of the unit test.
[0111] In some implementations, the input source parameters include the location of stored results of a function call executed in the testable logic. For example, if the tested component includes a function that references a lookup table, the test definition module 104 can be configured to retrieve and store the lookup results in a new file (e.g., in the snapshot database 116) rather than retrieving the entire lookup table and storing the lookup table as test input data. Including the entire lookup table or file can significantly increase the size of the test input data file, making test versioning (described below) impractical. Therefore, the test definition module 104 can be configured to retrieve a portion of a lookup file that provides input values to the tested component for at least one function of the component. Typically, the lookup file is provided by a remote source. The test definition module 104 then stores the lookup file, or a portion thereof (e.g., by the data capture module 106), as part of the test snapshot 120 in the snapshot database 116. The stored data can be retrieved and accessed by the at least one executable component during execution of the component. This also reduces the execution time of unit tests since data does not have to be requested from a remote source, and therefore unit tests can be run independently offline.
[0112] Similarly, test parameters can specify the location of the results of a function call on a remote source. This can be done for remote sources including web services or other similar sources. The test definition module 104 can be configured to determine that a data source for a tested component specifies a function call. For each function input in a set of function inputs for the function call, the test definition module 104 executes the function call to obtain a set of function outputs, each of which can invoke a service corresponding to the function input. The set of function outputs for the function call is captured by the data capture module 106 and stored in the snapshot database 116 as part of the test snapshot 120. The function outputs are accessible by the component under test while the component under test is executing. This reduces the time required to execute the function call and wait for a response from the remote source during testing. This process also enables isolation of tests without requiring the contents of web services to be stored along with unit test input data for offline test execution. As discussed above, reducing the size of the test input data can make test versioning practical.
[0113] The test definition module 104 indicates parameters for configuring probes on the dataflow of the selected test area 220. Probes comprise data objects configured to indicate locations in the dataflow graph for extracting data. For example, probes can be placed in the dataflow. As data is sent along the dataflow with the probe, the data is read by the probe. The data capture module 106 records data from the dataflow with the probe and stores the data in the snapshot database 116 for subsequent use. Dataflow graph probes are described in more detail in U.S. Pat. No. 10,055,333, the contents of which are incorporated herein by reference in their entirety.
[0114] Probes (e.g., probes 222, 224, and 226 in FIGS. 2B-2C) can be visually represented on the data flow graph being tested. The probes indicate which data should be reported in the test results. Probes can be inserted so that test results include input data to the component being tested to indicate raw data being received from data sources 202a-n. Probes can include output data from the tested component in the test results. Output data includes data processed by the tested component, such as during unit testing. Similar to input source parameters, test probes can be configured to ignore fields in the data flow they are probing. The probe's data flow can be graphically represented in the data flow graph, as a network address, or both. Probe configuration can include setting key values for the data being reported by the probe. The data capture module 106 uses the key values to compare the probe's data to expected output data in order to report unit test result data.
[0115] In some implementations, probes may be automatically inserted into the dataflow graph by the test definition module 104. For example, the test definition module 104 may be configured to traverse the dataflow graph to discover at least one dataflow in the dataflow graph. The test definition module 104 may then insert a probe on the at least one dataflow to indicate a location in the dataflow graph for extracting additional result data from the execution of the tested component. In some examples, the test definition module 104 may be configured to traverse the tested dataflow graph to discover a location in the dataflow graph for extracting output data generated by the execution of the tested component. The test definition module 104 inserts a probe at a location in the dataflow graph to extract the output data. In some implementations, the test definition module 104 is configured to traverse the dataflow graph to discover a location in the dataflow graph for extracting input data to the tested component and insert a probe at the location to extract the input data.
[0116] Test parameters include test scheduling parameters. Scheduling parameters specify when unit tests are run. For example, unit tests can be run on production software once a day, once a week, after updates are made, etc. Scheduling parameters enable automated testing and reporting of test results, including an indication of failed tests (which can indicate unexpected output data).
[0117] Test parameters specify what the unit test is intended to test. In other words, the selected test area 220 can be expressed as inspection parameters. Target parameters specify each component included in the test area 220 and how they are connected to each other. This can be done implicitly by referencing an executable file containing the component's logic, and the target parameters can indicate which parts of the executable logic should be ignored. In this way, the user can precisely specify which functionality of the executable (e.g., which components) should be tested by the unit test.
[0118] Test parameters specify what data is included in the test result data. Generally, test result data includes structured data that relates output data, including data processed by the tested portion of the dataflow graph, to expected output data, such as baseline data. Test result data can include data generated after a unit test is executed. The generated data can include report data indicating whether the test passed or failed and / or which portion of the tested logic produced unexpected output. Test result data can include code coverage data that indicates which expressions or operations of the tested logic, if any, were not executed during the unit test. Test result data can highlight changes in output data from previous unit tests relative to the current unit test (e.g., as specified by a user). For example, test results from repeated unit tests of the same logic can be compared to show how the output changed from one iteration to the next. In some implementations, trend data can be generated to show how changes occurred across multiple iterations. For example, if the value of certain outputs increases and other outputs decrease after each test, even though the outputs correspond to expected values, this trend can be highlighted in the test result data. Test result data may be presented in a user interface described below. Test parameters may specify how the test result data is presented, which outputs (if any) are ignored, which code comparisons are performed, which predicted data is used in the comparisons, and what metrics constitute a passing or failing test (e.g., whether all values must exactly match expected outputs, what code coverage is desired, etc.).
[0119] Test parameters can specify what the expected output of the tested logic should be from executing the logic on test input data during a unit test. The expected output can include baseline data. The baseline data can include corresponding output data for each test input. As the unit test is executed, the generated output data can be compared to the baseline data. How well the output data generated during the unit test matches the baseline data can be used by the data processing system 102 as a metric for whether the unit test passed or failed. The expected output can include a validation function. The validation function can include logic for testing one or more outputs generated from a unit test. The validation function can validate the output for compliance with one or more rules for the output data without necessarily specifying the exact values that each output should contain. For example, the rules can specify that the output is numeric within an acceptable range, in an acceptable format, contains a specific value, is a specific value, contains valid data (e.g., is not an empty or null value), etc. For example, if the output is known to be a social security number (SSN), the validation function can verify that the output contains a valid social security number associated with a user identifier (or test identifier). Many other similar validation functions are possible.
[0120] The data validation module 110 performs validation of the test result data and sends the validation results (contained in the test result data) to the data capture module 106 for inclusion in the snapshot database 116 along with the unit test snapshots.
[0121] In some implementations, the test parameters can specify a destination for the test result data. The destination includes a location for storing the test results, which can include a comparison of the output data with expected data. In some implementations, the expected data can include baseline data, as described below. In some implementations, the output data of the test result data can be set as baseline data for subsequent unit tests.
[0122] In some implementations, validation module 110 can include one or more components of executable logic for validating data. For example, the validation logic can be a subgraph. The subgraph can be configured to compare data from different parts of the graph being tested or to perform any comparison of data for testing. For example, validation module 110 can compare input data with output data and ensure that the output data matches the result of a function of the input data.
[0123] As mentioned above, the test definition module 104 also allows for modification of graph parameters, which can be useful when a user wants to change the behavior of a component between unit tests. The parameter set for the dataflow graph can be received as metadata within the testable logic 112. The graph parameter set is shown in FIG. 2A as parameter set 228.
[0124] For a dataflow graph 200 of testable logic 112, the test definition module 104 configures the number of tests to be executed on the dataflow graph. Typically, a single test is executed, but the test definition module 104 can configure multiple unit tests to be executed on a single dataflow graph or portion of a dataflow graph.
[0125] Test parameters may include parameters that indicate how the data capture module 106 (described below) should capture test input data and test result data, as well as whether the test should be version controlled in a version control system.
[0126] The data processing system 102 can associate result data with a version of the dataflow graph that includes the component. The test result data can include a report indicating whether a test passed or failed, test results, etc. The result data can indicate how the component is operating and, if applicable, can provide information indicating how the component failed.
[0127] The data capture module 106 is configured to capture test snapshots 120 for each unit test in response to the unit test being executed. For example, if a unit test is executed on a portion of a dataflow graph, the unit test is updated, and a subsequent unit test is executed, the test snapshot 120 for each execution of the unit test can be associated with the snapshot database 116. The snapshot database 116 can be a version control system. The test snapshots 120 can be stored as structured data in which versions of the test snapshots 120 for a unit test are associated with each other. The test snapshots 120 can be stored as compressed files (e.g., .tar files). The snapshots 120a, 120b, and 120c can be linked to each other in a sequence, for example, where each snapshot is a subsequent version of the previous snapshot file. The structured data linkage can be managed in the version control database 118. For example, identifiers 126a, 126b, and 126c can be linked to each other and can each refer to the associated snapshots 120a, 120b, and 120c. This allows the user to determine how updates to a unit test or data flow graph have changed the test results.
[0128] As a unit test is executed, the data capture module 106 saves the input data used, any data retrieved from remote sources (e.g., function calls to web services), test input data (if applicable), output data, test result data, and a version of the data flow graph being tested in a test snapshot 120. The test snapshot 120 represents the unit test. As mentioned above, what data is included in the output data, input data, etc. is determined based on the values of parameters such as probes.
[0129] The data capture module 106 is configured to generate snapshot data representing a version of a unit test. The unit test and version control information associates the test snapshot 120 with other test snapshots 120s stored in the version control database 118. The version control database 118 stores pointers to the test snapshots for the unit tests. When a particular version of a unit test is executed, the pointer to the corresponding test snapshot 120 in the snapshot database 116 is referenced. The data processing system 102 retrieves the corresponding test snapshot 120 from the snapshot database. As previously described, a unit test can be executed using the data in the test snapshot 120 representing that unit test.
[0130] In some implementations, storing test snapshots 120 as version-controlled objects can be difficult due to size limitations. As previously described, storing portions of function calls or lookup tables can alleviate this problem, capturing as input only the data used during execution by graph 200. Data capture module 106 generates a hash (or other such pointer value) for each test snapshot 120. The hash value can represent a version of test snapshot 120. Data capture module 106 can store the hash of the version of test snapshot 120 in version control database 118. When the hash value is referenced, the corresponding test snapshot 120 can be retrieved.
[0131] The data capture module 106 is configured to track the behavior of the dataflow graph during unit testing and store data regarding the execution of components of the dataflow graph. For example, when a function call is executed or a value in a lookup table is referenced, the data capture module 106 is configured to store the referenced value. The data stored by the data capture module 106 can be used to update future iterations of the unit test (e.g., by performing a "store" operation as described above).
[0132] The data capture module 106 can be used to manage data in the snapshot database. For example, the data capture module 106 can be used to check in versions of snapshot data into the snapshot database 116. The data capture module 106 can be used to promote versions of dataflow graphs to production. The capture of data by the data capture module 106 is generally autonomous and can be specified by parameters in the test definition module 104.
[0133] The unit test training module 108 is configured to update the unit test in response to receiving data from the data capture module 106 regarding a previous unit test that was executed. The unit test training module 108 is configured to receive the test snapshot 120 from the data capture module 106 and update the unit test by updating parameters. This process can be autonomous, semi-autonomous, or manual. For example, a memorization service call can be performed automatically by the unit test training module 108. The updated parameter values can be sent to the test definition module 104 to update the configuration of the unit test for subsequent executions of the unit test.
[0134] In some implementations, the unit test training module 108 is configured to generate data for a set of unit tests (e.g., a particular data flow graph or data flow graphs). Trend analysis, as described above, can be performed by the unit test training module 108 to update test parameter values. For example, during unit test execution, result data generated by the data validation module 110 may indicate that the unit test failed due to the tested component. However, a developer may view the result data and determine that the current functionality of the tested logic is actually desired and should correspond to a passing unit test. The developer, via the unit test training module 108, can update the unit test baseline so that the current unit test configuration represents a passing test for the logic being tested. This can be for a number of reasons, including having the unit test ignore additional fields in the test input data because different baseline data or validation functions are used, or making some other change to the unit test to cause the test to pass, as described below. Thus, the unit test training module 108 allows for comparison of test results between unit test iterations so that a developer can compare changes and determine whether the unit test should be reverted to a previous version or whether the unit test as currently defined represents a successful test.
[0135] The test training module 108 can indicate in a proposal summary output which test results have changed from the previous version of the unit test. The summary output is configured to show the user how the changes to the unit test resulted in the changed test result for the test. In some implementations, the test training module 108 suggests whether to accept or reject the changes to the test. In some implementations, the test training module 108 suggests how the unit test can be modified to result in a satisfactory outcome (e.g., changing a failing unit test to a passing unit test). The summary output can show data indicating whether the data flow passed the data (e.g., whether the component executed). The summary output can show data indicating data flow coverage to verify whether the component processed records, how many records of the test data were processed, and whether the flow passed through the processed records as expected. For each component, the summary can show data indicating which statements of the component were actually executed (e.g., code coverage). The summary can check that the number of records on each data flow is the expected number, or that data is generally present (or absent) on the data flow as expected. For example, the summary indicates whether a record has been "silently" rejected by not passing through the data flow as expected.
[0136] In some implementations, the unit test training module 108 is configured to provide suggestions to the user regarding what changes can be made to a test (e.g., making a failed test pass). Suggestions can include whether the current test result data should be considered new baseline data for future validation by the data validation module 110, which fields should be ignored, etc. For example, a particular field may not be critical to the test, but may cause the test to be considered a failed one. The test training module 108 can highlight that a particular field has data that does not pass the test, while other fields have data that does pass the test. The test training module 108 can suggest that a particular field be ignored, resulting in a failed test becoming a passing test. A user presented with this suggestion can review the field, determine that the field is indeed not relevant to this test, and confirm that the field will be ignored in subsequent tests. For example, the user can select a control in a prompt that suggests ignoring the field.
[0137] The summary output can list fields of the test data and indicate how each field caused the unit test to pass or fail. For example, the summary output can indicate differences in test results from a previous version of the unit test. The summary output can indicate which probes were associated with a unit test failure. The summary output can indicate which fields were added, changed, or removed from the previous unit test. The test training module 108 can suggest to the user what the differences from the previous test results mean. For example, if all records indicate modified test results from the previous test results, there may be fundamental changes to the unit test that are causing the failure. The user may be prompted to undo the changes made to the unit test. In another example, if only a few records were changed, the test training module 108 can highlight which test results were changed to cause a unit test that passed in the previous version of the unit test to fail. In this case, the user may want to redefine the current test as a passing test. A prompt can be shown to the user to accept the current test as a passing test (e.g., updating the test baseline).
[0138] In some implementations, the test definition module 104 provides guidance for running unit tests. For example, if a user attempts to run a unit test but data has not yet been captured by the data capture module 106, the user may be presented with an error message indicating that all test parameters have not yet been defined.
[0139] The summary output of the test training module 108 can also provide verification and verification prompts to guide the user. For example, the test training module 108 can show the results of a negative test. Here, the test training module 108 can verify that the test failed at an expected assertion or error point in the code. In other words, the test training module 108 is confirming that the test "failed correctly," or that the test failed in the expected manner. Another verification that can be performed is a test failure. The test training module 108 can be configured to verify that the number of rejected records is zero or otherwise within an expected range. The test training module 108 can prompt the user if the number is outside the expected range (e.g., a non-zero result is expected and the result is zero). The rejected records can be shown to the user. The test training module 108 can be configured to filter tests. For example, the test training module 108 checks that the number of records on a flow that match a specified expression is zero. If any values match a specified expression (e.g., are out of range, have a null value, etc.), those records can be highlighted to the user. As previously mentioned, the test training module 108 can be configured to suggest a subset of the output data to ignore or consider. For example, a prompt can be generated to the user to ignore records when comparing to a baseline of expected data.
[0140] The load data module 114 is configured to load data into the snapshot database 116. Generally, the load data module 114 receives snapshot data from the data capture module 106 and loads the snapshot data into the snapshot database 116. The load data module can also receive data for loading into the snapshot database 116 from the unit test training module 108. For example, the load data module 114 can receive updated parameter values from the unit test training module 108. In some implementations, the load data module can receive trend data from the unit test training module 108.
[0141] Returning to FIG. 2A , in general, the flow of a dataflow graph can be altered through the use of parameters, such that a component or series of components are bypassed. Generally, parameters represent values associated with a dataflow graph that can be configured or changed to alter the behavior of the dataflow graph. For example, characteristics can change between uses of the dataflow graph, and the dataflow graph can perform different operations because of the change. One or more of the components 204, 206, 208, 210, the sources 202a-n, and the sink 212 can each be associated with one or more parameters, which can be referred to as a parameter set. An exemplary parameter set 228 is associated with component 204 and includes a parameter P A , P B , P C , P D , and P EExamples of how these parameters may be used to configure a dataflow graph and / or test a dataflow graph are described below. The parameters and their values define the behavior of the dataflow graph. For example, a parameter may define the location of a data source or a data sink on a physical disk. Parameters may also define the behavior of a component, such as how a sort component sorts data input to the component. In some examples, the values of the parameters in a parameter set are input during execution of the dataflow graph.
[0142] In some examples, the value of one parameter may depend on the value of another parameter. For example, a data source may be stored in a file within a particular directory. The parameter set for the data source may include a first parameter called "DIRECTORY" and a second parameter called "FILENAME." In this example, the FILENAME parameter depends on the DIRECTORY parameter (e.g., DIRECTORY may be " / usr / local / " and FILENAME may be "input.dat"). Parameters may also depend on parameters of other components. For example, the physical location of a data sink for a dataflow graph may depend on the physical location of a data source for the dataflow graph. For example, a data sink may include a set of parameters including a FILENAME parameter that depends on the DIRECTORY parameter of the data source (e.g., the FILENAME parameter of the data sink may be " / usr / local / output.dat" and the value " / usr / local / " is obtained from the DIRECTORY parameter of the data source).
[0143] Component 204 can be a graph interface component that references one or more other dataflow graphs, sometimes referred to as subgraphs (not shown). At runtime, dataflow graph 200 dynamically loads and executes the subgraphs referenced by component 204, allowing, for example, dataflow graph 204 to flexibly access various functionality provided by the subgraphs. One or more parameters P of component 204 A , P B , P C , P D , and P E defines the particular subgraph referenced by component 204. Each subgraph is also associated with a parameter set that includes one or more parameters, each of which defines the behavior of the corresponding subgraph.
[0144] Although written to achieve a specific business objective, the underlying structure and construction of the graph are determined based on technical considerations. For example, data flow graph components 204, 206, 208, and 210 may be selected to maximize reusability or to support parallel processing. On the other hand, where the graph is used may be primarily a business decision. Some of the parameters associated with a parameterized data flow graph can be used to allow business users to customize the data flow graph without the user having to understand the technical complexities behind its implementation. Parameterized data flow graphs simplify customization and facilitate reuse.
[0145] An interface can be presented on a client machine for identifying parameter values for constructing a dataflow graph. In some implementations, the client can access a development environment running on a server using a web browser on the client that provides the parameter interface and a scripting language that provides some functionality for client-side processing. The scripting language can communicate with the server to update parameters and perform other necessary operations. This communication can occur through a bridge machine that translates communication between the server and the client running the development environment, which stores the objects and associated parameter values of the graph being constructed. The interface allows a user to configure parameters for a parameterized dataflow graph even if the user lacks technical knowledge of dataflow graphs and dataflow graph configuration.
[0146] A configuration interface presented on a client device (not shown) allows a user to access the graph configuration module. Through the configuration interface, a user can specify characteristics of the data sources 202a-n, the data sink 212, and the logic to be executed by the dataflow graph, without requiring technical knowledge of dataflow graph configuration. Based on the characteristics specified by the user, parameter values can be assigned to parameter sets 228, thus defining the behavior of the dataflow graph according to the characteristics specified by the user.
[0147] Within the configuration interface, parameters in each component's parameter set 228 can be combined and reorganized into groups for interaction with a user, e.g., to reflect business considerations rather than technical considerations. A configuration interface for receiving parameter values based on user input can display different parameters according to their relationships in a flexible manner that is not necessarily limited by aspects of the development environment on the server. An example of a configuration interface is described in U.S. Patent Application Publication No. 2011 / 0145748, the contents of which are incorporated herein by reference in their entirety.
[0148] A dataflow graph can be configured at compile time by modifying the pre-compilation of the dataflow graph to perform specific actions, or at run time by setting parameters or modifying configuration files used by the dataflow graph. An environment for developing and configuring dataflow graphs is described in more detail in U.S. Patent No. 7,716,630, entitled "Managing Parameters for Graph-Based Applications," which is incorporated herein by reference in its entirety.
[0149] As previously mentioned, dataflow graph 200 includes test area 220. Test area 220 specifies which components of dataflow graph 200 are being tested by a unit test. The test area is specified by test parameters. Test area 220 is shown as a graphical dashed line, but can be represented as a list of components. In some implementations, test area 220 includes components from multiple different graphs, which can function independently of one another. Although a single test area 220 is shown, graph 200 can include multiple separated test areas.
[0150] Test area 220 defines a unit test in terms of what input data is required for the test and what outputs are produced by the test. For example, in area 220 of Figure 2A, inputs 216a and 216b are inputs for the unit test because the data flows connected to these inputs are connected to sources external to test area 220. Data sources 202a and 202b corresponding to inputs 216a and 216b are shown as databases, but the data sources may also include other data flow graphs or components not being tested.
[0151] In dataflow graph 200, components 204, 206, and 208 have been tested, but component 210 has not. Output 218a of component 204 and output 218b of component 206 are the data sources for inputs 216c and 216d of component 208. Output 218c of component 218 contains the most recent output data of the unit test defined by region 220. Inputs 216e and 216f of component 210 and output 218d of component 210 are not critical to this unit test.
[0152] The unit test isolates components 204, 206, and 208 for testing. To isolate these components, input data from sources 202a and 202b can be simulated using test input data or can be provided from the sources themselves. Data form data source 202n does not affect the unit test defined by region 220 and does not need to be simulated or retrieved to run the unit test.
[0153] As previously mentioned, component 204 is associated with metadata that includes parameter set 228. Each of components 204, 206, 208, 210, data sources 202a-n, and data sink 212 is typically associated with a respective parameter set, although for clarity only parameter set 228 is shown. Generally, when viewing a graphical representation, parameters 228 are not visible (and therefore are outlined with a dotted line).
[0154] 2B, once unit test area 220 is defined, other test parameter values can be set as described above. For example, probes 222 and 224 can be placed (manually or automatically) on the input data flow to test area 220. Similarly, probe 226 can be placed on the output data flow. Probes can be placed on intermediate data flows 230 and 232 so that intermediate output data is included in the test result data.
[0155] Generally, for each probe 222, 224, and 226, the unit test generates corresponding expected data that can be compared to the data at the probe to determine whether the unit test passed or failed. Generally, the input data at probes 222 and 224, including test input data or other input data, is identical to the expected data because no processing has occurred. However, a comparison can be performed on the test input data to ensure that no data is missing or corrupted. Generally, for each probe on the data flow that includes output data, such as probe 226, the expected data is retrieved for the unit test for verification, as described above.
[0156] The data recorded for each of the probes during the unit test can be shown in a user interface. In some implementations, a table 234 can indicate the location of the stored data for each probe, where the table 234 includes a field 236 listing the probe, a field 238 listing the data source, and a field 240 listing each location where the data recorded by the probes 222, 224, and 226 is stored. Each component and probe is indicated by a status overlay 242 on the graph or graphical representation of the graph. The status overlay 242 indicates whether the component has executed in the test. As shown in FIG. 2C , when the corresponding probe receives data or when a component 204 executes, the status overlay 244 is updated to indicate that execution has occurred.
[0157] Each of the probes 222, 224, and 226 can be selected in the user interface to show a comparison of the data flows where the probes were placed. For example, selecting a probe can show how many records are different, how many records were added, and how many records were deleted. An exemplary pop-up interface 246 for probe 226 is shown. Selecting probe 226 can also allow the user to update test parameters for configuring the test, as shown in FIG.
[0158] 3A-3H, an example of unit test verification 300 by data capture module 106 is shown. In FIG. 3A, test definition module 104 receives data representing data flow graph 200 from a source in testable logic 112. Test definition module 104 receives test parameters 124, such as via user input on user device 122 or from a data store. As previously described, from test parameters 124, test definition module 104 generates test definition data 302 that defines the behavior of the unit test. Test definition data 302 is transmitted to data validation module 110 and data capture module 106.
[0159] 3A, test parameters 124 include parameter sets 228, including graph parameters 228, test data 350, output data parameters 331, data source locations 333, and insertion locations for dataflow graph 200. These data define which portion 229 of dataflow graph 200 is being tested, what test data is used by test data parameters 335, how dataflow graph 200 should execute, what data is available to the tested component of the dataflow graph during testing, and what output data is recorded. These test parameters also define the output data that data processing system 102 expects for a successful test, and the verification parameters 337 used for test verification (e.g., what baseline data should be, or what verification function should be used, etc.). These data were previously described in detail with respect to FIG. 1.
[0160] 3B, the data validation module 110 receives test definition data 302 from the test definition module 104 to validate the test as successful, unsuccessful, or partially successful. The data validation module 110 can run the test execution logic 308, or the test execution logic 308 can be run by another system and the generated output 304 can be sent from the other system to the data validation module.
[0161] Referring to FIG. 3D , a process 320 for validating a unit test is shown. The data validation module 110 receives test definition data 302, including expected output data 306. The expected output data 306, as previously described, may include actual expected output values of the dataflow graph 200, validation functions that check whether the output values meet given metrics (e.g., are the format correct, are the values within an expected range, are multiple outputs consistent with each other, etc.), or a combination of both. The data validation module 110 uses validation logic 308 to compare the generated output data 304 with the expected output data 306 and determine whether the test passed, failed, or partially passed, as reported in test result data 310. The generated output data 304 does not necessarily need to match the expected output data 306 to pass a test. In some implementations, a test can be defined as “passing” if a specific portion of the generated output data 304 matches the expected output data 306 and / or meets the validation functions of the expected output data.
[0162] Referring to FIG. 3E, process 330 shows exemplary values for generated output data 304, expected output data 306, and test result data 310. Generated output data 304 includes a customer name, a customer's credit amount, and an exemplary location. Expected output data 306 includes the same fields. As shown in test result data 310, four records were tested, and two records match the expected output and the generated output. A record is missing from the generated output. These discrepancies result in a failing test result. However, the user can indicate that this is actually good enough to represent a pass and update the test to expect the current generated output, as described below.
[0163] FIG. 3F shows an example process 340 for training a unit test using the unit test training module 108. The unit test training module 108 receives test results 310 from the data validation module 110. The test result data 310 is input to a training logic 332 module, which may also receive user input data 356. The training logic 332 can specify which test output is considered a passing test based on the test output of the generated unit test. For example, a user can indicate that the generated output 304 should actually represent a passing test. The user can simply select an option to redefine the current generated output 304 as representing a passing test, and the unit test training module 108 automatically updates the expected output data 306 accordingly. In some implementations, the user can update the unit test by selecting specific fields to ignore in the test, adjusting the acceptable output range, etc. The test result data 334 is updated to indicate that the current output represents a passing test (if applicable). The unit test training module 108 sends the updated test definition data 336 to the data capture module 106, which can be accessed by other modules during testing.
[0164] FIG. 3G illustrates a process 350 for data capture by the data capture module 106. The data capture module 106 receives updated test result data 334 and updated test definition data 336, including generated output data 304, expected output data 306 (which may be updated by the unit test training module 108), updated test parameters 344, and the data flow graph 200. The data capture module includes snapshot generation logic 342 that generates snapshot data 120 for storage in a repository as a version of the unit test. This process may include compressing all data required to run the unit test into a compressed file and sending the version to the repository. The snapshot generation logic 342 also generates a snapshot data identifier 126. The identifier 126 is stored in a version control repository, which may be file size sensitive. The identifier 126 points to the associated snapshot data 120 representing the current version of the unit test. The identifier may include a hash value of the compressed snapshot 120 file. The snapshot data 120 and identifier 126 are sent to the associated database using the load data module 114.
[0165] 3H, a process 360 for loading snapshot data 120 and identifiers 126 is shown. The snapshot data 120 and identifiers 126 are received by the load data module 114. The load data module 114 includes version control logic 362 that associates each version of the snapshot data 120 with its identifier 126. The version 120a of the snapshot data and corresponding identifier 126a are sent to the snapshot database 116 and the version control database 118, respectively. The snapshot database 116 can include multiple versions 120a, 120b, 120c, etc. of the snapshot data 120, each representing a different version of the test. The version control database 118 includes corresponding identifiers 126a, 126b, 126c, etc. These identifiers can be used to search for the desired version of the test. The version control database 118 can be a lightweight database, while the snapshot database 116 can be a larger database (e.g., a cloud-based database or a data warehouse).
[0166] 4, an example of a user interface 400 is shown. The user interface 400 is configured to allow a user to edit test parameters in a test definition window 402. The user interface 400 includes a test results window 404 for displaying test result data for a unit test. Although the test definition window 402 and the test results window 404 are shown side-by-side, they may also be presented separately from one another.
[0167] The test definition window 402 shows menus 406 for editing test parameters 124, such as graph parameters, probes, data source addresses, ignore fields, test input data, and unit test targets. In one example, a probes menu 408 is shown, including probes A, B, and C.
[0168] Test results window 404 shows test result data. In window 404, the test result data includes a code coverage table 410. Code coverage table 410 includes data indicating whether each expression in testable logic 112 selected in region 220 was executed during unit testing. Identifiers can be used to indicate whether an expression was executed for all records (FULL), for some records (PARTIAL), or if the expression was not executed (NOT Executed). The number of records in which the expression was executed can be indicated.
[0169] Test results window 404 may show a probe table 412. Probe table 412 may show values recorded at a probe's location in the dataflow graph. For example, the dataflow values for probes A, B, and C are shown in record 450. Table 412 may assist in analyzing the input and output data of the dataflow graph of one or more records, as described above.
[0170] The result data can include a verification result table 414. As discussed above in connection with Figures 3A-3H, the verification data indicates whether the output data of the unit test matches the expected output data by checking against baseline data or by being verified using a verification function.
[0171] Referring to FIG. 5, a flow diagram is shown including an exemplary process 500 for configuring and executing a unit test for at least a portion of a dataflow graph, such as by the system 102 of FIG. 1. The process 500 includes receiving (502) an indication of a portion of the dataflow graph for testing, the portion including at least one executable component of the dataflow graph. The data processing system 102 receives (504) a parameter set including parameters indicating expected output data produced by execution of the at least one executable component. The data processing system 102 receives (506) input data for the at least one executable component, the input data indicated by the parameter set and configured to test functionality of the at least one executable component. The data processing system 102 defines (508) a unit test for the at least one executable component based on the parameter set. Generally, a unit test is configured to provide input data to one or more inputs of a dataflow graph, process the input data by at least one executable component of the dataflow graph to generate output data, generate result data indicating a correspondence between the output data and expected output data indicated by parameters, and generate structured data indicating an association between the result data, the input data, and the dataflow graph (e.g., an association of these data in a common file that can be linked to version control database 118).
[0172] Some implementations of the subject matter and operations described herein can be implemented in digital electronic circuitry, or in computer software, firmware, or hardware, or in combinations of one or more of them, including the structures disclosed herein and their structural equivalents. For example, in some implementations, monitoring system 102, client device 112, and computing system 116 can be implemented using digital electronic circuitry, or in computer software, firmware, or hardware, or in combinations of one or more of them. In another example, processes 500 and 600 can be implemented using digital electronic circuitry, or in computer software, firmware, or hardware, or in combinations of one or more of them.
[0173] Some implementations described herein (e.g., test definition module 104, data capture module 106, unit test training module 108, validation module 110, load data module 114, etc.) may be implemented as one or more groups or modules of digital electronic circuitry, computer software, firmware, or hardware, or one or more combinations thereof. Although different modules may be used, each module need not be distinct; multiple modules may be implemented in the same digital electronic circuitry, computer software, firmware, or hardware, or combinations thereof.
[0174] Some implementations described herein may be implemented as one or more computer programs, i.e., one or more modules of computer program instructions encoded on a computer storage medium for execution by or controlling the operation of a data processing apparatus. A computer storage medium may be or be included in a computer-readable storage device, a computer-readable storage substrate, a random-access or serial-access memory array or device, or one or more combinations thereof. Further, a computer storage medium is not a propagating signal, although a computer storage medium may be the source or target of computer program instructions encoded in an artificially generated propagating signal. A computer storage medium may also be or be included in one or more separate physical components or media (e.g., multiple CDs, disks, or other storage devices).
[0175] The term "data processing device" encompasses all kinds of devices, devices, and machines for processing data, including, by way of example, a programmable processor, a computer, a system-on-chip, or a plurality or combination of the above. In some implementations, the query response module 104 and / or the data structure module 106 comprise a data processing device as described herein. The device may include special-purpose logic circuitry, such as a field-programmable gate array (FPGA) or an application-specific integrated circuit (ASIC). In addition to hardware, the device may also include code that creates an execution environment for the computer program in question, such as code constituting processor firmware, a protocol stack, a database management system, an operating system, a cross-platform runtime environment, a virtual machine, or one or more combinations thereof. The device and execution environment may implement a variety of different computing model infrastructures, such as web services, distributed computing, and grid computing infrastructures.
[0176] A computer program (also known as a program, software, software application, script, or code) can be written in any form of programming language, including compiled or interpreted, declarative or procedural languages. A computer program may, or may not, correspond to a file in a file system. A program can be stored as part of a file that holds other programs or data (e.g., one or more scripts stored in a markup language document), in a single file dedicated to the program in question, or in multiple cooperating files (e.g., files storing one or more modules, subprograms, or portions of code). A computer program can be deployed to run on one computer or on multiple computers located at one site or distributed across multiple sites and interconnected by a communications network.
[0177] Some of the processes and logic flows described herein may be performed by one or more programmable processors executing one or more computer programs to perform operations by manipulating input data and generating output. The processes and logic flows may also be performed by, and apparatus may be implemented as, special purpose logic circuitry, such as, for example, an FPGA (Field Programmable Gate Array) or an ASIC (Application Specific Integrated Circuit).
[0178] Processors suitable for executing a computer program include, by way of example, both general-purpose and special-purpose microprocessors, as well as processors of any kind of digital computer. Generally, a processor will receive instructions and data from a read-only memory or a random-access memory, or both. A computer includes a processor for performing operations in accordance with the instructions and one or more memory devices for storing instructions and data. A computer may also include, or be operatively coupled to receive data from, transfer data to, or do both, one or more mass storage devices, such as magnetic, magneto-optical, or optical disks, for storing data. However, a computer need not have such devices. Devices suitable for storing computer program instructions and data include, by way of example, all forms of non-volatile memory, media, and memory devices, including semiconductor memory devices (e.g., EPROMs, EEPROMs, flash memory devices, etc.), magnetic disks (e.g., internal hard disks, removable disks, etc.), magneto-optical disks, and CD-ROM and DVD-ROM disks. The processor and memory may be supplemented by, or incorporated in, special-purpose logic circuitry.
[0179] To provide for user interaction, operations can be performed on a computer having a display device (e.g., a monitor or another type of display device) for displaying information to the user, and a keyboard and pointing device (e.g., a mouse, trackball, tablet, touch-sensitive screen, or another type of pointing device) by which the user can provide input to the computer. Other types of devices can also be used to provide for user interaction. For example, feedback provided to the user can be any form of sensory feedback, such as visual feedback, auditory feedback, or haptic feedback, and input from the user can be received in any form, including acoustic, speech, or tactile input. Additionally, the computer can interact with the user by sending documents to and receiving documents from devices used by the user, e.g., by sending a web page to a web browser on the user's client device in response to a request received from the web browser.
[0180] A computer system may include a single computing device or multiple computers operating within close proximity or generally remotely from each other and typically interacting through a communications network. Examples of communications networks include local area networks ("LANs") and wide area networks ("WANs"), internetworks (e.g., the Internet), networks including satellite links, and peer-to-peer networks (e.g., ad hoc peer-to-peer networks). The relationship of client and server may arise by virtue of computer programs running on the respective computers and having a client-server relationship to each other.
[0181] 6 shows an exemplary computer system 600 including a processor 610, a memory 620, a storage device 630, and an input / output device 640. Each of the components 610, 620, 630, and 640 may be interconnected, for example, by a system bus 650. The processor 610 may process instructions for execution within the system 600. In some implementations, the processor 610 is a single-threaded processor, a multi-threaded processor, or another type of processor. The processor 610 may process instructions stored in the memory 620 or the storage device 630. The memory 620 and the storage device 630 may store information within the system 600.
[0182] The input / output devices 640 provide input / output operations to the system 600. In some implementations, the input / output devices 640 can include one or more of a network interface device, such as an Ethernet card, a serial communication device, such as an RS-232 port, and / or a wireless interface device, such as an 802.11 card, a 3G wireless modem, a 4G wireless modem, a 5G wireless modem, etc. In some implementations, the input / output devices can include driver devices configured to receive input data and send output data to other input / output devices, such as a keyboard, a printer, and a display device 660. In some implementations, mobile computing devices, mobile communication devices, and other devices can be used.
[0183] While this specification contains many details, these should not be construed as limitations on the scope of what may be claimed, but rather as descriptions of features specific to particular examples. Certain features described herein in the context of separate embodiments may also be combined. Conversely, various features that are described in the context of a single embodiment may also be implemented in multiple embodiments separately or in any suitable subcombination.
[0184] Although several embodiments have been described, it will be understood that various modifications can be made without departing from the spirit and scope of the data processing system described herein. Accordingly, other embodiments are within the scope of the following claims.
Claims
1. 1. A method for defining a unit test for a data flow graph executed by a data processing system and including a plurality of executable components, the method comprising: receiving an indication of a portion of a dataflow graph under test, the portion including at least one executable component of the dataflow graph, the at least one executable component connected to at least one dataflow for providing input data to the at least one executable component; receiving a parameter set including parameters indicative of expected output data produced by execution of the at least one executable component; receiving the input data of the at least one executable component, the input data being indicated by the parameter set and configured to invoke a function of the at least one executable component when provided to the at least one executable component by the at least one data flow; defining a unit test for the at least one executable component based on the parameter set, the unit test comprising: providing said input data via said at least one data flow to said at least one executable component; causing processing of the input data by the at least one executable component to generate output data; and generating result data indicative of a correspondence between the generated output data and the expected output data indicated by the parameters; generating structured data based on a combination of the result data, the input data, and the data flow graph; Including, The method, wherein the structured data can relate to a previous version of the structured data, a subsequent version of the structured data, or both.
2. The method of claim 1 , wherein the results data, the structured data, or both include data indicating whether the generated output data conforms to the expected output data.
3. 2. The method of claim 1 , wherein the result data, the structured data, or both include data indicating that an error occurred based on the generated output data not conforming to the expected output data, data indicating the executable component of the at least one executable component where the error occurred, and data providing guidance on how to correct the error.
4. generating, or providing data for generating, a graphical user interface that displays, or is configured to display, the data indicating that an error has occurred based on the generated output data not conforming to the expected output data, the data indicating the executable component of the at least one executable component in which the error occurred, and the data providing guidance on how to correct the error; The method of claim 1 further comprising:
5. providing means for receiving, by the graphical user interface, the input data, the expected output data, or a correction of the functionality of the executable component for the at least one executable component in which the error occurred; providing said input data via said at least one data flow to said at least one executable component; causing processing of input data by the executable component of the at least one executable component in which the error occurred to generate output data in accordance with the modification; and The method of claim 4 further comprising:
6. The method of claim 1 , wherein the expected output data comprises baseline data, and generating the result data comprises comparing the generated output data to the baseline data.
7. The method of claim 1 , wherein providing input data comprises executing an application that generates the input data for feeding into the at least one data flow.
8. 2. The method of claim 1 , wherein the expected output data comprises an expected result of a verification function, and generating the result data comprises applying the verification function to at least a portion of the generated output data to generate a result, and comparing the result to the expected result following applying the verification function to at least a portion of the expected output data.
9. The method of claim 8 , wherein the verification function is configured to compare data from two different data flows connected to one or more executable components, including the at least one executable component.
10. 2. The method of claim 1, wherein the parameter set includes at least one additional parameter indicating one of: at least one location in the data flow graph for extracting the generated output data; a location of baseline data for comparing the generated output data; and a definition of a validation function for validating the generated output data.
11. receiving an indication of one or more portions of the input data to ignore during performance of a validation function; updating the parameter set based on the received indication; and The method of claim 1 further comprising:
12. 2. The method of claim 1 , wherein the at least one executable component is configured to receive source data from a source external to the dataflow graph during execution, the input data including a value corresponding to the source data from the source external to the dataflow graph, and all operations of at least some of the operations of the at least one executable component are configured to be invoked upon receipt of the value.
13. retrieving a portion of a lookup file that provides input values to the at least one executable component for at least one function of the at least one executable component, the lookup file being provided by a remote source; storing the portion of the lookup file in a data storage device accessible by the at least one executable component during execution of the at least one executable component; The method of claim 1 further comprising:
14. determining that a data source of the at least one executable component includes a function call; for each function input of a set of function inputs of said function call, executing said function call to obtain a set of function outputs, each function output corresponding to a function input; storing the set of function outputs of the function calls in a data storage device accessible by the at least one executable component during execution of the at least one executable component; The method of claim 1 further comprising:
15. traversing the data flow graph to discover at least one data flow in the data flow graph; inserting a probe onto the at least one data flow to indicate a location within the data flow graph for extracting additional result data from the execution of at least one executable component of the at least one executable component; The method of claim 1 further comprising:
16. generating a hash of the structured data representing a version of the structured data; storing the hash of the version of the structured data in association with the corresponding version of the dataflow graph; The method of claim 1 further comprising:
17. 10. The method of claim 1, further comprising: generating, or providing data for generating, a user interface configured to display, or display a representation of the dataflow graph, wherein the user interface displays, or is for displaying, annotations for the at least one executable component of the at least one executable component indicating operational states of the at least one executable component that represent how the at least one executable component executed during the unit test.
18. 20. The method of claim 17, wherein the user interface includes an overlay layer that shows one or more of the output data, the input data, and the result data associated with the dataflow graph in response to execution of the at least one executable component of the dataflow graph.
19. 10. The method of claim 1, further comprising: generating, or providing data for generating, a user interface that displays, or is configured to display, a representation of the dataflow graph, the user interface for displaying, or for displaying, a location within the representation of the dataflow graph at which the dataflow graph receives the input data.
20. The results data may include information indicating whether each function of the at least one executable component: generating output data that corresponds to the baseline data; generating output data that did not match the expected output data; or does not produce any output data, The method of claim 1 , further comprising an indication of:
21. 2. The method of claim 1 , wherein the unit test is further configured to cause an action including storing data required by the at least one executable component to process the input data, the required data being included in the structured data.
22. 1. A system implemented by a data processing system for defining unit tests for a data flow graph including a plurality of executable components, the system comprising: a data storage device for storing instructions; at least one processor executing the instructions stored by the data storage device; receiving an indication of a portion of a dataflow graph under test, the portion including at least one executable component of the dataflow graph, the at least one executable component connected to at least one dataflow for providing input data to the at least one executable component; receiving a parameter set including parameters indicative of expected output data produced by execution of the at least one executable component; receiving the input data of the at least one executable component, the input data being indicated by the parameter set and configured to invoke a function of the at least one executable component when provided to the at least one executable component by the at least one data flow; defining a unit test for the at least one executable component based on the parameter set, the unit test comprising: providing said input data via said at least one data flow to said at least one executable component; causing processing of the input data by the at least one executable component to generate output data; and generating result data indicative of a correspondence between the generated output data and the expected output data indicated by the parameters; generating structured data based on a combination of the result data, the input data, and the data flow graph; and Equipped with The system, wherein the structured data can be related to a previous version of the structured data, a subsequent version of the structured data, or both.
23. One or more non-transitory computer-readable media storing instructions for defining a unit test for a data flow graph including a plurality of executable components, the instructions comprising: receiving an indication of a portion of a dataflow graph under test, the portion including at least one executable component of the dataflow graph, the at least one executable component connected to at least one dataflow for providing input data to the at least one executable component; receiving a parameter set including parameters indicative of expected output data produced by execution of the at least one executable component; receiving the input data of the at least one executable component, the input data being indicated by the parameter set and configured to invoke a function of the at least one executable component when provided to the at least one executable component by the at least one data flow; defining a unit test for the at least one executable component based on the parameter set, the unit test comprising: providing said input data via said at least one data flow to said at least one executable component; causing processing of the input data by the at least one executable component to generate output data; and generating result data indicative of a correspondence between the generated output data and the expected output data indicated by the parameters; generating structured data based on a combination of the result data, the input data, and the data flow graph; One or more non-transitory computer-readable media, wherein the structured data can relate to a previous version of the structured data, a subsequent version of the structured data, or both.
24. 2. The method of claim 1, wherein the structured data defines a relationship between a first version of the unit test defined by the parameters and a second version of the unit test defined by different parameters in a different version of the structured data, the relationship representing a previous version of the structured data, a subsequent version of the structured data, or a change therebetween with respect to the structured data, and the relationship distinguishes the first version of the unit test from the second version of the unit test.
25. 1. A method for defining a unit test for a data flow graph executed by a data processing system and including a plurality of executable components, the method comprising: receiving an indication of a portion of a dataflow graph under test, the portion including at least one executable component of the dataflow graph, the at least one executable component connected to at least one dataflow for providing input data to the at least one executable component; receiving a parameter set including parameters indicative of expected output data produced by execution of the at least one executable component; receiving the input data of the at least one executable component, the input data being indicated by the parameter set and configured to invoke a function of the at least one executable component when provided to the at least one executable component by the at least one data flow; defining a unit test for the at least one executable component based on the parameter set, the unit test comprising: providing said input data via said at least one data flow to said at least one executable component; causing processing of the input data by the at least one executable component to generate output data; and generating result data indicative of a correspondence between the generated output data and the expected output data indicated by the parameters; generating structured data based on a combination of the result data, the input data, and the data flow graph; Including, 10. The method of claim 1, wherein the result data, the structured data, or both include data indicating that an error occurred based on the generated output data not conforming to the expected output data, data indicating the executable component of the at least one executable component in which the error occurred, and data providing guidance on how to correct the error.
26. 1. A method for defining a unit test for a data flow graph executed by a data processing system and including a plurality of executable components, the method comprising: receiving an indication of a portion of a dataflow graph under test, the portion including at least one executable component of the dataflow graph, the at least one executable component connected to at least one dataflow for providing input data to the at least one executable component; receiving a parameter set including parameters indicative of expected output data produced by execution of the at least one executable component; receiving the input data of the at least one executable component, the input data being indicated by the parameter set and configured to invoke a function of the at least one executable component when provided to the at least one executable component by the at least one data flow; defining a unit test for the at least one executable component based on the parameter set, the unit test comprising: providing said input data via said at least one data flow to said at least one executable component; causing processing of the input data by the at least one executable component to generate output data; and generating result data indicative of a correspondence between the generated output data and the expected output data indicated by the parameters; generating structured data based on a combination of the result data, the input data, and the data flow graph; A method comprising: generating, or providing data for generating, a graphical user interface that displays, or is configured to display, the data indicating that an error has occurred based on the generated output data not conforming to the expected output data, the data indicating the executable component of the at least one executable component in which the error occurred, and the data providing guidance on how to correct the error; The method further comprises:
27. 1. A method for defining a unit test for a data flow graph executed by a data processing system and including a plurality of executable components, the method comprising: receiving an indication of a portion of a dataflow graph under test, the portion including at least one executable component of the dataflow graph, the at least one executable component connected to at least one dataflow for providing input data to the at least one executable component; receiving a parameter set including parameters indicative of expected output data produced by execution of the at least one executable component; receiving the input data of the at least one executable component, the input data being indicated by the parameter set and configured to invoke a function of the at least one executable component when provided to the at least one executable component by the at least one data flow; defining a unit test for the at least one executable component based on the parameter set, the unit test comprising: providing said input data via said at least one data flow to said at least one executable component; causing processing of the input data by the at least one executable component to generate output data; and generating result data indicative of a correspondence between the generated output data and the expected output data indicated by the parameters; generating structured data based on a combination of the result data, the input data, and the data flow graph; A method comprising: generating, or providing data for generating, a graphical user interface that displays, or is configured to display, the data indicating that an error has occurred based on the generated output data not conforming to the expected output data, the data indicating the executable component of the at least one executable component in which the error occurred, and the data providing guidance on how to correct the error; providing means for receiving, by the graphical user interface, the input data, the expected output data, or a correction of the functionality of the executable component for the at least one executable component in which the error occurred; providing said input data via said at least one data flow to said at least one executable component; causing processing of input data by the executable component of the at least one executable component in which the error occurred to generate output data in accordance with the modification; and The method further comprises:
28. 1. A method for defining a unit test for a data flow graph executed by a data processing system and including a plurality of executable components, the method comprising: receiving an indication of a portion of a dataflow graph under test, the portion including at least one executable component of the dataflow graph, the at least one executable component connected to at least one dataflow for providing input data to the at least one executable component; receiving a parameter set including parameters indicative of expected output data produced by execution of the at least one executable component; receiving the input data of the at least one executable component, the input data being indicated by the parameter set and configured to invoke a function of the at least one executable component when provided to the at least one executable component by the at least one data flow; defining a unit test for the at least one executable component based on the parameter set, the unit test comprising: providing said input data via said at least one data flow to said at least one executable component; causing processing of the input data by the at least one executable component to generate output data; and generating result data indicative of a correspondence between the generated output data and the expected output data indicated by the parameters; generating structured data based on a combination of the result data, the input data, and the data flow graph; A method comprising: receiving an indication of one or more portions of the input data to ignore during performance of a validation function; updating the parameter set based on the received indication; and The method further comprises:
29. 1. A method for defining a unit test for a data flow graph executed by a data processing system and including a plurality of executable components, the method comprising: receiving an indication of a portion of a dataflow graph under test, the portion including at least one executable component of the dataflow graph, the at least one executable component connected to at least one dataflow for providing input data to the at least one executable component; receiving a parameter set including parameters indicative of expected output data produced by execution of the at least one executable component; receiving the input data of the at least one executable component, the input data being indicated by the parameter set and configured to invoke a function of the at least one executable component when provided to the at least one executable component by the at least one data flow; defining a unit test for the at least one executable component based on the parameter set, the unit test comprising: providing said input data via said at least one data flow to said at least one executable component; causing processing of the input data by the at least one executable component to generate output data; and generating result data indicative of a correspondence between the generated output data and the expected output data indicated by the parameters; generating structured data based on a combination of the result data, the input data, and the data flow graph; A method comprising: determining that a data source of the at least one executable component includes a function call; for each function input of a set of function inputs of said function call, executing said function call to obtain a set of function outputs, each function output corresponding to a function input; storing the set of function outputs of the function calls in a data storage device accessible by the at least one executable component during execution of the at least one executable component; The method further comprises:
30. 1. A method for defining a unit test for a data flow graph executed by a data processing system and including a plurality of executable components, the method comprising: receiving an indication of a portion of a dataflow graph under test, the portion including at least one executable component of the dataflow graph, the at least one executable component connected to at least one dataflow for providing input data to the at least one executable component; receiving a parameter set including parameters indicative of expected output data produced by execution of the at least one executable component; receiving the input data of the at least one executable component, the input data being indicated by the parameter set and configured to invoke a function of the at least one executable component when provided to the at least one executable component by the at least one data flow; defining a unit test for the at least one executable component based on the parameter set, the unit test comprising: providing said input data via said at least one data flow to said at least one executable component; causing processing of the input data by the at least one executable component to generate output data; and generating result data indicative of a correspondence between the generated output data and the expected output data indicated by the parameters; generating structured data based on a combination of the result data, the input data, and the data flow graph; A method comprising: generating a hash of the structured data representing a version of the structured data; storing the hash of the version of the structured data in association with the corresponding version of the dataflow graph; The method further comprises:
31. 1. A method for defining a unit test for a data flow graph executed by a data processing system and including a plurality of executable components, the method comprising: receiving an indication of a portion of a dataflow graph under test, the portion including at least one executable component of the dataflow graph, the at least one executable component connected to at least one dataflow for providing input data to the at least one executable component; receiving a parameter set including parameters indicative of expected output data produced by execution of the at least one executable component; receiving the input data of the at least one executable component, the input data being indicated by the parameter set and configured to invoke a function of the at least one executable component when provided to the at least one executable component by the at least one data flow; defining a unit test for the at least one executable component based on the parameter set, the unit test comprising: providing said input data via said at least one data flow to said at least one executable component; causing processing of the input data by the at least one executable component to generate output data; and generating result data indicative of a correspondence between the generated output data and the expected output data indicated by the parameters; generating structured data based on a combination of the result data, the input data, and the data flow graph; A method comprising: the structured data defines a relationship between a first version of the unit test defined by the parameters and a second version of the unit test defined by different parameters in a different version of the structured data, the relationship representing a previous version of the structured data, a subsequent version of the structured data, or a change between the two with respect to the structured data, and the relationship distinguishes the first version of the unit test from the second version of the unit test.
Citation Information
Patent Citations
Method and system for probe optimization for instrumenting program
JP2005302028A
Requirements-based test generation
JP2010511250A
Data recording in graph-based calculations
JP2011527052A
Software test apparatus and software test program
JP2016115175A
Framework for data-driven inspection
JP2017531855A