Test Data for a Core System Replacement: When to Start, by Unit, Integration and Migration Stage

· DataMint · 9 min read

At the kickoff meeting for integration testing in a core system replacement project (called a "next-generation" project in Korea), a familiar exchange takes place. "The test scenarios are reviewed and the programs are deployed. So when does data arrive in the integration test DB?" The answer is usually "when the migration program is ready" or "when the client's security team approves."

To answer the question in the title first: test data for a core system replacement has to be prepared right after kickoff, and the first data should exist by the time the TO-BE design is finished at the latest. The reason is simple. Unit tests, integration tests, performance tests and migration rehearsals all need different data, and some of it takes weeks to produce.

This post covers what test data each stage needs, what happens when preparation is late, a stage-by-stage preparation table, and how to generate test data. The later part describes how DataMint Core, the product we build, reduces this work.

Test data for a core system replacement differs by stage

The biggest difference between a core system replacement and a system enhancement project is that a new TO-BE schema is created. The table structure, code scheme and key design differ from the AS-IS. So "just copy the production DB" does not work from the start. There is no data yet to put into the new schema.

  • Unit tests: tens to thousands of rows in the TO-BE tables are enough. But boundary values and exception codes must be evenly represented, and foreign keys and CHECK constraints must be satisfied or the screens will not load.
  • Integration tests: the business flow has to run from start to finish. Customers, accounts, transactions and consultation history must match each other, and the same customer must appear with the same number in the interfacing systems. Defects only surface when the exception cases of real business are in the data.
  • Performance tests: row counts and distribution must match production. A response time measured on 10,000 rows means nothing at 100 million rows.
  • Migration rehearsals: the entire AS-IS is moved. The goal is to reconcile row counts and measure migration time, so a portion is not enough.
  • User testing and training: business users must be able to look at the data and say "yes, this is our work." At the same time, real customer names must not appear on training room screens.

Each stage needs a different amount, shape and source of data, and it is hard to fill every stage with one method. In short, made-up data fits the earlier stages and transformed production data fits the later ones. The schedule needs to say who prepares each, and from when.

What happens in integration testing when test data is late

Projects that prepare late repeat the same patterns.

The migration program produces the integration test data

This is a common setup in core system replacements. The migration program that moves AS-IS data to the TO-BE becomes the supplier of integration test data. That means there is no integration test data until the migration program is complete. And if the migration program has defects, test defects and migration defects get mixed together, so finding the cause takes longer.

A production dump taken in a hurry stays in the development environment

Under schedule pressure, someone decides "let's use a production dump for now and delete it later." Development and test environments have more people with access than production and looser controls. For financial companies, Korea's Electronic Financial Supervision Regulations say not to use customer information in testing, and where it is unavoidable, to transform it before use and delete it when testing ends. The detailed conditions are in the exceptions and conditions in the regulation.

Hand-made data cannot keep up with the relationships

Creating 100 customers in a spreadsheet and loading them with INSERT statements takes a day. Matching the relationships through those customers' accounts, cards, transactions, limits and consultation history takes a week. In a replacement schema with hundreds of tables, it never ends.

You learn "how many hours it takes" only right before the migration rehearsal

If rehearsal day arrives without ever having moved the full data once, that is the day you first learn the migration time. If the cutover window is a two-day weekend and the rehearsal took thirty hours, the next rehearsal slips while you change the partitioning, parallelism and loading method. Moving even just a few of the large tables early avoids this.

Stage-by-stage test data preparation table: when, what, and from what

The table below is what the PMO, the client's DBA and the security officer should agree on in one go at kickoff. The timing shows the usual order. Move it earlier or later to fit the project schedule. Data preparation has to start one step ahead of each test stage, or the schedule slips.

