The Validation Awareness Checklist
Questions you must ask for every validation
Before writing any validator, stop and walk through this sequence. Every time. No exceptions.
1️⃣ What if the parameter does not exist?
Ask yourself explicitly:
- Is the parameter mandatory?
- Or is it optional in this context?
Two valid outcomes — you must choose one:
- ❌ Fail → missing parameter is an error
- ⏭️ Skip → element is out of scope for this rule
If you don’t decide this upfront, your rule will behave inconsistently.
2️⃣ If the parameter exists — what if the value is empty?
Empty is not the same as missing.
Ask:
- Is an empty value allowed?
- Or does empty mean “not compliant”?
Typical cases:
- Empty text → usually fail
- Empty numeric → usually fail
- Empty boolean → often unset, not false
Treating empty as valid by accident is one of the most common mistakes.
3️⃣ If there is a value — what is the actual data type?
Never assume.
Check:
- Text
- Integer
- Number with units
- Boolean (Yes / No / Unset)
- List / enum-like value
Why this matters:
- Datatype determines which validators are even meaningful
- Comparing a string to a number silently breaks logic
Validation without datatype awareness is guessing.
4️⃣ If the datatype is correct — are all values allowed?
Final gate:
- Is any value acceptable?
- Or only a defined subset?
Examples:
- Free text → any value allowed
- Classification code → restricted values
- Dimension → numeric, but also within a valid range
This is where most domain rules actually live.
The mental flow (this is the part to memorize)
Does the parameter exist?
├─ No → Fail OR Skip (decide!)
└─ Yes
↓
Is the value empty?
├─ Yes → Fail OR Allow (decide!)
└─ No
↓
Is the datatype correct?
├─ No → Fail
└─ Yes
↓
Is the value allowed?
├─ No → Fail
└─ Yes → Pass
always apply this check list!
Hard rule
❗ Every validation must define all four answers Missing parameter · Empty value · Datatype · Allowed values
If even one is implicit, the rule is incomplete.
Why this matters (production reality)
Rules that skip this checklist:
- Pass when they shouldn’t
- Fail when they shouldn’t
- Create “ghost compliance”
- Destroy trust in reports
Rules that follow it:
- Are predictable
- Are explainable
- Scale across projects
- Survive standard changes