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
| Check | Chosen (19) | In code | In rules | Random (40) | In code | In rules |
|---|---|---|---|---|---|---|
| Record counts and amount totals | 8 of 19 | 8 of 13 | 0 of 6 | 17 of 40 | 17 of 33 | 0 of 7 |
| Totals by status | 9 of 19 | 9 of 13 | 0 of 6 | 19 of 40 | 19 of 33 | 0 of 7 |
| Rules on the target table | 15 of 19 | 10 of 13 | 5 of 6 | 22 of 40 | 19 of 33 | 3 of 7 |
| Code census (chosen after seeing the data) | 2 of 19 | 0 of 13 | 2 of 6 | 0 of 40 | 0 of 33 | 0 of 7 |
| Line-by-line rebuild | 13 of 19 | 13 of 13 | 0 of 6 | 33 of 40 | 33 of 33 | 0 of 7 |
| Quick checks: totals, rules and census | 17 of 19 | 12 of 13 | 5 of 6 | 25 of 40 | 22 of 33 | 3 of 7 |
| Quick checks and the rebuild | 18 of 19 | 36 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.
| Check | Chosen (19) | In code | In rules | Random (40) | In code | In rules |
|---|---|---|---|---|---|---|
| Rules on the target table, rises only | 12 of 19 | 7 of 13 | 5 of 6 | 20 of 40 | 17 of 33 | 3 of 7 |
| Quick checks, rules on rises only | 17 of 19 | 12 of 13 | 5 of 6 | 25 of 40 | 22 of 33 | 3 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.
| Kind of fault | Faults | Touch a count or summed amount | Caught by totals |
|---|---|---|---|
| Records dropped | 4 | 4 | 4 |
| Records loaded twice | 4 | 4 | 4 |
| An amount or unit scaled | 8 | 6 | 6 |
| Two fields, or day and month, swapped | 4 | 3 | 3 |
| An amount rounded | 1 | 0 | 0 |
| A field left empty | 4 | 0 | 0 |
| A code mapped wrong | 3 | 0 | 0 |
| A date shifted | 2 | 0 | 0 |
| A lender name cut short | 3 | 0 | 0 |
| In the rule document, every kind | 7 | 0 | 0 |
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.
- Faults caught by the quick checks: 10 to 17 of 19 chosen, 17 to 25 of 40 random.
- Random faults that move a charge-off figure, missed: 1 to 4 of 15, 6.7% to 26.7%. The low end is past the 10% line.
- Random faults in code past the quick checks: 11 to 16 of 33. The rebuild caught all of them.
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%.
- A test of 29 faults with no miss puts the bound at 9.8%. But it would pass only 13.5% of the time at 1 in 15, and 4.7% at 10%, so it would rarely settle anything.
- 436 charge-off-moving faults with 33 misses or fewer put the bound under 10%. At 1 in 15 that happens 80% of the time.
- Draws. At 15 charge-off-moving faults in 40, reaching 436 takes 1,163 draws on average, and 1,236 for a 95% chance.
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 | Chosen: expected | Under even odds | Random: expected | Under even odds |
|---|---|---|---|---|
| 60 loans per source | 17.0 of 19 | 2 | 31.5 of 40 | 9 |
| 200 loans per source | 18.3 of 19 | 0 | 34.8 of 40 | 5 |
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
| Fault | Where | Records hit | Totals | By status | Rules | Census | Rebuild | Sample of 60 |
|---|---|---|---|---|---|---|---|---|
| 1. 504 undisbursed and closed loans dropped by a hard-coded status filter | code | 7,843 | yes | yes | yes | 98% | ||
| 2. 7(a) cancelled code misspelled in a CASE statement, so cancelled loans get no status | code | 52,939 | yes | yes | yes | 100% | ||
| 3. charge-off mapped to closed for both SBA programs | rule | 9,137 | yes | 82% | ||||
| 4. 504 charge-offs mapped to paid in full by a CASE statement typo | code | 935 | yes | yes | yes | 38% | ||
| 5. mortgage loan amount documented as dollars (it is thousands) | rule | 45,597 | yes | 100% | ||||
| 6. mortgage loan amount multiplier left out of the SQL | code | 45,597 | yes | yes | yes | yes | 100% | |
| 7. mortgage applicant income documented as dollars (it is thousands) | rule | 38,553 | yes | 100% | ||||
| 8. 7(a) rate left in percent for fiscal year 2021 (one batch through an older script) | code | 51,821 | yes | yes | 100% | |||
| 9. lender lookup joined on bank name, so a loan fans out to every lender location sharing that name | code | 35,733 | yes | yes | yes | yes | 100% | |
| 10. 7(a) loans inner-joined to active FDIC institutions, so loans with no or an inactive certificate drop | code | 43,223 | yes | yes | yes | yes | 100% | |
| 11. SBA approval dates read with day and month swapped where the day is 12 or less | code | 174,736 | yes | yes | 100% | |||
| 12. 7(a) gross and guaranteed amounts swapped | code | 403,622 | yes | yes | yes | yes | 100% | |
| 13. charge-off amount read from the approved-amount column | code | 8,674 | yes | yes | yes | 80% | ||
| 14. mortgage purchased loans mapped as originations | rule | 8,242 | 100% | |||||
| 15. rows identical in every field removed by a SELECT DISTINCT | code | 556 | yes | yes | yes | 20% | ||
| 16. 504 amounts rounded to whole thousands | code | 60,858 | yes | yes | yes | yes | 100% | |
| 17. charge-off dates one day early (a timestamp read in the wrong time zone) | code | 9,126 | yes | 82% | ||||
| 18. revolver map written from the dictionary (0 and 1; the file writes N and Y) | rule | 403,644 | yes | yes | 100% | |||
| 19. status map written from the dictionary (PIF; the 7(a) file writes P I F) | rule | 74,600 | yes | yes | 100% |
The 40 random faults
| Fault | Where | Records hit | Totals | By status | Rules | Census | Rebuild | Sample of 60 |
|---|---|---|---|---|---|---|---|---|
| 1. charge-off date shifted 1 day earlier for every 504 loan | code | 935 | yes | 38% | ||||
| 2. principal multiplied by 0.01 for a random 0.1% of mortgage records | code | 54 | yes | yes | yes | yes | 7% | |
| 3. principal and charge-off amount swapped for every 7(a) loan | code | 403,181 | yes | yes | yes | yes | 100% | |
| 4. principal and applicant income swapped for a random 2.0% of mortgage records | code | 932 | yes | yes | yes | yes | 71% | |
| 5. status left empty for every 504 loan | code | 119,599 | yes | yes | yes | 100% | ||
| 6. approval date read with day and month swapped for 7(a) loans with a fixed rate | code | 20,445 | yes | yes | 96% | |||
| 7. principal multiplied by 0.01 for 7(a) loans with a revolving line | code | 106,654 | yes | yes | yes | yes | 100% | |
| 8. 7(a) code P I F converted to closed (other) by the code | code | 74,600 | yes | yes | 100% | |||
| 9. unit of the 504 approved amount taken as 100 times the documented one | rule | 119,599 | yes | 100% | ||||
| 10. mortgage action code 4 mapped to denied in the rule document | rule | 4,803 | 100% | |||||
| 11. approval date left empty for 504 loans with status PIF | code | 37,416 | yes | 100% | ||||
| 12. a random 10.0% of mortgage records loaded twice | code | 4,616 | yes | yes | yes | yes | 100% | |
| 13. charge-off amount multiplied by 0.01 for a random 0.1% of 7(a) loans | code | 4 | yes | yes | 0% | |||
| 14. 504 loans with status NOT FUNDED dropped | code | 7,841 | yes | yes | yes | 98% | ||
| 15. a random 2.0% of 7(a) loans loaded twice | code | 8,042 | yes | yes | yes | yes | 70% | |
| 16. mortgage action code 6 mapped to withdrawn in the rule document | rule | 8,242 | 100% | |||||
| 17. principal multiplied by 0.001 for 504 loans with status EXEMPT | code | 58,081 | yes | yes | yes | yes | 100% | |
| 18. every 504 loan loaded twice | code | 119,599 | yes | yes | yes | yes | 100% | |
| 19. every 504 loan dropped | code | 119,599 | yes | yes | yes | yes | 100% | |
| 20. lender name left empty for 7(a) loans with a fixed rate | code | 62,249 | yes | yes | 100% | |||
| 21. mortgage action code 5 mapped to denied in the rule document | rule | 1,203 | 80% | |||||
| 22. 504 code CHGOFF mapped to paid in full in the rule document | rule | 935 | yes | 38% | ||||
| 23. third-party amount multiplied by 100 for 504 loans with status CANCLD | code | 15,275 | yes | 100% | ||||
| 24. principal and applicant income swapped for mortgage records with action code 3 | code | 5,233 | yes | yes | yes | yes | 100% | |
| 25. every 504 loan dropped | code | 119,599 | yes | yes | yes | yes | 100% | |
| 26. third-party amount multiplied by 0.01 for 504 loans with status CHGOFF | code | 928 | yes | 37% | ||||
| 27. lender name cut to 20 characters for every 7(a) loan | code | 274,358 | yes | 100% | ||||
| 28. 7(a) code CANCLD converted to paid in full by the code | code | 52,939 | yes | yes | yes | 100% | ||
| 29. record kind left empty for a random 0.1% of mortgage records | code | 45 | yes | yes | 6% | |||
| 30. a random 0.5% of 504 loans dropped | code | 643 | yes | yes | yes | 28% | ||
| 31. lender name cut to 20 characters for every 504 loan | code | 104,886 | yes | 100% | ||||
| 32. 504 code NOT FUNDED mapped to closed (other) in the rule document | rule | 7,841 | 98% | |||||
| 33. third-party amount rounded to 1 for every 504 loan | code | 4,032 | yes | 87% | ||||
| 34. charge-off amount multiplied by 100 for 7(a) loans with a fixed rate | code | 1,033 | yes | yes | yes | 14% | ||
| 35. approval date and paid-in-full date swapped for 504 loans with status CLOSED | code | 2 | yes | 0% | ||||
| 36. unit of the mortgage loan amount taken as 100 times the documented one | rule | 45,597 | yes | 100% | ||||
| 37. mortgage action code 2 converted to denied by the code | code | 1,524 | yes | yes | 87% | |||
| 38. every 7(a) loan loaded twice | code | 403,644 | yes | yes | yes | yes | 100% | |
| 39. lender name cut to 20 characters for every mortgage record | code | 31,529 | yes | 100% | ||||
| 40. principal multiplied by 0.001 for every 7(a) loan | code | 403,644 | yes | yes | yes | yes | 100% |
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.
| Status | Records | Approved amount |
|---|---|---|
| 504: active | 58,081 | US$48,521 million |
| 504: cancelled | 15,324 | US$13,567 million |
| 504: charged off | 935 | US$703 million |
| 504: closed other | 2 | US$1 million |
| 504: paid in full | 37,416 | US$26,747 million |
| 504: undisbursed | 7,841 | US$10,877 million |
| 7(a): active | 246,422 | US$136,951 million |
| 7(a): cancelled | 52,939 | US$24,560 million |
| 7(a): charged off | 8,202 | US$1,422 million |
| 7(a): paid in full | 74,600 | US$40,335 million |
| 7(a): undisbursed | 21,481 | US$9,866 million |
| Mortgages: approved not accepted | 1,524 | US$346 million |
| Mortgages: denied | 5,248 | US$1,015 million |
| Mortgages: incomplete | 1,203 | US$254 million |
| Mortgages: originated | 24,577 | US$5,643 million |
| Mortgages: purchased | 8,242 | US$1,814 million |
| Mortgages: withdrawn | 4,803 | US$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.
| Rule | Records |
|---|---|
| principal_usd present and from 1,000 to 50,000,000 | 1 |
| term_months from 1 to 480 when present | 18 |
| charged_off has a chargeoff_date | 11 |
| paid_in_full has a paid_in_full_date | 1 |
| paid_in_full_date and chargeoff_date not before origination_date | 2 |
| chargeoff_usd not above principal_usd | 487 |
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.
The summaryThe follow-up: 40 random faultsAll resultsLinking lendersMethod and checks