# Testability

> Enforces dependency injection, pure functions, observable state, and seam-based design

- Skill: `aibot88/testability` (Agent Skill, multi-file: 2 files)
- Install (CLI): `npx skillmds@latest add aibot88/testability`
- Raw SKILL.md: https://api.skillmd.com/api/skills/aibot88/testability/raw
- Safety review: pending (external: skill-scanner PASS, skillspector PASS)
- Works with: Claude Code, Claude.ai, OpenAI Codex
- Category: Coding & Dev Tools
- Author: aibot88 (https://skillmd.com/u/aibot88)
- Updated: 2026-09-21
- Page: https://skillmd.com/skills/aibot88/testability

---


# Testability Quality Dimension

Every component must be testable in isolation. If it's hard to test, the design is wrong.

## Checklist

Mark each item ✅ Pass / ❌ Fail / ⚠️ N/A:

### Dependency Injection
- [ ] Dependencies passed in (not imported directly)
- [ ] Mocking is straightforward
- [ ] No static method abuse
- [ ] No global state in business logic

### Pure Functions
- [ ] Business logic is pure (same input = same output)
- [ ] Side effects isolated to boundaries
- [ ] No hidden dependencies
- [ ] Deterministic test results

### Seams
- [ ] Integration points clearly defined
- [ ] Easy to inject test doubles
- [ ] Unit tests don't need full system
- [ ] Boundary interfaces are thin

### Test Coverage
- [ ] All new functions have tests
- [ ] Edge cases covered (null, empty, error)
- [ ] Happy path AND error path tested
- [ ] No test-free zones in business logic

### Test Quality
- [ ] Tests are readable (describe intent)
- [ ] Tests are fast (no sleep, no real I/O)
- [ ] Tests are independent (no shared state)
- [ ] Tests are maintainable (no magic numbers)

## When to Check
- Design-time: verify testability in the design
- Pre-ship: verify all functions have tests

## Fix if Failing
Refactor to use dependency injection. Extract side effects. Add tests. Use test doubles at boundaries.

