Test Data Challenge

A Tester, located at an offshore location in India, needs to generate hundreds to thousands of X12 EDI 837 test documents for a Medical Organization, Acme Health, located in the United States. Each test document, must simulate a different medical scenario, and each document must be associated to an actual patient within the production database; however, with the exception of a patient's given externalId (already defined within the production database) the security department, at Acme Health, will not allow Testers access to any private patient data, within the production database, necessary to produce the test document.  


This creates a challenge for the Tester and for Acme Health.  How may both the Tester produce X12 EDI 837 test documents that Acme Health may use for testing, if the Tester cannot have access to private patient data within the Acme Health production database?  This is where the Test Data Mapping Design Pattern comes in to play using a concrete mapping table to store GenRocket synthetically generated data, that simulates all necessary patient data into a mapping table. 


Mapping Table Diagram

The table, shown below, defines the patient data that must be synthetically generated to simulate and replace the actual private patient data that may not be accessed from Acme Health's production database. 


Mapping Table Example


Utilizing the Test Data Mapping Design Pattern

What makes the Mapping Table utilize the Test Data Mapping Design Pattern, is its use of the mapping_key column.  When the mapping table is used by Testers in India, to produce test documents, the mapping_key column is null.  When the mapping table is used within Acme Health to match test documents to an actual patient within their production database, each mapping_key is set to the value of a given patient's externalId



Story 1 - GenRocket is used to Generate Synthetic Test Data to a Mapping Table

Testers and Acme Health need to generate synthetic patient test data into a mapping table that they can both share. The data columns within the mapping table will contain synthetically generated data that simulates the private patient data within the Acme Health production database.  The data columns are the following:

  • id - starts at 100,000 and increments by 1
  • address - random street with incremental number
  • city - US state capital
  • state - state that matches US state capital
  • zip_code - zipCode that matches US state capital
  • county - county that matches US state capital
  • birth_date - ages must be between 20 and 90
  • admission_date - within the last 365 days - 31 days from today
  • discharge_date - must be within 1 to 20 days of the admission date 
  • date_of_death - must be 75% null and when not null, plus or minus 5 days of the discharge_date
  • exact_age - must match the years of the birth_date
  • telephone_number - random
  • fax_number - random
  • email_address - pattern 
  • ssn - sequential pattern
  • medical_record - starts at 1,000,000 and increments by 1
  • beneficiary_number - starts at 1,000,000 and increments by 1
  • account_number - starts at 1,000,000 and increments by 1


Actors

  • GenRocket - Test Data Generation Platform
  • Database - The database the contains the Mapping Table 
  • MappingTable - Contains the synthetically generated data and contains two columns used for key, value mapping (id and mapping_key)
  • MappingScenario - The name of the Scenario that will generate the mapping test data and populate a local database.


Action

  1. Create a Project called, MappingTestData
  2. Create a GenRocket Domain, called Mapping
  3. Set the Domain.id instance variable to 1000000
  4. Set the Domain.loopCount instance variable to 100000 
  5. Add an Attribute for each column, defined above, and assign the appropriate Generator(s) to each Attribute, to meet the test data generation requirements
  6. Attach a GenericSQLInsertV2Receiver to the Domain and set the parameters to populate an appropriate Database Mapping Table
  7. Create a Scenario using the GenRocket Quick Scenario
  8. GenRocket creates a Scenario called, MappingScenario
  9. Download the Scenario
  10. Run the Scenario to populate the Mapping Table.


Story 2 - A Tester uses the Mapping Table data when generating X12 EDI 837 test documents

A Tester at an offshore location in India, wants to generate one thousand X12 EDI 837 test documents and, for each test document, query specific test data from a Mapping Table so the generated test documents can be shared by their client, Acme Health, during test data validation.


Actors

  • GenRocket - Test Data Generation Platform
  • Tester - An offshore tester
  • MappingScenario - The name of the Scenario that will generate the mapping test data and populate a local database
  • MappingTable - Contains the synthetically generated data and contains two columns used for key, value mapping (id and mapping_key)
  • Test Data Query - Allows query configuration to an SQL database to consume production data or synthetic data during test data generation 
  • Test Data Permutation - Allows the configuring of a suite of test data cases
  • Test Data Case - Allows the configuration of a specific permutation for test data generation
  • ScenarioChainSet - Allows for a set of Scenario Chains to run as a single Scenario
  • EDIPerm - The name of the Test Data Permutation configuration
  • MappingQuery - The name of the Test Data Data Query configuration

Action

  1. The Tester uses GenRocket to run the MappingScenario to populate the local database MappingTable with 100,000 rows of synthetic test data
  2. The Tester creates a new GenRocket Project
  3. The Tester goes to the EDI store and selects to create an X12 EDI 837 document
  4. GenRocket creates a new X12 EDI 837 document 
  5. The Tester goes to the document and selects to create a new Test Data Query, called MappingQuery
  6. The Tester creates a query to select test data from the Mapping Table for specific GenRocket Domain Attributes
  7. The Tester goes back to the document and selects to create a new Test Data Permutation, called EDIPerm 
  8. The Tester creates a new Test Data Case within the Test Data Permutation
    • The Tester selects the ControlHeader Domain and sets the loopCount to 1000
    • The Tester selects to reference the Test Data Query, called MappingQuery
  9. The Tester downloads the EDIPerm configuration file to their local computer
  10. The Tester downloads the EDI ScenarioChainSet to their local computer
  11. The Tester runs GenRocket using the EDIPerm and ScenarioChainSet
  12. GenRocket generates 1000 X12 EDI 837 test documents. 


Story 3 - Acme Health wants to use synthetically generating X12 EDI 837 test documents for test validation

Acme Health wants to run a set of validations from one thousand X12 EDI 837 test documents, generated from their offshore test site in India, against a copy of their production database. The challenge with the validations is that each test document must be associated with real patients from the copy production database, but the generated test documents have no knowledge or association to a real patient. So, Acme Health will use the shared Mapping Table to map each of the first one thousand rows to a unique patient via the patient externalId that exists in the copy production database.


Actors

  • GenRocket - Test Data Generation Platform
  • Tester - A tester within the Acme Health corporate headquarters 
  • Mapping Table - Contains the synthetically generated data and contains two columns used for key, value mapping (id and mapping_key)
  • Patient externalId - A unique and non-sensitive patient identifier that may be used by external sources
  • Validation Scripts - Code used to validate X12 EDI test documents against the copy production database using the Mapping Table to map a patient to a given test document
  • Test Documents - The synthetically generated X12 EDI test documents
  • MappingTable SQL File - contains a set of SQL insert statements  
  • Database - A copy of the production database that is used for test document validation

Action

  • The Tester imports a copy of the MappingTable into the copy production database
  • The Tester writes a query to select externalIds from one thousand patients, within a given copy production database table, and updates the mapping_key column for the first one thousand rows in the MappingTable
  • The Tester runs Validation Scripts using the one thousand Test Documents