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
# 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.
$ 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.
| card | iban | aba | isbn | ean | imei | vin |
|---|---|---|---|---|---|---|
| 4242424242424242 | PL12258607888344036275522004 | 135363531 | 9786885595008 | 9523941066641 | 001799160768723 | NW0URZ023EJV33462 |
| 371449635398431 | PL75289859216638755143765447 | 053378899 | 9786844857055 | 9524476814707 | 004420924845148 | ZPS6T3XC9FKL37112 |
| 3530111333300000 | PL13560753601214483407298885 | 066612487 | 9786851738057 | 9526923951058 | 003762050096272 | 2M3JAP2H4VND63932 |
| 371449635398431 | PL13113051451911085052202443 | 052111552 | 9786784818048 | 9526970474869 | 004273256552190 | 5FEZ3HD985FJ60554 |
| 371449635398431 | PL81783687742531112554005654 | 116305301 | 9786760982060 | 9527666768248 | 005899446544041 | 7DZUGMMG9S7R09967 |
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~ rejectnumber 1, column aba
015363538 → 135363531
L3.checksum.off_by_onerejectnumber 18, column iban
PL07160964007342802353835453 → PL07160964007342802353835454
L3.checksum.transposed_digitsrejectnumber 22, column ean
9525381113411 → 9552381113411
L3.range.unassigned~ rejectnumber 39, column aba
096941474 → 136941473
L3.checksum.off_by_onerejectnumber 60, column iban
PL60234212066174273701894916 → PL60234212066174273701894917
L3.checksum.transposed_digitsrejectnumber 65, column imei
002406616175821 → 020406616175821
L3.range.unassigned~ rejectnumber 94, column aba
037697839 → 137697836
L3.checksum.off_by_onerejectnumber 100, column vin
9TR4H4AJ9N9Y31858 → 9TR4H4AJ9N9Y31859