Padding data storage for integration testing
By identifying and utilizing invisible foreign key relationships between data stores, generating directed graphs and filling test data stores, it solves the problem of inaccurate data dependency simulation in integration testing, improves test accuracy and efficiency, and supports more Flexible expansion and integration.
Patent Information
- Application Number
- CN202380020902.9
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Priority Date
- 2022-03-09
- Filing Date
- 2023-03-09
- Publication Date
- 2024-10-01
AI Technical Summary
In integration testing, it is difficult for existing technologies to accurately simulate the implicit dependencies between multiple data stores, causing test data to inaccurately reflect the production environment and affecting the validity of test results.
By identifying invisible foreign key relationships between data stores, generating directed graphs and performing topological sorting, the test data store is populated with the ordered graph to ensure that the test data satisfies the interactive dependencies between the production data stores.
It improves the accuracy and efficiency of integration testing, can better simulate data interdependencies in production environments, reduces the amount of data generated, and supports more flexible expansion and integration.
Smart Images

Figure CN118742891A_ABST
Abstract
Description
[0001] CROSS-REFERENCE TO RELATED APPLICATIONS
[0002] This application is a continuation of U.S. patent application No. 17 / 690,579 filed on March 9, 2022, the disclosure of which is hereby incorporated by reference herein. Background Art
[0003] Integration testing is a type of software testing where multiple software services or applications are tested together. One or more services, called microservices, operate together as an application, such as a user-facing application hosted on a computing platform. When a new microservice is to be integrated into an application, the collection of microservices and the new microservice can be subjected to various tests to identify any potential errors resulting from integrating the new microservice. Microservices can depend on data generated by other microservices in the application. These dependencies are not always documented or clearly defined, such as in a database schema.
[0004] As part of performing integration testing, a test environment can be deployed that can include multiple data stores with test data that simulates production data processed by the microservices during production. Because microservices can have dependencies on data provided by other microservices that are not documented or clearly defined, the generated test data does not accurately represent production conditions, even if the test data otherwise matches the type and amount of data that the application may encounter in production. Summary of the invention
[0005] Various aspects of the present disclosure relate to populating multiple test data stores in a computing environment for integration testing. A data store populator system identifies data store relationships between tables of multiple different data stores and populates data based on those identified relationships. Data store relationships may refer to data shared across columns or rows of tables, across the same or different data stores. Various aspects of the present disclosure provide for identifying those implicit relationships for populating test data stores for testing services or applications to accurately simulate interactions between multiple relational data stores. The relationship between the values of columns across tables can be referred to as an invisible foreign key relationship. A relationship is "invisible" because it is not explicitly defined, such as in a data store schema, but still exists based on the interaction between different services updating various tables and receiving data from one table or another.
[0006] Various aspects of the present disclosure provide a method for populating test data for multiple production data stores including multiple tables in a test environment, the method comprising: receiving one or more data storage requests for multiple production data stores by one or more processors; identifying one or more invisible foreign key relationships between corresponding table pairs in the multiple production data stores by one or more processors and using the one or more data storage requests; generating a directed graph by one or more processors, wherein each production data store in the multiple production data stores is represented by a corresponding node of the directed graph, and each identified invisible foreign key relationship is represented by a corresponding edge between a first node and a second node of a corresponding table pair corresponding to the invisible foreign key relationship; topologically ordering the directed graph by one or more processors; and populating the test environment with the test data by one or more processors and using the ordered graph, the test data satisfying the identified one or more invisible foreign key relationships.
[0007] Aspects of the present disclosure provide a system, including: one or more processors, configured to: receive one or more data storage requests for multiple production data stores by the one or more processors; identify one or more invisible foreign key relationships between corresponding table pairs in the multiple production data stores by the one or more processors and using the one or more data storage requests; generate a directed graph by the one or more processors, wherein each production data store in the multiple production data stores is represented by a corresponding node of the directed graph, and each identified invisible foreign key relationship is represented by a corresponding edge between a first node and a second node of a corresponding table pair corresponding to the invisible foreign key relationship; topologically order the directed graph by the one or more processors; and fill a test environment with test data by the one or more processors and using the ordered graph, the test data satisfying the identified one or more invisible foreign key relationships.
[0008] Various aspects of the present disclosure provide one or more non-transitory computer-readable storage media having instructions that, when executed by one or more processors, cause the one or more processors to perform operations, including: receiving one or more data storage requests for a plurality of production data stores; using the one or more data storage requests to identify one or more invisible foreign key relationships between corresponding table pairs in the plurality of production data stores; generating a directed graph, wherein each production data store in the plurality of production data stores is represented by a corresponding node of the directed graph, and each identified invisible foreign key relationship is represented by a corresponding edge between a first node and a second node of a corresponding table pair corresponding to the invisible foreign key relationship; topologically ordering the directed graph; and using the ordered graph to populate a test environment with test data that satisfies the identified one or more invisible foreign key relationships.
[0009] Aspects of the present disclosure may include one or more features, including, for example, the following features (alone or in combination). In some examples, aspects of the present disclosure provide all of the following features together.
[0010] Receiving, by the one or more processors, one or more data storage requests for the plurality of production data stores includes: intercepting the one or more data storage requests via a network connecting the plurality of production data stores to a requesting device; and storing the one or more data storage requests in a persistent storage.
[0011] Intercepting the one or more data storage requests includes intercepting only read requests for reading request results from the plurality of production data stores.
[0012] Identifying one or more invisible foreign key relationships by one or more processors and using one or more data storage requests includes: executing one or more data storage requests to generate one or more request results, wherein each request result corresponds to a record of a corresponding table, the record having a primary key identifier stored in a column of the corresponding table; and for a first request result, comparing the primary key identifier of the first request result with the primary key identifiers in other tables, and for each matching primary key identifier, identifying an invisible foreign key relationship between the table storing the first result and the table storing the result corresponding to the matching primary key identifier.
[0013] The test data includes at least a portion of one or more request results.
[0014] The directed graph includes a progress status table, and topologically sorting the directed graph includes, for each node, updating the progress status table with a name of a data store represented by the node and a corresponding level in the ordering of the data store.
[0015] Populating the test environment data includes: traversing the ordered graph; and concurrently populating data across tables of each node according to the updated level in the progress status table.
[0016] Populating the test environment includes populating the test environment with test data using a progress status table of the directed graph to satisfy one or more identified invisible foreign key relationships.
[0017] The method or operation also includes: identifying a circular dependency between two or more production data stores based on the topological sort; and replacing nodes corresponding to the two or more production data stores with a composite node that is connected to one or more nodes based on edges from the node to the two or more production data stores.
[0018] A directed graph is a directed acyclic graph (DAG). BRIEF DESCRIPTION OF THE DRAWINGS
[0019] Figure 1 is a block diagram of a data storage populator system generating test data for a test environment in accordance with aspects of the present disclosure.
[0020] Figure 2A A diagram of the interrelated services in a production environment.
[0021] Figure 2B is a diagram of the invisible foreign key relationships between the tables of the production data store.
[0022] Figure 3 is an illustration of an example directed graph and progress status table generated by a database populator system in accordance with aspects of the present disclosure.
[0023] Figure 4 is a flow chart of an example process for populating a test environment with test data according to aspects of the present disclosure.
[0024] Figure 5 is a block diagram of an example environment for implementing a data storage populator system. DETAILED DESCRIPTION
[0025] Overview
[0026] Aspects of the present disclosure relate to populating multiple data stores in a test computing environment for integration testing. A data store populator system identifies data store relationships between tables of multiple different data stores in production and populates data according to those identified relationships. Data store relationships may refer to data shared across columns or rows of tables, across the same or different data stores. Even when two data stores are independent of each other according to a data store schema definition, there may be implicit, undocumented relationships between tables of different data stores.
[0027] Aspects of the present disclosure provide for identifying those implicit relationships for populating a test data store for testing a service or application. The system populates the data, for example with synthetic data, existing data, or a combination of both, which accurately simulates how data across different tables depends on each other in a production relational data store.
[0028] The relationship between the values of columns across tables can be called an invisible foreign key relationship. A relationship is "invisible" because it is not explicitly defined, such as in a data storage schema, but still exists based on the interaction between different services updating various tables and receiving data from one table to another. An invisible relationship does not have an explicit definition, such as in a database schema.
[0029] For example, the value of data in a first table in a first data store may depend on the value of data in a second table in a second data store. In order to generate test data that accurately simulates this dependency, the corresponding first table in the test environment should have data generated from the corresponding second table in the test environment. If test data were to be randomly generated without satisfying or reaching this invisible foreign key relationship, the data store in the test environment would not accurately reflect how the data is interconnected in the production environment.
[0030] By identifying relationships between tables across different data stores, aspects of the present disclosure provide methods for improving the generation of test data during integration testing, compared to randomly generating test data and test data that only depends on explicitly defined foreign key relationships. This is at least because identifying implicit dependencies between tables can later be used to generate test data that more closely resembles data in the production data store. This similarity can lead to better and more accurate integration tests than methods that ignore implicit dependent values.
[0031] The data storage populator system can intercept data storage requests sent to and from a data storage management system that manages multiple data stores. Details from the intercepted data storage requests such as data storage name, table name, and other information are encrypted and stored in persistent storage. The data storage requests can be stored as a log, where each log entry corresponds to a corresponding intercepted data storage request. Using the intercepted data storage requests, the data storage populator system can use the row level values at the column level to find the intersection between tables of different data stores for the results of the data storage requests, and identify one or more invisible foreign key relationships between the tables for each intersection (for example, the value of data in a first table in a first data store depends on the value of data in a second table in a second data store, but this dependency is not defined as part of the database schema).
[0032] As part of identifying invisible foreign key relationships, the data storage populator system may generate a data structure such as a directed graph representing a data store having multiple tables. The nodes of the graph may represent data stores. The edges between the nodes represent data storage relationships identified by the data storage populator system. Initially, the nodes may be unconnected, and the system may iteratively identify data storage relationships and update the graph with corresponding edges representing those relationships. Each node is associated with a primary key value mapping, and the data storage populator system updates the primary key value mapping with the resultant primary key in response to an intercepted request for the table or data store. Each table includes a primary key column, the primary key of the record or row of data stored in the table.
[0033] The data store populator system loads the stored data store requests, organizes the data store requests by target data store, and executes the data store requests. The results of the data store requests are stored in a temporary memory. The system iterates through the query results and updates the primary key value mapping with the corresponding primary key of each data store request result. The primary key of a record in a data store is usually a universal unique identifier, meaning that if records are shared between tables (or even between different data stores), the primary keys of the same records should match. For each primary key value mapping of each node, the system compares each primary key value in the mapping with the primary key values in the mapping of other nodes, for example, using a reverse mapping lookup data store operation. For each matching primary key value pair between the corresponding first data store and the corresponding second data store, the system updates the graph with an edge from a column of the first table in the first data store to a matching column of the second table in the second data store. The system can repeat this process until it iterates through all query results stored in the memory.
[0034] The data store populator system may manage a progress status table that stores the corresponding hierarchy associated with each table and is used to track the order in which the test data store is populated. The data store populator system may traverse the graph and topologically sort the graph, thereby storing the names and hierarchies of the tables in the data store. For example, a table may have a hierarchy of 1, indicating that it has rows with values that depend on values of a second table in a different data store (e.g., values in one table are used as input to calculate values in another table, or are needed to determine values in a table). If the values in the second table do not depend on the values of the other table, the graph may represent the second table as having a hierarchy of 0 for the relationship. Different tables may have multiple hierarchies on a value-by-value basis. Therefore, the hierarchy of a table may be a number indicating the number of rows in a table of a data store that have values that depend on values of other tables in another data store.
[0035] Using the state schedule, the data populator system can use the hierarchy fields of each table to populate the test data store in parallel with concurrency control to ensure that no table or data store is populated before its parent, such as a table or data store with a lower hierarchy. The data used to populate the test data store can be synthetic, such as randomly generated, or generated using intercepted data store requests.
[0036] Aspects of the present disclosure provide at least the following technical advantages. The data store populator system is agnostic to the data store and computing platform when generating test data for integration testing. The data store populator system can be expanded across multiple data stores as the various microservices or services provided by the platform become increasingly complex interdependencies. By selectively reusing data of values across tables or data stores that were previously identified as having invisible foreign key relationships, the system can generate less data overall. Therefore, the system can populate data faster and have a smaller data store footprint. In addition, the system can maintain data store relationships between different data stores and between tables within each data store to better simulate the characteristics of data in the production data store.
[0037] Although described in the context of integration testing, aspects of the present disclosure provide for populating multiple relational data stores with test data that satisfies invisible foreign key relationships to better simulate the interdependencies of data in a production environment of the relational data stores. Furthermore, the various services of the production environment do not need to be microservices, but can be independently developed applications that rely at least in part on data stored in different data stores corresponding to other applications.
[0038] Interdependencies can be identified as invisible foreign key relationships without the need to update and maintain a data storage schema that explicitly defines these relationships in advance. This increased flexibility has the advantage of more efficiently scaling additional microservices provided by a computing platform or environment compared to approaches that require explicitly defined relationships, which is consistent with the advantages that this paradigm brings compared to more rigid monolithic applications or service-oriented architecture approaches.
[0039] For mature or legacy services with well-defined integration test suites, the data store populator system can prune unnecessary rows by populating only the rows read from the intercepted data store request. The rows read are the rows required by the test target or test environment to verify functionality. In this way, the data store populator system can be easily integrated into existing services.
[0040] Example System
[0041] Figure 1 is a block diagram of a data storage populator system 100 generating test data for a test environment 110 in accordance with aspects of the present disclosure. Figure 1 Also shown is a production environment 120. Figure 5As described, the test environment 110 and the production environment 120 may include one or more servers or other computing devices that may be located at one or more locations. "Production" may refer to the following situation: the service 122 is active and can be actively accessed by the request device 130 to request and receive data processed by the service 122. The environment 110, 120 can host various services 122, such as microservices of applications hosted on a computing platform. The services 122 can be interconnected according to various different technologies, such as through remote procedure calls (RPCs) and / or application programming interfaces (APIs) implemented according to the REST (representational state transfer) architectural style. Other example technologies for interconnecting services 122 are also possible.
[0042] Production data stored at production data store 124 may be used to support the operation of service 122 or other types of applications. In the present specification, a data store may be any source of persistent storage, such as any type of non-transitory computer-readable medium capable of storing information, such as a hard drive, a solid-state drive (including a non-volatile memory express interface (NVMe) drive), a tape drive, an optical storage, a memory card, a ROM, a RAM, a DVD, a CD-ROM, an SD card, a writable memory, and a read-only memory. Examples of services may be microservices or applications. A data store may be, for example, a relational database managed by a database management system (DBMS) 126 or the like. A data store may store one or more tables, each having a plurality of columns and records or rows.
[0043] Requesting device 130 may be, for example, a user computing device configured to communicate with DBMS 126 via a network. Figure 5 As described above, the requesting device may connect to the DBMS 126 via the network according to a variety of different techniques.
[0044] The DBMS 126 may be configured to receive data storage requests, such as RPC calls, to read data from or write data to the production data storage 124. The test data storage 114 of the test environment 110 may also be managed by a DBMS (not shown). The structure and number of the test data storage 114 may mirror the production data storage 124. As described herein, the system 100 may populate the test data storage 114 with test data based on invisible foreign key relationships identified between tables in the production data storage 124. The DBMS 126 or another component of the production environment 120 may receive the data storage request as a log, which may be stored and retrieved by the request interceptor module 102 of the system 100 to construct the data storage request.
[0045] The production data store 124 may include a plurality of tables, whereby at least some of the stored tables include data accessed by or input from an associated application or service. The tables may be related to one another according to a predefined database schema. For example, according to the database schema, one table may be linked to another table according to one or more foreign keys, thereby defining an explicit foreign key relationship. As another example, a particular row of one or more tables may be interleaved within a particular row of another table. These relationships may be used to define data integrity within the database, such that incorrect data entries may be quickly detected and avoided or corrected within the database.
[0046] The test environment 110 may include a tester module 112 configured to perform tests against the service 122 using test data populated in the test data store 114 by the database populator system 100. The tests may be any of a variety of tests that may be performed to perform integration testing for new services or new or updated features of services currently in a production environment. In some examples, the tester module 112 is configured to test database content to ensure data integrity.
[0047] An example test may include testing the functionality of launching a device in a production environment. For example, two types of data are pre-populated into the service 122 of each service or application: (1) data required by each device, such as the state of the device, e.g., ready to launch, already in use, etc.; (2) data referencing each device, such as from a resource allocator service that maintains data on all available devices.
[0048] The request interceptor module 102 can receive a data storage request for the production data storage 124 received by the DBMS 126. The request interceptor module 102 can intercept the data storage request as a log entry and construct a data storage request from the log entry to retrieve data in response to the request. The data in response to the data storage request is called a request result. The request interceptor module 102 can be an RPC request interceptor, for example, configured to intercept and / or intercept and log the data storage request for later construction.
[0049] The request interceptor module 102 may store log entries for later construction of corresponding data storage requests. The request interceptor module 102 may log and store details of each data storage request, such as the name of the corresponding requested data storage, the requested name of the table within the requested data storage, and / or other information. Other information may include column names and primary key values for named columns, and for query operations, including, for example, complete query statements written in a database query language such as SQL. The intercepted log entries may be stored in the data storage 103. The data storage 103 is encrypted, for example, using a public key encryption scheme. The request interceptor module 102 does not store request result data with personally identifiable information (PII) that may exist in the production data storage 124.
[0050] The request interceptor module 102 may be configured to intercept only read data storage requests for reading data, and not to intercept write data storage requests for writing data. In some examples, such as in an RPC / REST microservice environment, a write (also called a create or update) request will almost always precede a read data storage request or other user-provided data from a requesting device, because the result of the previous request will serve as an input to the write request. Therefore, instead of intercepting both the read data storage request and the write data storage request, it may be sufficient to intercept only the previous read data storage request.
[0051] The request interceptor module 102 may intercept the data storage request as a log entry. The request interceptor module may intercept the data storage request when the DBMS 126 receives the request, or the request interceptor module 102 may access a memory or persistent storage in which the log entry is temporarily or permanently stored. The system 100 may later construct the data storage request offline based on the log entry. In order to encrypt the intercepted data storage request, the request interceptor module 102 of the data storage filler system 100 may implement a common, shareable public key. The data storage request is intercepted by the request interceptor module 102 and encrypted using the public key.
[0052] The system 100 may include an invisible foreign key identifier module ("identifier module") 104. The identifier module may receive log entries of data store requests intercepted by the request interceptor module 102 and group the entries by each data store of the production data store 124. The request interceptor module 102 may execute the data store request corresponding to the received log entry and store the request result in a memory. As currently described, the identifier module 104 may generate a directed graph for representing invisible foreign key relationships between tables across the production data store 124.
[0053] FIG. 2A to FIG. 2BIt shows how services can become interrelated based on dependencies created within the various data stores or tables that store the data generated by each service.
[0054] Figure 2A A diagram of the interrelated services in a production environment. Figure 2A The interrelated services shown in FIG. 1 include service A 122A to service E 122E. Service A 122A and service B 122B may be workloads implemented, for example, in software, for processing some input data and generating output data in response. At least some of the output data may be sent in response to the input data, for example, as user output. Figure 2B As shown, at least some of the output data may be stored in a corresponding table corresponding to the service, for example, in table 202A for data generated by service A 122A, or in table 202B for data generated by service B 122B. In some cases, the values of the rows in the columns of table 202B may come from an RPC call made to service A 122A.
[0055] Each service is connected to one or more other services via unidirectional edges. For example, service C 122C has two edges pointing to service B 122B and service E 122E, respectively. This indicates that the data used by service B 122B and service E 122E depends on data stored in a data store or table corresponding to service C 122C. As another example, service A 122A is connected to service B 122B via another edge pointing to service A 122A. This indicates that the data used by service A 122A depends on data stored in a data store or table corresponding to service B 122B.
[0056] Figure 2B is a diagram of invisible foreign key relationships between tables of production data stores. Data store A 204A stores table 202A, data store B 204B stores table 202B, and data store C 204C stores table 202C. Data stores A 204A to C 204C may store data stored by Figure 2A Each table 202A to 202C is shown as having N columns, but in practice, the tables need not have the same number of columns. The one-way arrows represent invisible foreign key relationships between the tables. The relationships are described as invisible and foreign key because the tables 202A to 202C do not have an explicit foreign key relationship, such as defined in the database schema, indicating that the relationship is represented by Figure 3 The one-way arrows in the relationship indicate each relationship.
[0057] Each table 202A to 202C includes one or more primary key columns, which have values such as universal unique identifiers (uu ids) A, B, and C. The universal unique identifier (also called a primary key) uniquely identifies a record in a table. The chance of generating two records with the same uu id that are not related to each other (e.g., one record depends on the other record) is negligibly small. This is generally true even for uu ids generated across different data stores, such as between data store A 204A to data store C 204C. Generating primary keys as uu ids is a common practice across different relational database technologies.
[0058] return Figure 1 , the identifier module 104 uses this feature of the primary key as a universal unique identifier to identify invisible foreign key relationships between production data stores 124. The identifier module 104 can generate a node representing each data store represented by the request result generated from the constructed data store request. Table 1 provides an example node structure.
[0059]
[0060] Table 1
[0061] In the example definition of a node as shown in Table 1, the node includes a databaseName field that stores a string of the name of the data store represented by the node, such as "datastore A". The example node definition also includes a table_primary_key_values_map, which is a map of primary keys in the represented data store, as shown in row 3 of Table 1. Finally, the example node definition may include a reverse_lookup_map, as shown in row 4 of Table 1. Initially, the identifier module 104 may create a directed graph with multiple nodes (one node representing each data store) and no edges.
[0062] The identifier module 104 iterates through the request results stored in memory and updates the table primary key value map of each node to include the primary key referenced in the request result. In addition, for each node, the identifier module 104 fills the reverse lookup map with the primary keys of the tables of other data stores also represented in the directed graph.
[0063] For each data store, the identifier module 104 compares the primary key stored to the corresponding node with the primary key in the reverse lookup map. For each match, e.g., when the primary key in the primary key value map of the node matches the primary key in the reverse lookup map, the identifier module 104 generates a unidirectional edge from the node representing the table with the matching primary key to the current node. A directed edge may be from the {column, table, data store} of the matching primary key to the {column, table, data store} of the current node being iterated through by the identifier module 104.
[0064] After iterating through each data store, the identifier module 104 topologically sorts the graph and stores the ordering of the data stores in a progress status table according to the topological sorting. A topological sort is a linear ordering of nodes in a directed graph. The ordering enforces the following condition: between node A and node B, node A precedes node B in the linear ordering. The identifier module 104 can implement any of a variety of different processes to topologically sort a directed graph, such as using Kahn's algorithm or a depth-first search. As the system sorts the graph, the system can update the progress status table as needed to track each data store and its corresponding hierarchy. The system updates the hierarchy of different data stores as needed based on the linear ordering obtained from performing a topological sort on the graph.
[0065] In some examples, before performing a topological sort, the system may traverse the directed graph and identify any circular dependencies between two or more production data stores. If a circular dependency is identified, the node that forms the circular dependency may be replaced with a composite node that represents a table of the replaced node. A directed graph that does not have a circular dependency may be a directed acyclic graph (DAG). The system sets the data store of the replaced node to the same level in the progress state hierarchy of the graph. In the graph, the composite node is connected to one or more nodes according to the edges connected to the replaced node. Using the ordered graph, the identifier module 104 generates a progress state table, which may be part of a data structure that also includes a directed graph.
[0066] Figure 3 300 and progress status table 301 generated by a database populator system according to aspects of the present disclosure. Nodes A to C represent data stores A 204A to C 204C, as shown in FIG. Figure 2B As shown and described. According to the topological sort, the ordering of the graph 300 is {C, B, A}. The identifier module 104 traverses the ordered graph 300 and updates the progress status table 301. The progress status table 301 has a first entry "Data Store C" with a level of 0, indicating that data store C is located in the first level. Data store B is located in level 1 because, for at least some data, the data store depends on data store C, but not on data store A. Data store A appears in level 2 because it depends on both data stores B and C.
[0067] The relative value of the levels between different levels may vary with implementation. For example, instead of the root node C being the lowest value, the root node may be the highest value, and therefore, all other levels are lower than the level of the root node C.
[0068] The system 100 may include a test data generator module ("generator module") 106 configured to populate a test data store 114 using a progress status table of a directed graph. The generator module 106 populates data at a lower level and then populates data at a higher level. For example, in the test data stores 114, test data store C is populated before test data store B or test data store A. The generator module 106 may populate the test data stores 114 of the test environment 110 using the progress status table. The generator module 106 populates the test data stores representing the production data stores with the lower level in the progress status table and then populates the test data stores representing the production data stores with the higher level.
[0069] exist Figure 3 In the example of the progress status table 301 of FIG. 1 , the generator module 106 populates test data store C with test data and then populates test data stores B and A. Because at least some of the records in the tables of test data stores B and A will depend on data in test data store C, the generator module 106 does not need to generate new data, but instead reuses test data from test data store C where appropriate. Similarly, when the generator module 106 populates test data store A, the generator module 106 may at least partially reuse the test data generated for test data stores B and C. The value of reuse (e.g., generating new data with fewer processing cycles or memory usage) increases as the amount of invisible foreign key relationships increases.
[0070] The test data may be populated from at least a portion of the request results of the database request (with personally identifiable information removed), or may be at least partially synthetically (e.g., randomly) generated. The generator module 106 may receive parameters for generating random or synthetic data, such as a pattern, a data type, and a data range constraint. The generator module 106 generates test data using the progress status table 301 that satisfies the invisible foreign key relationships of the data in the production data store 124.
[0071] In some examples, the generator module 106 may be implemented as multiple workers that populate test data stores in parallel. To maintain concurrency control, the workloads of the workers are assigned according to the hierarchical data in the progress status table of the graph so that workloads that depend on the parent data are not assigned before workloads that are used to populate the parent data. For example, if the progress status table has three data stores at level 0, the generator module 106 may assign separate workers to populate test data for corresponding test data stores of data stores at level 0, then assign workers to populate test data stores at level 1, and so on. The progress status table may provide concurrency control for concurrent implementations of the system 100 without requiring additional processing.
[0072] Figure 4 is a flow diagram of an example process 400 for populating a test environment with test data in accordance with aspects of the present disclosure.
[0073] According to block 410, a data storage populator system including one or more processors may receive one or more data storage requests for a plurality of production data stores. For example, to receive the one or more data storage requests, the system may intercept the data storage requests between a production data store of a production environment and a requesting device or a data storage management system. After intercepting the data storage requests, the system may store the requests in a persistent storage to identify invisible foreign key relationships and generate a directed graph. In some examples, the system only intercepts read requests for reading request results from the plurality of production data stores.
[0074] According to block 420, the system uses one or more data store requests to identify one or more invisible foreign key relationships between tables in corresponding production data store pairs in the plurality of production data stores. As described herein, the invisible foreign key relationships can be at any level of granularity within the two data stores, such as by individual record or by table.
[0075] To identify the one or more data storage requests, the system may execute the one or more data storage requests to generate one or more request results. Each request result may correspond to a record of a table having a primary key identifier or another unique identifier stored in a column of the table. The system may compare primary key identifiers between tables and identify invisible foreign key relationships between tables storing rows having matching primary key identifiers.
[0076] According to block 430, the system generates a directed graph. In the directed graph, each production data store in the plurality of production data stores is represented by a corresponding node of the directed graph, and each identified invisible foreign key relationship is represented by a corresponding edge between a first node and a second node of a corresponding production data store pair corresponding to the invisible foreign key relationship. The edges are unidirectional, and each edge points to a table having data that depends on data in a table on the other side of the edge. The edge points from the current {column, table, data store} to the matching {column, table, data store}.
[0077] The system topologically orders the directed graph, according to block 440. Before performing the topological sort, the system resolves any circular dependencies and generates composite nodes from circularly dependent nodes as needed.
[0078] According to block 450, the system populates the test environment with test data using the ordered graph. The test data satisfies the identified one or more invisible foreign key relationships. To populate the test environment with test data while satisfying the invisible foreign key relationships, the system can traverse the ordered graph according to a topological order. The system populates the data in hierarchical order using a progress status table of nodes so that records that other records depend on are populated first.
[0079] Sample computing environment
[0080] Figure 5 5 is a block diagram of an example environment 500 for implementing the data storage populator system 100. The system 100 may be implemented on one or more devices having one or more processors at one or more locations, such as in a server computing device 515. The user computing device 512 and the server computing device 515 may be communicatively coupled to one or more storage devices 530 via a network 560. The user computing device 512 may be a requesting device, as referred to herein. Figure 1 described.
[0081] The storage device 530 may be a combination of volatile and non-volatile memory or persistent storage and may be located in the same physical location as or different from the computing devices 512, 515. For example, the storage device 530 may include any type of non-transitory computer-readable medium capable of storing information, such as a hard drive, a solid-state drive, a tape drive, optical storage, a memory card, ROM, RAM, DVD, CD-ROM, writable memory, and read-only memory. The storage device 530 may include any of the following: Figure 1 The production data store 124 and / or the test data store 114 are depicted.
[0082] The server computing device 515 may include one or more processors 513 and memory 514. The memory 514 may store information accessible by the processor 513, including instructions 521 executable by the processor 513. The memory 514 may also include data 523 that can be retrieved, manipulated, or stored by the processor 513. The memory 514 may be a type of non-transitory computer-readable medium capable of storing information accessible by the processor 513, such as volatile memory and non-volatile memory. The processor 513 may include one or more central processing units (CPUs), graphics processing units (GPUs), field programmable gate arrays (FPGAs), and / or application-specific integrated circuits (ASICs), such as tensor processing units (TPUs).
[0083] Instructions 521 may include one or more instructions that, when executed by processor 513, cause one or more processors to perform actions defined by the instructions. Instructions 521 may be stored in an object code format that can be directly processed by processor 513, or in other formats, including interpretable scripts or independent source code module collections that are interpreted on demand or compiled in advance. Instructions 521 may include instructions for implementing system 100 consistent with various aspects of the present disclosure. System 100 may be executed using processor 513 and / or using other processors located remotely from server computing device 515.
[0084] Data 523 may be retrieved, stored, or modified by processor 513 according to instructions 521. Data 523 may be stored in a computer register, in a relational or non-relational database as a table with a plurality of different fields and records, or as a JSON, YAML, proto, or XML document. Data 523 may also be formatted in a computer-readable format, such as, but not limited to, a binary value, ASCII, or Unicode. In addition, data 523 may include information sufficient to identify the relevant information, such as a number, descriptive text, proprietary code, pointer, reference to data stored in other storage (including other network locations), or information used by a function to calculate the relevant data.
[0085] The user computing device 512 may also be configured similarly to the server computing device 515, with one or more processors 516, memory 517, instructions 518, and data 519. The user computing device 512 may also include a user output 526 and a user input 524. The user input 524 may include any suitable mechanism or technology for receiving input from a user, such as a keyboard, a mouse, a mechanical actuator, a soft actuator, a touch screen, a microphone, and a sensor. The user computing device 512 may be a requesting device that sends a data storage request to the data storage management system of the production environment 120.
[0086] The server computing device 515 may be configured to transmit data to the user computing device 512, and the user computing device 512 may be configured to display at least a portion of the received data on a display implemented as part of the user output 526. The user output 526 may also be used to display an interface between the user computing device 512 and the server computing device 515. The user output 526 may alternatively or additionally include one or more speakers, transducers or other audio outputs, tactile interfaces, or other tactile feedback that provides non-visual and non-audible information to a platform user of the user computing device 512.
[0087] The environment 500 may include one or both of the production environment 120 and the test environment 110. The environments 110, 120 may be implemented across one or more devices using the combination of processors, memory, and storage devices described herein with reference to the environment 500.
[0088] Although Figure 5Processors 513, 516 and memories 514, 517 are shown as being within computing devices 515, 512, but the components described in this specification (including processors 513, 516 and memories 514, 517) may include multiple processors and memories that can operate in different physical locations and not within the same computing device. For example, some of instructions 521, 518 and data 523, 519 may be stored on a removable SD card, while others may be stored in a read-only computer chip. Some or all of the instructions and data may be stored in a location that is physically away from processors 513, 516 but still accessible to the processors. For example, processors 513, 516 may include a collection of processors that can perform concurrent and / or sequential operations. Computing devices 515, 512 may each include one or more internal clocks that provide timing information, which may be used for time measurement of operations and programs run by computing devices 515, 512.
[0089] Server computing device 515 may be configured to receive requests from user computing device 512 to process data. For example, environment 500 may be part of a computing platform configured to provide a variety of services to users through various user interfaces and / or APIs that expose platform services. One or more services may be a machine learning framework, or a set of tools for generating neural networks or other machine learning models based on specified tasks and training data. User computing device 512 may receive and transmit data specifying target computing resources to be allocated for executing a neural network trained to perform a particular neural network task.
[0090] Devices 512, 515 may be able to communicate directly and indirectly over network 560. Devices 515, 512 may set up listening sockets that may accept initiated connections for sending and receiving information. Network 560 itself may include a variety of configurations and protocols, including the Internet, the World Wide Web, an intranet, a virtual private network, a wide area network, a local area network, and a private network using one or more company-proprietary communication protocols. Network 560 may support a variety of short-range and long-range connections. Short-range and long-range connections may be made over different bandwidths, such as (usually with Standards) 2.402GHz to 2.480GHz, (usually associated with communication protocols) 2.4 GHz and 5 GHz; or using multiple communication standards, such as for wireless broadband communication Additionally or alternatively, the network 560 may also support wired connections between the devices 512, 515, including through various types of Ethernet connections.
[0091] Although in Figure 55 , a single server computing device 515, a user computing device 512, and a data center 550 are shown, but it should be understood that aspects of the present disclosure may be implemented according to various different configurations and numbers of computing devices (including in paradigms for sequential or parallel processing), or through a distributed network of multiple devices. In some implementations, aspects of the present disclosure may be performed on a single device and any combination thereof.
[0092] Aspects of the present disclosure may be implemented in digital circuits, computer-readable storage media, as one or more computer programs, or a combination of one or more of the foregoing. The computer-readable storage medium may be non-transitory, for example, as one or more instructions executable by a cloud computing platform and stored on a tangible storage device.
[0093] In this specification, the phrase "configured to" is used in different contexts related to a computer system, hardware, or part of a computer program, engine, or module. When a system is said to be configured to perform one or more operations, it means that the system has appropriate software, firmware, and / or hardware installed on the system, which, when in operation, causes the system to perform the one or more operations. When a piece of hardware is said to be configured to perform one or more operations, it means that the hardware includes one or more circuits that, when in operation, receive inputs and generate outputs based on the inputs and corresponding to the one or more operations. When a computer program, engine, or module is said to be configured to perform one or more operations, it means that the computer program includes one or more program instructions that, when executed by one or more computers, cause the one or more computers to perform one or more operations.
[0094] Although the operations shown in the drawings and described in the claims are shown in a particular order, it should be understood that the operations may be performed in a different order than shown, and that certain operations may be omitted, performed more than once, and / or performed in parallel with other operations. In addition, the separation of different system components configured to perform different operations should not be understood as requiring the separation of components. The components, modules, programs, and engines described may be integrated together as a single system or as part of multiple systems.
[0095] Unless otherwise stated, the foregoing alternative examples are not mutually exclusive, but may be implemented in various combinations to achieve unique advantages. Since these and other variations and combinations of the features discussed above may be utilized without departing from the subject matter defined by the claims, the foregoing description of the examples should be made in an illustrative manner rather than in a manner that limits the subject matter defined by the claims. In addition, the examples described herein and the provision of clauses expressed as "such as," "including," etc. should not be interpreted as limiting the subject matter of the claims to specific examples; rather, these examples are intended to illustrate only one of many possible implementations. In addition, the same reference numerals in different figures may identify the same or similar elements.
[0096] With respect to substantially any plural and / or singular terms used herein, such as (where the term "element" is a substitute for any system, component, data, etc.), "one / the element", "one or more elements", "multiple elements", "aplurality of elements", "at least one element", etc., those skilled in the art may translate from the plural to the singular and / or from the singular to the plural as appropriate, depending on the context and / or application. For clarity, various singular / plural arrangements may be expressly set forth herein, and are not limiting unless expressly noted.
Claims
1. A method for populating test data in a test environment for a plurality of production data stores including a plurality of tables, characterized in that: The method comprises: receiving, by one or more processors, one or more data storage requests for the plurality of production data stores; identifying, by the one or more processors and using the one or more data store requests, one or more invisible foreign key relationships between corresponding pairs of tables in the plurality of production data stores; generating, by the one or more processors, a directed graph, wherein each production data store of the plurality of production data stores is represented by a respective node of the directed graph, and each identified invisible foreign key relationship is represented by a respective edge between a first node and a second node of a respective table pair corresponding to the invisible foreign key relationship; topologically ordering the directed graph by the one or more processors; and The test environment is populated with the test data using the ordered graph by the one or more processors, the test data satisfying the identified one or more invisible foreign key relationships.
2. The method according to claim 1, characterized in that Receiving, by the one or more processors, the one or more data storage requests for the plurality of production data stores comprises: intercepting the one or more data storage requests via a network connecting the plurality of production data stores to a requesting device; and The one or more data storage requests are stored in persistent storage.
3. The method according to claim 2, characterized in that Intercepting the one or more data storage requests includes intercepting only read requests for reading request results from the plurality of production data storages.
4. The method according to claim 2, characterized in that: Identifying, by the one or more processors and using the one or more data storage requests, the one or more invisible foreign key relationships comprises: executing the one or more data storage requests to generate one or more request results, wherein each request result corresponds to a record of a corresponding table, the record having a primary key identifier stored in a column of the corresponding table; and For a first request result, the primary key identifier of the first request result is compared with primary key identifiers in other tables, and for each matching primary key identifier, an invisible foreign key relationship between the table storing the first result and the table storing the result corresponding to the matching primary key identifier is identified.
5. The method according to claim 4, characterized in that The test data includes at least a portion of the one or more request results.
6. The method according to claim 1, characterized in that wherein the directed graph includes a progress status table, and The topologically sorting the directed graph includes: for each node, updating the progress status table with the name of the data store represented by the node and the corresponding level in the ordering of the data store.
7. The method according to claim 6, characterized in that Filling the test environment data includes: traversing the ordered graph; and Tables across each node are populated concurrently with data according to the updated level in the progress status table.
8. The method according to claim 6, characterized in that Populating the test environment includes: The test environment is populated with the test data using the progress status table of the directed graph to satisfy the one or more identified invisible foreign key relationships.
9. The method according to claim 1, characterized in that: The method further comprises: identifying, based on the topological sort, a cyclic dependency between two or more production data stores; and The nodes corresponding to the two or more production data stores are replaced with a composite node connected to one or more nodes according to edges for the nodes to the two or more production data stores.
10. The method according to claim 1, characterized in that The directed graph is a directed acyclic graph (DAG).
11. A system, characterized in that: include: One or more processors configured to: receiving, by the one or more processors, one or more data storage requests for a plurality of production data stores; identifying, by the one or more processors and using the one or more data store requests, one or more invisible foreign key relationships between corresponding pairs of tables in the plurality of production data stores; generating, by the one or more processors, a directed graph, wherein each production data store of the plurality of production data stores is represented by a respective node of the directed graph, and each identified invisible foreign key relationship is represented by a respective edge between a first node and a second node of a respective table pair corresponding to the invisible foreign key relationship; topologically ordering the directed graph by the one or more processors; as well as A test environment is populated with test data, by the one or more processors and using the ordered graph, the test data satisfying the identified one or more invisible foreign key relationships.
12. The system according to claim 11, characterized in that Upon receiving the one or more data storage requests for the plurality of production data stores, the one or more processors are configured to: intercepting the one or more data storage requests via a network connecting the plurality of production data stores to a requesting device; and The one or more data storage requests are stored in persistent storage.
13. The system according to claim 12, characterized in that When intercepting the one or more data storage requests, the one or more processors are configured to intercept only read requests for reading request results from the plurality of production data storages.
14. The system according to claim 12, characterized in that When identifying the one or more invisible foreign key relationships using the one or more data storage requests, the one or more processors are configured to: executing the one or more data storage requests to generate one or more request results, wherein each request result corresponds to a record of a corresponding table, the record having a primary key identifier stored in a column of the corresponding table; as well as For a first request result, the primary key identifier of the first request result is compared with primary key identifiers in other tables, and for each matching primary key identifier, an invisible foreign key relationship between the table storing the first result and the table storing the result corresponding to the matching primary key identifier is identified.
15. The system according to claim 14, characterized in that The test data includes at least a portion of the one or more request results.
16. The system according to claim 11, characterized in that wherein the directed graph includes a progress status table, and Wherein when topologically sorting the directed graph, the one or more processors are configured to: for each node, update the progress status table with a name of a data store represented by the node and a corresponding level in the ordering of the data store.
17. The system according to claim 16, characterized in that When populating the test environment data, the one or more processors are configured to: traversing the ordered graph; and Tables across each node are populated concurrently with data according to the updated level in the progress status table.
18. The system according to claim 16, characterized in that When populating the test environment, the one or more processors are configured to: populate the test environment with the test data using the progress status table to satisfy the one or more identified invisible foreign key relationships.
19. The system according to claim 11, characterized in that The one or more processors are further configured to: identifying, based on the topological sort, a cyclic dependency between two or more production data stores; and The nodes corresponding to the two or more production data stores are replaced with a composite node connected to one or more nodes according to edges for the nodes to the two or more production data stores.
20. One or more non-transitory computer-readable storage media having instructions that, when executed by one or more processors, cause the one or more processors to perform operations characterized in that: include: receiving one or more data storage requests for a plurality of production data stores; identifying, using the one or more data storage requests, one or more invisible foreign key relationships between corresponding pairs of tables in the plurality of production data stores; generating a directed graph, wherein each production data store of the plurality of production data stores is represented by a respective node of the directed graph, and each identified invisible foreign key relationship is represented by a respective edge between a first node and a second node of a respective table pair corresponding to the invisible foreign key relationship; topologically ordering the directed graph; as well as The test environment is populated with test data using the ordered graph, the test data satisfying the identified one or more invisible foreign key relationships.
Citation Information
Patent Citations
Populating Datastores For Integration Testing
US20230289278A1
