Skip to content

Diogo TravassosData leadership · Analytics · Decision-making

Real public data

Loan data conversion: which reconciliation catches the faults: all results

Even fully traced, 4 of 40 random faults passed every automated check, all status codes mapped wrong in the rule document both builds read, in a self-test.

Here is every fault and every check, with a sample's chance of drawing an affected loan. A check catches a fault when its result differs from its result on the correct conversion. Counts of target rules on rises only sit beside the first counts.

Faults caught by each check

Faults caught by each check
CheckChosen (19)In codeIn rulesRandom (40)In codeIn rules
Record counts and amount totals8 of 198 of 130 of 617 of 4017 of 330 of 7
Totals by status9 of 199 of 130 of 619 of 4019 of 330 of 7
Rules on the target table15 of 1910 of 135 of 622 of 4019 of 333 of 7
Code census (chosen after seeing the data)2 of 190 of 132 of 60 of 400 of 330 of 7
Line-by-line rebuild13 of 1913 of 130 of 633 of 4033 of 330 of 7
Quick checks: totals, rules and census17 of 1912 of 135 of 625 of 4022 of 333 of 7
Quick checks and the rebuild18 of 1936 of 40

A fault in code changes the conversion SQL. A fault in rules changes the rule document, which the SQL and the rebuild both read. Totals read no status, flag or income, and their source side uses the document's units. So they caught none of the 13 faults in rules.

Among the chosen faults, nothing automated caught purchased mortgages booked as originations. That raised Montana originations from 24,577 to 32,819.

Rules counted on rises only

A real go-live gate cannot read a fall in a rule's failures as a signal. It has a list of failures accepted on the first full run, and flags only counts above it. Counted that way, in a version declared before it ran, the list is the correct conversion's failures. A real first run already holds its faults, so its list would match only if every failure on it were traced to its cause. Approved exceptions were not tested.

Faults caught with rules counted on rises only
CheckChosen (19)In codeIn rulesRandom (40)In codeIn rules
Rules on the target table, rises only12 of 197 of 135 of 620 of 4017 of 333 of 7
Quick checks, rules on rises only17 of 1912 of 135 of 625 of 4022 of 333 of 7

The rules fall from 22 to 20 random faults: the two draws that drop every 504 record only lowered rule counts. On the chosen faults they fall from 15 to 12, below the 15 predicted before it ran. The three they lose also only lowered rule counts, and totals caught all three. The quick checks do not change.

Totals by kind of fault

A fault touches a count or a summed amount when it leaves records missing or doubled, or changes an approved, guaranteed or charged-off amount on the converted table. That is read from its effect, not from the totals. In code, totals caught every fault that does, 25 of 25 over both sets, and none of the other 21. This split was added after the results, in a version declared before it ran.

Random faults by kind: how many touch a count or a summed amount, and how many totals caught
Kind of faultFaultsTouch a count or summed amountCaught by totals
Records dropped444
Records loaded twice444
An amount or unit scaled866
Two fields, or day and month, swapped433
An amount rounded100
A field left empty400
A code mapped wrong300
A date shifted200
A lender name cut short300
In the rule document, every kind700

Totals on the source system's own units

Here the source side reads each amount in the unit the source system reports, not the rule document's. Totals then catch 9 of 19 chosen and 19 of 40 random faults, against 8 and 17. The three new catches are units documented wrong: the mortgage loan amount twice and the 504 approved amount once. Income is not summed, so its unit fault still passes. This check was added after the results, in a version declared before it ran.

The quick checks' range

The target rules alone caught 7 of the 17 chosen and 8 of the 25 random faults the quick checks caught. The 8 are random faults 5, 6, 9, 20, 22, 28, 29 and 36 in the table below. If every rule failure on the first run were accepted, a fault present from that run would raise no rule. The range below runs from that case to the one where every failure is traced to its cause. These figures were added after the results, in versions declared before they ran.

How big a test must be

One-sided 95% throughout. For 1 miss in 15, the upper bound is 27.9%; the two-sided interval runs up to 31.9%.

The rules in that test are judged against failures accepted on a faulted first run, by someone who does not know the fault. Judged against a correct conversion, as here, it would measure only the high end. The sizing was added after the results.

Each draw needs a fresh first run and someone blind to the fault to judge each rule failure. So this test could cost more than the rebuild it would decide on. A log of real defects after each go-live, noting whether each moved a count or a sum, costs far less.

