The Drift Log · Certifying that code does something
Why Passing Test Suites Fail to Validate Input Contracts
16 September 2026 · 3 min read · 677 words · established

Example tests verify point execution paths, not input domains. A green test suite often masks unexercised boundary conditions and false positives.
A test suite can be entirely green while leaving every boundary condition unchecked.
Consider a slice parser that reads a header and extracts a payload. The test instantiates the parser with a standard 64-byte buffer, asserts that the return object contains the expected fields, and exits cleanly. The exit code is 0. CI marks the build green.
In production, a payload with a zero-length body or an offset pointing past the allocated slice triggers an out-of-bounds panic or silent data truncation. The test suite did not catch the defect because it was never designed to test verification against the contract; it merely confirmed that one valid path reached the return statement.
function parseFrame(buffer: Uint8Array, maxBytes: number): Frame {
if (buffer.length > maxBytes) {
throw new RangeError("Frame exceeds maximum allowed length");
}
// Defect: empty buffer yields an invalid Frame state without throwing
const payload = buffer.subarray(4);
return new Frame(buffer[0], payload);
}
// Typical test suite:
test("parses standard frame", () => {
const input = new Uint8Array([0x01, 0x00, 0x00, 0x00, 0xAA, 0xBB]);
const frame = parseFrame(input, 1024);
expect(frame.type).toBe(1);
});
The test passes. The input contract—which requires all input buffers to contain at least four header bytes before slicing—is completely unverified.
Example Tests Verify Execution, Not Invariants
Example-based unit tests verify point values: $f(x) = y$ for a specific, developer-chosen $x$.
Input contracts operate on domains: for all valid inputs $x \in X$, the post-conditions and invariants must hold. For all invalid inputs $x \notin X$, the function must fail cleanly according to its contract.
When developers write test cases alongside implementation code, both reflect the same assumptions. If the author assumed that an array would always contain at least one element, their test cases will provide arrays with at least one element. The green status verifies only that the test execution completed. It does not certify that the function satisfies its contract under edge conditions.
This blind spot is where silent domain failures occur:
- Zero-value boundaries: Empty collections, zero-length byte slices, or null-terminated strings with embedded nulls.
- Numeric limits: Unchecked integer overflow, negative offsets, and precision loss during type narrowing.
- Structural invalidity: Correctly typed objects that violate semantic invariants (such as an end timestamp preceding a start timestamp).
Upgrading from example assertions to property testing forces the test runner to generate inputs across the full domain. Instead of choosing three valid buffers, property testing evaluates invariant assertions against thousands of pseudo-random byte sequences, empty inputs, and pathological boundaries.
The Gap Between Green Tests and Code Certification
A green CI run answers one narrow question: did the specified execution paths throw an unhandled error?
Moving from "it executed" to true code certification requires establishing formal boundaries for what an artifact actually guarantees. In The Four Verdicts Between Green Tests and Correct Code, we outline the ladder between code that compiles and code that is proven correct.
When a test suite fails to exercise the input boundaries, any verdict of correctness is premature. The code is, at best, provisional: reproducible under known conditions, but unverified at its boundaries.
Executing verification against explicit contracts is difficult because real inputs are messy. Conceding that your harness cannot fully exercise a complex contract is better than masking unexercised boundaries behind a blanket pass. When edge inputs cannot be verified, the test runner should state that the run was inconclusive rather than returning a false positive.
How SHPBL Enforces Input Contracts
SHPBL eliminates boundary ambiguities by certifying reusable software components against strict structural contracts before admission to the catalog.
Our corpus is model-independent. No AI model runs inside the software, and runtime behaviour is fully repeatable and sealed by published checksums. Components are evaluated through an automated certification harness that executes artifacts against structural input envelopes and records an explicit verdict:
- CERTIFIED: The artifact satisfies its invariant assertions and input contracts under full execution.
- PROVISIONAL: The artifact is reproducible, but correctness has not yet been asserted across the full domain.
- INCONCLUSIVE: The harness could not fully exercise the input contract. This marks a harness limit, not an artifact defect.
- FAILED: The component violated an invariant, panicked, or produced an invalid state.
Every write an agent performs passes a Build Intent gate first: the proposal is registered, the invariants and licensing are resolved in code, and a terminal state is returned. If an invariant cannot be exercised or validated, the system records the limit rather than returning a false green.
This post supports the longer argument in The Four Verdicts Between Green Tests and Correct Code.
Keep reading
Next in the log
- The Four Verdicts Between Green Tests and Correct Code
Binary CI exit codes conflate unexercised mocks with verified logic. A four-verdict taxonomy separates mechanical execution from genuine invariant proofs.
- Handling Inconclusive Harness Runs in CI Pipelines
Treat INCONCLUSIVE harness verdicts as warnings in CI to separate test‑infrastructure limits from real code defects.
- Proving Input Contracts on Pure Library Primitives
Passing unit tests only prove code matches author assumptions. Hardening pure primitives requires boundary contracts and property-driven harnesses.
The Strategic Master Library · written and reviewed under the house's own epistemic rules: nothing claimed that we cannot show.