Test data preparation table for a core system replacement project
WhenWhat to prepareData sourceWhat to check
Kickoff to analysisList of personal data columns, export and import procedure, where transformation happens, retention periodAS-IS catalog and samplesWho approves, and where the record is kept
TO-BE design completeData for unit testsData made up from the TO-BE schemaAre foreign keys, unique keys and CHECK constraints satisfied?
Mid-developmentData for integration testsAS-IS production data, transformed and reducedAre relationships intact? Is any personal data left?
After integration testingData for performance tests and migration rehearsalsThe entire AS-IS, transformedDo row counts and totals match? How many hours does it take?
User testing and trainingData business users recognizeTransformed data, reset for each roundDoes it return to the initial state between rounds?

The first row is the one most often missing. The list of personal data columns and the approval procedure are questions that come up again at every test stage, so deciding them once at kickoff speeds up everything after. How to build the column list is covered separately in how to find personal data columns.

When the TO-BE schema is empty: starting unit tests with generated test data

Unit test data does not need to look at production. It can be built from the structure of the new schema. If you build it yourself, order matters.

  • Parents first: fill parent tables such as codes, branches and products first, and pick the children's foreign keys from values that actually exist in the parent.
  • Read the constraints: if there is a CHECK constraint such as STATUS IN ('A','B'), generate within those values. If the end date must be after the start date, keep that order.
  • No collisions in unique keys: filling them with random numbers produces duplicates at around a few hundred thousand rows, and the load fails.
  • Formatted values in their format: resident registration numbers (RRN, Korea's national ID number), business registration numbers and card numbers must be correct down to the check digit to pass on-screen validation.

The limits of made-up data are also clear. Its distribution is spread evenly, so the odd data found only in production, such as an account that was closed and then reactivated, does not appear. That is why production data is needed from integration testing on.

AS-IS production data as integration test data: transformation and subsetting

Integration test data is closest to reality when only the personal data in AS-IS production data is changed and the rest is left as is. Two conditions have to hold.

First, the same original value must become the same value everywhere. If the RRN in the customer table and the RRN in the card table are changed to different values, joins break. In the messages exchanged with interfacing systems, the same customer must also have the same number. This problem is worked through with an example in when masking breaks your joins.

Second, if the integration test environment does not need all of production, the data must be reduced while keeping relationships. Cutting the first 10,000 rows from each table produces accounts without customers and transactions without accounts. You have to choose a driving table and reduce parents and children together along the foreign keys. Older AS-IS systems often do not declare foreign keys, so writing the relationships down comes first.

If the replacement moves to a different DB, there is one more thing. When the AS-IS is Oracle and the TO-BE is PostgreSQL, empty strings, dates and character lengths can change without any error. See also 7 things to watch when moving to a different DB.

Preparing replacement project test data with DataMint Core

DataMint Core is installed on the client's internal network. It turns the data in production databases into test data with no personal data and moves it to development and test DBs. The transformation finishes inside the production network, and only the changed values reach the test DB. It connects to the stage-by-stage preparation above as follows.

When this happens, this feature, and what changes
WhenCore featureWhat changes
The TO-BE schema is empty and unit tests cannot startSynthetic data: reads only the structure and creates rows that satisfy foreign keys, unique keys and CHECK constraintsUnit tests start right after design, with no production data leaving production
The AS-IS is Oracle and the TO-BE is a different DBCross-database migration and transformation in one step. Set the target schema and table names, and load into existing target tables under different column namesNo separate dump, conversion script and load
The integration test environment does not need all of productionSubsetting: reduces parents and children together by a condition or ratio on the driving table. Relationships are registered for tables without foreign keysNo accounts without customers, no transactions without accounts
Data has to return to its initial state for every test roundBookmarks: takes a copy inside the test DB and rolls back to that pointNo re-migration from production, and no new approval
Runs that use production data have to be controlledApproval: runs only after approval, and the request reason and approval comment are kept in the run recordWho took the data and why can be submitted as is at audit time

Synthetic data does not read a single row of the production DB. RRNs and card numbers are made-up numbers with valid check digits, and emails use domains reserved for testing. Running the same job again produces the same data, so the expected values of unit tests can be fixed.

For integration test transformation, you attach a rule to each column on the job screen. The product first suggests rules based on column names and comments, and the person in charge reviews and corrects them. The same original value becomes the same value across tables and runs, so joins are kept. An RRN inside long text such as a consultation memo is also changed to the same value as in the column.

Column rule step of the DataMint Core job editor. Transformation rules are attached to the RRN, mobile phone number, email and home address columns of the CUST_MASTER table
The column rule step of job creation. Rules are attached to the RRN, phone number, email and address columns, while code and date columns pass through unchanged. (The console is shown in Korean. The data on screen is demo data.)

For subsetting, you set only the driving table and a condition (or ratio) in the table step of the job, and Core builds the condition for each connected table. It does not create temporary tables in the production DB. It only reads. When you select by ratio, the same rows are picked on every run, so you can test with the same customers across rounds. If the AS-IS has no declared foreign keys, Core finds relationship candidates by column name, shows how well they match on actual values, and a person then registers them. We built a ledger-style schema of 22 tables with no foreign keys at all on Oracle and PostgreSQL and tested it with four scenarios. Apart from the relationships the screen flagged separately, none of the 36 relationships were broken in the test DB.

Core also handles columns added to the AS-IS during the project. A column that appears in production after the job was created is not passed to the test DB until the person in charge reviews it, and Core reports it in the job list and by notification. Speed matters for large migrations such as a migration rehearsal. In our own measurement on development hardware, 100 million rows (19 GB) between PostgreSQL databases took 3 minutes 31 seconds, and 4 minutes 47 seconds with four transformation rules applied. The DB and the engine shared one PC in that test, so it has to be measured again in the client's environment.

With approval turned on, a run that uses production data only starts once it is approved. When a developer writes a reason and submits a request, it appears in the approver's approval list, and the approval comment is kept with the run record. In a project where staff change often, this record turns out to be the most useful thing later.

DataMint Core approval screen showing the requester, request time, reason and approval steps of a run request for card issuance test data, with approve and reject buttons
The approval screen. It shows the requester, reason and approval steps, and the approver leaves an approve or reject comment. (The data on screen is demo data.)

Core system replacement test data: frequently asked questions

Can't the migration program produce the integration test data?

In the end, it has to. But integration testing starts before the migration program is complete, so separate data is needed to fill the gap or the schedule slips. It also makes it easier to tell migration program defects from business program defects.

Can integration testing be done with synthetic data alone?

For functions that do not exist in the AS-IS, such as new business, yes. For existing business, it is difficult. Exception data that exists only in production is what exposes defects, and made-up data has no such cases.

When should the test data de-identification plan be written?

At kickoff. If the target columns, transformation method, approval procedure, retention and disposal are agreed at the kickoff report, the same discussion is not repeated at each stage. How to validate the migration rehearsal continues in row count reconciliation and validation in a migration rehearsal.

Summary: prepare core system replacement test data one step ahead

  • Unit tests use data made up from the TO-BE structure. From integration testing on, use transformed production data.
  • If integration test data depends only on the migration program, testing is late by as much as the migration program is late.
  • In transformed data, the same original must have the same value, and when reducing, reduce along the relationships.
  • Decide the list of personal data columns, the approval procedure and the retention period once, at kickoff.

At the next weekly meeting, open the schedule and write one line for each test stage: "when does the data come, and from where?" The stage with a blank is the one that will slip first. If your project modifies a system that is in operation, read on with preparing test data for a system enhancement project.

  • #core system replacement
  • #next-generation system project
  • #integration test data
  • #test data generation
  • #migration rehearsal
  • #synthetic data
  • #test data de-identification

Reviewing how you handle test data?

Tell us how you do it today and what databases you run, and we will look at the options with you.

More posts