What the rebuild must catch to pay

At 10 faults a conversion and US$800 a day, the rebuild removes 2.75 faults. It pays once an escaped fault costs over US$2,909 at 10 days, US$4,364 at 15 and US$7,273 at 25. At US$50,000 per escaped fault, it pays if it catches 5.8%, 8.7% or 14.5% of the code faults it caught here, for those days.

Faults that would escape a conversion of 10: about 5.8 with totals alone. With the quick checks, about 3.8 fully traced and 5.8 with every failure accepted. With the rebuild as well, about 1. At 2 faults a conversion, the rebuild pays above about US$21,800. Against the declared 80% line, totals alone caught 42.5% of the random faults. These figures were chosen after the results.

The sample read

Sample read: expected faults caught
SampleChosen: expectedUnder even oddsRandom: expectedUnder even odds
60 loans per source17.0 of 19231.5 of 409
200 loans per source18.3 of 19034.8 of 405

The figures are exact chances that a simple random sample per source draws at least one affected loan, summed over faults. One fixed draw per size, the same for every fault, happened to catch all 19 chosen faults, so the chances are the measure.

The 19 chosen faults

The 19 chosen faults
FaultWhereRecords hitTotalsBy statusRulesCensusRebuildSample of 60
1. 504 undisbursed and closed loans dropped by a hard-coded status filtercode7,843yesyesyes98%
2. 7(a) cancelled code misspelled in a CASE statement, so cancelled loans get no statuscode52,939yesyesyes100%
3. charge-off mapped to closed for both SBA programsrule9,137yes82%
4. 504 charge-offs mapped to paid in full by a CASE statement typocode935yesyesyes38%
5. mortgage loan amount documented as dollars (it is thousands)rule45,597yes100%
6. mortgage loan amount multiplier left out of the SQLcode45,597yesyesyesyes100%
7. mortgage applicant income documented as dollars (it is thousands)rule38,553yes100%
8. 7(a) rate left in percent for fiscal year 2021 (one batch through an older script)code51,821yesyes100%
9. lender lookup joined on bank name, so a loan fans out to every lender location sharing that namecode35,733yesyesyesyes100%
10. 7(a) loans inner-joined to active FDIC institutions, so loans with no or an inactive certificate dropcode43,223yesyesyesyes100%
11. SBA approval dates read with day and month swapped where the day is 12 or lesscode174,736yesyes100%
12. 7(a) gross and guaranteed amounts swappedcode403,622yesyesyesyes100%
13. charge-off amount read from the approved-amount columncode8,674yesyesyes80%
14. mortgage purchased loans mapped as originationsrule8,242100%
15. rows identical in every field removed by a SELECT DISTINCTcode556yesyesyes20%
16. 504 amounts rounded to whole thousandscode60,858yesyesyesyes100%
17. charge-off dates one day early (a timestamp read in the wrong time zone)code9,126yes82%
18. revolver map written from the dictionary (0 and 1; the file writes N and Y)rule403,644yesyes100%
19. status map written from the dictionary (PIF; the 7(a) file writes P I F)rule74,600yesyes100%

The 40 random faults

