Sub topic 12
Testing, validating, and governing a screening program
This chapter assumes you know how names are normalized and matched, how thresholds trade false positives against missed matches, and how alerts are dispositioned and recorded. Here you will learn how to show that the whole program works and who is accountable for it.
Why testing matters
A screening system can run every day and still fail. A list feed may stop updating. A normalization change may break matching for one alphabet. A threshold may be moved and nobody records why. Alert volume tells you the system is busy. It does not tell you the system is catching the right names.
Testing answers two questions:
- Does the system find the matches it should (effectiveness)?
- Does the program run as designed, with records to prove it (governance)?
Three kinds of testing
| Test | What it checks | Typical evidence |
|---|---|---|
| Data and list integrity | Every list update loaded fully, and customer data reached the screening engine | Record counts, load logs, reconciliation reports |
| Detection testing (below-the-line and known-match) | Whether the engine alerts on names it should | Test file results, missed-match log |
| Process and quality testing | Whether analysts followed procedure | Sampled alerts, reviewer scores |
Data and list integrity
Reconcile counts at each handoff. If the customer system holds 100,000 active customers, the screening engine should have screened 100,000. If a list provider published 1,200 new entries, 1,200 should appear in the engine. Gaps here are the most common cause of silent failure.
Detection testing
Build a test file of names with known expected outcomes. Include the original listed name, plus variants your matching is meant to catch: reordered parts, transliteration differences, missing middle names, and typos. Also include names that must not alert, such as clearly different people.
Run the file through the engine and compare actual to expected results. A missed expected alert is a finding. Use only test data in test environments, and never real customer records.
from difflib import SequenceMatcher
def score(a: str, b: str) -> float:
ta = " ".join(sorted(a.casefold().split()))
tb = " ".join(sorted(b.casefold().split()))
return SequenceMatcher(None, ta, tb).ratio()
listed = "Mohammed Al Sayed"
cases = [
("Al Sayed Mohammed", True),
("Mohamed Alsayed", True),
("Jane Doe", False),
]
threshold = 0.85
for name, should_alert in cases:
alerted = score(listed, name) >= threshold
status = "PASS" if alerted == should_alert else "FAIL"
print(f"{status} {name!r} score={score(listed, name):.2f}")If a case prints FAIL, you have a concrete, repeatable finding. Keep the test file under version control so you can rerun it after every change.
Sampling alerts and non-alerts
Test files show what the engine can do. Sampling shows what it did. Pull two samples regularly:
- Closed alerts. Re-review a random set of alerts that analysts closed as false positives. Look for wrong decisions, missing evidence, or inconsistent reasoning.
- Below-threshold results. Look at pairs that scored just under the threshold. If real matches appear there, the threshold is too high.
Record the error rate from each sample. Compare it with the tolerance your policy sets.
Validating changes
Treat any change to lists, normalization, matching logic, or thresholds as a controlled change. Before release:
- State the reason for the change.
- Run the detection test file before and after.
- Compare alert volumes on a recent data sample.
- Get approval from someone other than the person who made the change.
This is the gate that keeps tuning from becoming guesswork.
Governance
Governance assigns ownership so that testing actually happens. A workable structure includes:
- A named owner for the screening program, with authority over its settings.
- Written policy covering scope, timing, thresholds, and escalation, reviewed on a schedule.
- Management reporting with metrics such as alert volumes, closure times, backlog, sample error rates, and open findings.
- Independent review, by internal audit or a party outside the team, at a set frequency.
- A findings log where each issue has an owner, a due date, and a closure record.
Common errors
- Reporting alert counts as proof of effectiveness.
- Testing only exact copies of listed names.
- Changing a threshold without a before-and-after comparison.
- Letting findings stay open with no owner.
- Using real customer data in test environments without controls.
Exercise
Your closed-alert sample shows that 6 of 50 false-positive dispositions lacked a recorded reason. Your policy tolerates none. Which part of the program does this finding belong to, and what should happen next?
Show answer
It is a process and quality finding, not a detection failure. Log it with an owner and due date, retrain or coach the analysts involved, re-review the six alerts to confirm the decisions were correct, and sample again later to check the fix worked. Report the result to management.
Exercise
A tuning change lowers the threshold from 0.85 to 0.80. List two things you should do before release.
Show answer
Run the detection test file before and after to confirm expected matches are still caught, and compare alert volume on a recent data sample to confirm the team can handle the load. Record the reason and get independent approval.