Numbers that should be refused

The table of test numbers, with a broken value ordered in about a fifth of the rows. Your application should reject each one, and the manifest says which they are.

en-US 1 table 100 rows CSV damage L3

The damage is the kind a person makes typing a number, or a system makes copying one: a check digit moved by one, two digits swapped, a routing number from a block that is never issued. Each keeps the length and the characters of a valid number, so only a real check catches it.

Import the file, then give qadg verify the manifest and what your application did with each row. It lists every row where your application did something other than what the manifest says.

The recipe

bad-check-digits.yaml
# Numbers your application should refuse, mixed in with numbers it should take.
#
# The same columns as test-numbers.yaml, with one broken value asked for in about
# a fifth of the rows: a check digit moved by one, two digits swapped, a number
# from a block that is never issued. The manifest names every value that was
# broken, what it was before and that your application should reject it. It also
# lists the damage this build could not carry out, with the reason.
#
#   qadg generate bad-check-digits.yaml
#
# writes number.csv, expectation-manifest.json and run-note.json. The same seed
# breaks the same values on every machine.
version: "0.1"
seed: "bad-check-digits"
locale: en-US
entities:
  number:
    count: 100
    fields:
      card: { generator: card }
      iban: { generator: iban }
      aba:  { generator: aba }
      isbn: { generator: isbn }
      ean:  { generator: ean }
      imei: { generator: imei }
      vin:  { generator: vin }
policy:
  layers: [L3]
  rows: 20%
  per_row: exactly_one
output:
  format: csv

Run it

Save the recipe, then run this in the same folder. This is what the program printed for it.

terminal
$ qadg generate bad-check-digits.yaml
       number: 100 rows, 7 columns
1 table, 100 rows written
17 defects ordered, 8 applied, manifest in expectation-manifest.json
9 defects could not be applied, and the manifest carries the reason for each one
  9 because this build has no implementation of them yet

What it writes

number.csv

The first 5 of its 100 rows.

cardibanabaisbneanimeivin
4242424242424242PL1225860788834403627552200413536353197868855950089523941066641001799160768723NW0URZ023EJV33462
371449635398431PL7528985921663875514376544705337889997868448570559524476814707004420924845148ZPS6T3XC9FKL37112
3530111333300000PL13560753601214483407298885066612487978685173805795269239510580037620500962722M3JAP2H4VND63932
371449635398431PL13113051451911085052202443052111552978678481804895269704748690042732565521905FEZ3HD985FJ60554
371449635398431PL81783687742531112554005654116305301978676098206095276667682480058994465440417DZUGMMG9S7R09967

expectation-manifest.json

Every defect the recipe ordered: where it is, the value before and after, and what your application should do with it. A defect this build could not apply is there too, with the reason.

run-note.json

The seed, the locale and the versions behind the run, and every table it wrote with its rows and columns.

What it damaged

The recipe ordered 17 defects, and this build applied the 8 below. The other 9 are in the manifest as not applied, each with its reason, and the run above counts them by reason.

L3.range.unassigned~ reject

number 1, column aba

015363538 → 135363531

L3.checksum.off_by_onereject

number 18, column iban

PL07160964007342802353835453 → PL07160964007342802353835454

L3.checksum.transposed_digitsreject

number 22, column ean

9525381113411 → 9552381113411

L3.range.unassigned~ reject

number 39, column aba

096941474 → 136941473

L3.checksum.off_by_onereject

number 60, column iban

PL60234212066174273701894916 → PL60234212066174273701894917

L3.checksum.transposed_digitsreject

number 65, column imei

002406616175821 → 020406616175821

L3.range.unassigned~ reject

number 94, column aba

037697839 → 137697836

L3.checksum.off_by_onereject

number 100, column vin

9TR4H4AJ9N9Y31858 → 9TR4H4AJ9N9Y31859