The 40 random faults
FaultWhereRecords hitTotalsBy statusRulesCensusRebuildSample of 60
1. charge-off date shifted 1 day earlier for every 504 loancode935yes38%
2. principal multiplied by 0.01 for a random 0.1% of mortgage recordscode54yesyesyesyes7%
3. principal and charge-off amount swapped for every 7(a) loancode403,181yesyesyesyes100%
4. principal and applicant income swapped for a random 2.0% of mortgage recordscode932yesyesyesyes71%
5. status left empty for every 504 loancode119,599yesyesyes100%
6. approval date read with day and month swapped for 7(a) loans with a fixed ratecode20,445yesyes96%
7. principal multiplied by 0.01 for 7(a) loans with a revolving linecode106,654yesyesyesyes100%
8. 7(a) code P I F converted to closed (other) by the codecode74,600yesyes100%
9. unit of the 504 approved amount taken as 100 times the documented onerule119,599yes100%
10. mortgage action code 4 mapped to denied in the rule documentrule4,803100%
11. approval date left empty for 504 loans with status PIFcode37,416yes100%
12. a random 10.0% of mortgage records loaded twicecode4,616yesyesyesyes100%
13. charge-off amount multiplied by 0.01 for a random 0.1% of 7(a) loanscode4yesyes0%
14. 504 loans with status NOT FUNDED droppedcode7,841yesyesyes98%
15. a random 2.0% of 7(a) loans loaded twicecode8,042yesyesyesyes70%
16. mortgage action code 6 mapped to withdrawn in the rule documentrule8,242100%
17. principal multiplied by 0.001 for 504 loans with status EXEMPTcode58,081yesyesyesyes100%
18. every 504 loan loaded twicecode119,599yesyesyesyes100%
19. every 504 loan droppedcode119,599yesyesyesyes100%
20. lender name left empty for 7(a) loans with a fixed ratecode62,249yesyes100%
21. mortgage action code 5 mapped to denied in the rule documentrule1,20380%
22. 504 code CHGOFF mapped to paid in full in the rule documentrule935yes38%
23. third-party amount multiplied by 100 for 504 loans with status CANCLDcode15,275yes100%
24. principal and applicant income swapped for mortgage records with action code 3code5,233yesyesyesyes100%
25. every 504 loan droppedcode119,599yesyesyesyes100%
26. third-party amount multiplied by 0.01 for 504 loans with status CHGOFFcode928yes37%
27. lender name cut to 20 characters for every 7(a) loancode274,358yes100%
28. 7(a) code CANCLD converted to paid in full by the codecode52,939yesyesyes100%
29. record kind left empty for a random 0.1% of mortgage recordscode45yesyes6%
30. a random 0.5% of 504 loans droppedcode643yesyesyes28%
31. lender name cut to 20 characters for every 504 loancode104,886yes100%
32. 504 code NOT FUNDED mapped to closed (other) in the rule documentrule7,84198%
33. third-party amount rounded to 1 for every 504 loancode4,032yes87%
34. charge-off amount multiplied by 100 for 7(a) loans with a fixed ratecode1,033yesyesyes14%
35. approval date and paid-in-full date swapped for 504 loans with status CLOSEDcode2yes0%
36. unit of the mortgage loan amount taken as 100 times the documented onerule45,597yes100%
37. mortgage action code 2 converted to denied by the codecode1,524yesyes87%
38. every 7(a) loan loaded twicecode403,644yesyesyesyes100%
39. lender name cut to 20 characters for every mortgage recordcode31,529yes100%
40. principal multiplied by 0.001 for every 7(a) loancode403,644yesyesyesyes100%

The correct conversion

568,840 records: 403,644 7(a), 119,599 504 and 45,597 mortgage records. Rows identical in every field to an earlier row are flagged, never dropped: 396 in 7(a), 58 in 504 and 102 in mortgages.

Records and approved amounts by status
StatusRecordsApproved amount
504: active58,081US$48,521 million
504: cancelled15,324US$13,567 million
504: charged off935US$703 million
504: closed other2US$1 million
504: paid in full37,416US$26,747 million
504: undisbursed7,841US$10,877 million
7(a): active246,422US$136,951 million
7(a): cancelled52,939US$24,560 million
7(a): charged off8,202US$1,422 million
7(a): paid in full74,600US$40,335 million
7(a): undisbursed21,481US$9,866 million
Mortgages: approved not accepted1,524US$346 million
Mortgages: denied5,248US$1,015 million
Mortgages: incomplete1,203US$254 million
Mortgages: originated24,577US$5,643 million
Mortgages: purchased8,242US$1,814 million
Mortgages: withdrawn4,803US$1,095 million

Six target rules fail on the correct conversion too, because the source data breaks them. In the first count a rule fires on a fault when its count moves off these, up or down. The count on rises only flags moves up.

Target rules that fail on the correct conversion
RuleRecords
principal_usd present and from 1,000 to 50,000,0001
term_months from 1 to 480 when present18
charged_off has a chargeoff_date11
paid_in_full has a paid_in_full_date1
paid_in_full_date and chargeoff_date not before origination_date2
chargeoff_usd not above principal_usd487

Limits

Faults were run one at a time. Two faults together could mask each other in totals. The faults and the checks share an author. No source carries a loan number, so ids come from file row numbers.

No tracing was tested, so every fully traced figure is an upper bound. The rebuild catches every code fault here by construction. The sample chances assume the reader spots every affected loan.