ContentsPlaybooks

Guide · Playbooks

Testing

Millions of rows are too many to read. So a migration is tested with a stack of checks: a few records are looked at in full, every row is counted, the totals are compared, and the business tries its own work in the application.

Also called "migration testing" · "data validation" · "user acceptance testing" for layer 4 · "test cases" or "golden records" for the validation samples. Terminology

The stack of checksas an example: 45,000 customers
The layerLooks atFindsWho checks

4Processes

A few records, used in the applicationA record that cannot be used in the way that its depth promisesThe business

3Totals

Every row, as one figureA rule that is wrong for many rowsThe business, from its own reports

2Counts

Every row, countedA row that is lost, or loaded twiceThe migration team

1Validation samples

Ten records, field by fieldA field that is mapped wrongThe business chooses them, and both check

Layers 1 and 2 are checked again on every run. Layers 3 and 4 need people: in the test cycles, and again at the rehearsal and the cutover.

The migration teamthrough the database

Did the load do what was built?

The businessthrough the application

Is the result right?

The same picture, as text
 THE STACK OF CHECKS, as an example: 45,000 customers

 THE LAYER                LOOKS AT                          FINDS                                    WHO CHECKS
 4  processes             a few records, used in            a record that cannot be used in the      the business
                          the application                   way that its depth promises
 3  totals                every row, as one figure          a rule that is wrong for many rows       the business, from its own reports
 2  counts                every row, counted                a row that is lost, or loaded twice      the migration team
 1  validation samples    ten records, field by field       a field that is mapped wrong             the business chooses them, and both check

 layers 1 and 2 are checked again on every run · layers 3 and 4 need people: in the test cycles, and again at the rehearsal and the cutover

 TWO PARTIES, TWO ROUTES
 the migration team    through the database       did the load do what was built?
 the business          through the application    is the result right?
With AI

An AI compares each validation sample with the migrated record, field by field, on every run, and reports each difference. It also drafts the validation plan from the packages. The business chooses the samples, checks in the application and signs off. A person can compare the samples by hand.

See how it is done with Convago

Why

  • Too many rows to readCombine checks that touch every row lightly with checks that look at a few records in full.WhyA person cannot check every field of every row, and ten records that are right say little about the other millions. A count covers every row and sees no values. A sample sees every value of a few rows. Each covers what the other cannot.
  • A fault for each layerUse all four layers, because each one finds a fault that the others miss.WhyA sample finds a field that is mapped wrong, and it cannot find a row that is lost. A count finds a row that is lost between the extract and the target, and it cannot see a wrong value. A total finds a rule that is wrong across many rows. A record can look right and still fail when the business tries to use it, and only the use of the record shows that.
  • Two routesHave the business reconcile through the application, apart from the counts of the migration team.WhyThe migration team compares its own tables with the target, and both were made by the same rules. If a filter or a join is wrong, the two sides are wrong together and they still agree. The business starts from its own reports, and so reaches the figure by another route.
  • Prepared with the buildWork out how each package will be validated while the package is built.WhyA check that is first worked out at the cutover is worked out under pressure, by people who have not done it before. Nobody then knows what a sign-off should rest on, and it is given on trust or held back from doubt.
  • The promise, and no moreTest each package against its depth.WhyThe depth says what a migrated record can do. Without it, a tester reports each thing that a record cannot do as a fault, and the real faults are lost among them.
  • Tested once, kept testedLock the code of a table when it agrees with its samples, and test again after any change.WhyA test holds only for the code that it ran against. After a change, the samples no longer show that the table is right, until they are checked again.
ScenarioA fault for each layer

Every check of the open orders passes. The samples agree, the count closes, and the value of the orders matches the report of the business. A warehouse worker then tries to ship a migrated order, and the application refuses, because the order has no delivery method. The new system asks for one only at shipping, and the old system did not need one. The fourth layer found what the first three could not see.

How

  • Ask for the samples earlyIn the package meeting, ask the business for about ten records of each kind, with screenshots from the old system. Ask for records that it knows well, and for a few awkward ones.
  • Check the samples field by fieldThe samples are the developer's measure of a table: its code is locked when the table agrees with them. The same samples are checked again at each cutover, in the load tables and in the application.
  • Count on every runRows in scope = rows loaded + rows rejected, for every table. Checks, counts and totals shows how to go from a count to a row.
  • Take the totals at the cut-offHave the business run and save its reports when the extract is taken, because a system may not be able to print a report for a past date. A report from that moment can agree to the cent. One from another date gives only an indication.
  • Use the systemDo with a migrated record what its depth promises: apply a payment against a balance that was carried forward, or ship an order that is fully live.
  • Explain each differenceEach rejected row and each difference in a total gets a reason, and the business decides what happens to it: see explained variance.
  • Build the validation planHave each package say how it would be validated in production: which report, which list, which samples. Those lines, read across all the packages, are the validation plan.
  • Run the whole stackIn each test cycle, run the full load and apply all four layers. The checks of the business are then practised before the rehearsal.
  • Agree what the sign-off meansA sign-off of testing says that the mapping is right and that each difference is explained. It does not say that the data is perfect. The project names who signs.
  • Leave the method to the projectHow faults are logged, who the testers are and which tool they use are the project's own practice. Layer 4 is close to what the trade calls "user acceptance testing".
ScenarioTake the totals at the cut-off

The extract is taken on 30 June. The business prints its receivables report on 2 July, after two days of payments, and the total is 18,400 lower than the migrated one. Nothing is wrong with the load. The report that was saved on 30 June agrees to the cent, so the date of the report is part of the check.

More