Test Missing, Blank, and Unknown Values as Different Cases
Prepared with AI assistance by Alactic Editorial. Examples identified as hypothetical are illustrative, not customer results.
An automation can pass every test with complete records and still fail when a field is omitted, contains spaces, or holds an explicit unknown selection. The failure is often not a crash. It is a fallback branch that assigns the wrong team, an update that erases an existing value, or a continuation that should have stopped.
Test these states separately whenever the input representation, normalisation, decision branch, or permitted side effects can differ. For each case, verify both the expected outcome—safe stop, review request, or authorised continuation—and the actions that must not happen. Do not treat a successful run status as evidence that the decision was correct.
The method below tests existing input-handling rules. It does not decide which records qualify, redesign a form, or define an API contract. If the intended rule is unclear, that uncertainty is a review finding, not permission to invent a default.
1. Separate the states before testing the outcome
Missing, blank, and unknown describe different evidence about an input. A testing tool may display them similarly, while the automation evaluates them differently.
- Absent field: the input does not contain the field at all. The workflow might apply a default, preserve an existing value, or reject the record.
- Explicit null: the field exists with a null value. Depending on the existing rules, that may mean unavailable, intentionally cleared, or invalid.
- Empty text: the field exists as an empty string, represented as
"". - Whitespace: the field contains characters such as spaces. It may look empty without actually being empty.
- Unknown selection: the field contains a recognised option whose meaning is that the answer is not known.
- Valid value: the field contains a recognised value that can support a decision under the existing rules.
An explicit unknown selection is also different from an unrecognised value. A recognised UNKNOWN option may deliberately trigger review. An unexpected UNLISTED_TEAM value may indicate a mapping problem. Include both if the workflow can receive them.
Avoid using a broad label such as “empty input” in test names. Name the representation: field_absent, explicit_null, empty_string, and so on. This makes a failed test useful to the person investigating it.
2. Write the expected decision before running the test
Start with the current approved workflow rules, configuration, or acceptance criteria. For each input state, record the expected decision and the allowed effects. This prevents a common testing mistake: accepting whatever the automation currently does as the expected behaviour.
Use three outcome categories, but make each concrete:
- Safe stop: the automated path ends without the restricted action. The record remains recoverable, and the reason is visible.
- Review request: the automated decision pauses and a specific person or queue receives enough context to resolve it.
- Authorised continuation: the workflow proceeds only along the permitted path, with any separate permission checks still satisfied.
A review request is not complete merely because the record receives a review label. There must be an observable handoff. Likewise, a stop is not safe if the workflow has already overwritten a useful value or scheduled an action before stopping.
If two stakeholders expect different outcomes for the same input, pause that test's acceptance decision. Record the disagreement and obtain the rule owner's confirmation. Testing can expose an unresolved rule; it cannot establish the rule by observing the current implementation.
3. Use this filled hypothetical decision table
Fictional worked example: an internal routing automation reads a field called routing_team. Its existing, approved rules say that absent or unusable routing data must stop the automated route; the recognised UNKNOWN selection must request human review; and SUPPORT may continue to the support queue when the separate permission check passes. This example does not send customer messages or change qualification status.
For this hypothetical workflow, spaces are trimmed before checking for empty text. Null is rejected rather than treated as a request to clear a stored value. Those are example assumptions, not universal input rules.
The filled table below is shown as text so it can be copied into a test document without relying on a particular testing tool.
HYPOTHETICAL DECISION TABLE — routing_team Case | Supplied input | Expected outcome A | field absent | SAFE STOP B | routing_team: "" | SAFE STOP C | routing_team: " " | SAFE STOP after trimming D | routing_team: "UNKNOWN" | REVIEW REQUEST E | routing_team: "SUPPORT" | AUTHORISED CONTINUATION* F | routing_team: null | SAFE STOP G | routing_team: "UNLISTED_TEAM"| SAFE STOP *Case E assumes the separate permission check passes. Case | Required evidence | Forbidden effect A | reason: missing_field | default team assignment B | reason: empty_text | default team assignment C | reason: blank_after_trim | whitespace-based routing D | one review item with context | automatic team assignment E | support assignment recorded | unrelated record changes F | reason: null_value | clearing stored team data G | reason: unrecognised_value | fallback team assignment
The reason labels are hypothetical acceptance criteria. Your system may use different labels or a different evidence mechanism. What matters is that the tester can distinguish why the path stopped and verify that no prohibited effect occurred.
Cases A, B, C, and F intentionally share the same broad outcome. Keep them separate because they reach it through different representations. A parser change could break absent-field handling while empty-string handling still passes. A trim operation could disappear while the other cases remain unaffected.
Case D is the important contrast: unknown is a meaningful selection, not blank text. Collapsing it into the empty-input branch would suppress the review request required by this hypothetical workflow.
4. Build fixtures that preserve the difference
A fixture is the controlled input for a test. Start with one complete, valid baseline record and change only the target field for the first set of cases. Keep permissions, existing record state, and other inputs constant so the result can be attributed to the input state.
Do not assume your fixture editor preserves what you typed. A form, spreadsheet import, connector, or test tool may omit an empty field, trim spaces, or convert null into text before the decision logic receives it.
- Create the baseline. Use a fictional test record with a known valid routing value and no live external effects.
- Create separate variants. Remove the key for the absent case. Supply an empty string for the empty case. Supply actual spaces for the whitespace case. Use the recognised unknown option for the unknown case.
- Inspect the received input. Confirm the representation at the workflow entry point, where inspection is available.
- Inspect the decision input. If an upstream step transforms the value, capture the resulting value before branching.
- Record limitations. If the available evidence cannot distinguish null from omission, do not claim that both were independently tested.
Where the existing workflow accepts more than one whitespace format, add relevant variants separately. Do not expand into every possible character without a reason. Prioritise representations that the actual input path can produce.
Then repeat the important cases against a record that already has a stored team. This catches a different class of failure: missing input that unintentionally clears existing information. The expected result must come from the existing update rules, not from a general assumption that omission always means preserve.
5. Check side effects and permission boundaries
The branch label is only part of the result. Inspect record updates, task creation, queue assignments, scheduled work, and any other effects relevant to the workflow. A run can report a stop after an earlier step has already changed the record.
For the fictional routing example, check these assertions:
- Safe-stop cases: no new team assignment, no erasure of the stored team, and a visible stop reason.
- Review case: a review item reaches the intended queue, contains the unresolved field context, and does not silently assign a team.
- Continuation case: the intended support assignment occurs, with no unrelated changes.
Next, rerun the valid-value case with the separate permission check failing. A recognised value must not become a substitute for authorisation. OWASP's authorisation guidance recommends denying access by default and checking permission on every request. That supports keeping permission testing distinct from input-validity testing; it is not evidence about any particular product's controls.
If your workflow can trigger external actions, use an isolated environment or an approved method that prevents those effects during testing. If neither is available, document that limitation and arrange a controlled test before claiming the path is verified. Do not use real recipients simply to discover what a fallback branch does.
6. Test normalisation without hiding the original input
Normalisation can simplify handling by converting several representations into one internal state. For example, the hypothetical workflow trims spaces and then evaluates empty text. The trade-off is that normalisation can hide distinctions needed for diagnosis or recovery.
Test both the transformation and the decision. For the whitespace case, verify that the supplied spaces become empty text and that the resulting empty state stops. A final stop alone does not prove the trim rule worked; the workflow might have stopped for an unrelated reason.
Watch for three failure patterns:
- Truthiness shortcuts: a broad condition groups absent values, empty text, and other values without matching the documented rules.
- Convenient defaults: missing data becomes a valid-looking value, concealing the fact that required evidence was unavailable.
- Destructive conversion: null, omission, or unknown is converted into an update that clears useful stored information.
Preserve enough diagnostic context to distinguish the original state from the normalised state, using the organisation's existing data-handling practices. This does not require copying entire records into logs. A case identifier, state classification, and decision reason may provide the necessary evidence.
Keeping separate regression cases has a maintenance cost. Merge cases only when you can show that they share the relevant handling path and permitted effects. Even then, retain representative checks at the input boundary so later transformations do not silently change that equivalence.
7. Verify review and recovery, not just the first run
A review request that nobody can resolve is a delayed failure. Test the recovery path with the same care as the initial decision.
In the fictional example, a reviewer resolves UNKNOWN to SUPPORT. The resumed workflow should evaluate the corrected input and recheck the permissions needed for continuation. The earlier review state should not itself authorise the action.
Also test a repeat run while the input remains unknown. Under this hypothetical example's acceptance criteria, it should not create duplicate review work. If your existing rules deliberately create a new review item, verify the documented behaviour instead.
When a test fails, capture the supplied state, received state, selected branch, and observed effects before changing the fixture. Correct the handling through the normal change process, then rerun the failed case and its neighbouring cases. Fixing whitespace handling can accidentally alter empty-string handling; fixing null handling can change update behaviour for absent fields.
Do not replay a failed production item until any partial effects are understood. Recovery may require resolving an existing assignment or review item before a repeat run is safe.
8. Make the next test session measurable
Select one existing decision field and build the seven hypothetical table cases using your own approved outcomes. Add a valid-value case with permission denied, plus a repeat-run test for the review path where applicable.
For every case, record four items: the input representation actually received, the expected outcome, the observed outcome, and the evidence for allowed and forbidden effects. Mark a case as blocked rather than passed when the rule or evidence is missing.
Your immediate completion measure is not simply the number of green runs. It is the number of input states with a confirmed rule, a verified decision, and verified side effects. That gives the workflow owner a precise next action: fix a handling defect, clarify an unresolved rule, or improve visibility where the test cannot yet establish what happened.
Put the next conversation to work.
Explore Alactic Communications for WhatsApp conversations, campaigns and AI-assisted workflows. Choose the product and plan that fit your team.
Explore Communications