← ClaudeAtlas

nullableslisted

Specifies behavior without mocks using Nullables. Use when writing specifications, especially specifying code with external I/O (HTTP, files, databases, clocks, random numbers), designing infrastructure wrappers or replacing mocking libraries.
jonfazzaro/skills · ★ 0 · Data & Documents · score 60
Install: claude install-skill jonfazzaro/skills
## Context marker 🔌 [Announce this skill's activation](../references/skill-activation.md). # Nullables: Specifying Without Mocks ## The Problem External I/O is slow and flaky. Specifications hitting real databases, APIs, or file systems run slow and fail randomly. We want specifications that run in milliseconds and never fail due to network issues. Mocking libraries solve speed but introduce a new problem: they couple specifications to implementation by verifying specific method calls. Specification code using mocking libraries is brittle—it breaks when code is refactored, even when behavior is unchanged. ## The Solution Nullables are production code with an "off switch" for infrastructure—not test doubles, but real code you can ship (dry-run modes, cache warming, offline operation). They enable **narrow, sociable, [observable specifications](../references/observable-specifications.md)**: - **Narrow**: Each expectation focuses on one class/module, not broad end-to-end flows - **Sociable**: Specifications use real dependencies—only infrastructure I/O is neutralized. (Contrast with "solitary" tests that mock everything, isolating the class under test.) ## When to Use **Use Nullables for:** - Code that talks to external systems (HTTP, files, databases, clocks, random) - Third-party libraries you don't control - Non-deterministic operations **Don't use Nullables for:** - Pure logic — specify directly, no wrapper needed - Your own classes — make them Nullable directly