observability-testing
Observability Testing
Test that your code produces correct logs — not just that it runs.
Logs are your only window into production behavior. If critical paths don't log correctly, you're flying blind during incidents. This skill teaches you to verify structured log output as part of your test suite.
When to use: Testing error logging with context, audit trails, monitoring integration, log level policy enforcement, any code where observability matters.
When not to use: Pure business logic tests, UI components, tests where logging is incidental not critical.
Rationalizations (Do Not Skip)
| Rationalization | Why It's Wrong | Required Action |
|---|---|---|
| "Logs are side effects, not behavior" | Incorrect logs = blind in production | Assert log output as first-class behavior |
| "I can see logs when I run it" | Manual inspection doesn't scale | Automate with mock logger assertions |
| "Any log level is fine" | Wrong levels = alert fatigue or missed incidents | Enforce log level policy |
| "Context isn't important" | Context-free logs are useless for debugging | Assert required context fields |
More from apankov1/quality-engineering
pairwise-test-coverage
Combinatorial testing with a greedy pairwise matrix generator. Covers all factor pairs in near-minimal test cases.
18breaking-change-detector
Audit 6 categories of breaking changes with executable checks for contracts, API diffs, serialized state, and event types.
17websocket-client-resilience
Client-side WebSocket resilience patterns: backoff with jitter, circuit breakers, heartbeat hysteresis, command acknowledgment, sequence gap detection, and mobile-aware timeouts.
17barrier-concurrency-testing
Deterministic race condition testing using barriers and deferred promises. Replaces flaky setTimeout-based timing tests with reproducible interleaving control.
17fault-injection-testing
Use when testing what happens when things fail — storage errors, network timeouts, API 500s, service outages. Provides circuit breaker state machine, retry policies with exponential backoff, fault injection, and queue preservation assertions. Trigger on: 'circuit breaker test', 'retry logic', 'exponential backoff', 'what happens if the API fails', 'simulate network failure', 'fault injection', 'resilience test', 'queue preservation after crash', 'graceful degradation'. Skip for: happy-path unit tests, UI testing, or code review.
15zod-contract-testing
Validates Zod schema parsing at boundaries. Tests valid/invalid inputs, schema evolution, refinement coverage, and compound state matrices (2^N optional field combinations).
13