Skip to content
Back to skills

Principle Test Behavior Not Implementation

ASecurity

Apply when writing, changing, or keeping a test. Assert what the code's users or callers observe, so tests fail when behavior breaks and survive internal refactors.

  • 25 stars
  • 0 votes
  • 0 copies
  • 1 view
  • Added November 15, 2026
ai-agentsnoderailstesting

Security analysis

A100/100

Scanned November 15, 2026

npx -y skills add watt-mind/factory --skill principle-test-behavior-not-implementation --agent claude-code

Installs into .claude/skills of the current project.

Are you the author of Principle Test Behavior Not Implementation?

Add the live security badge to your README. It updates with every re-scan.

Security grade badge for Principle Test Behavior Not Implementation
[![Security: A — Skills Directory](https://www.skillsdirectory.com/api/skills/watt-mind-principle-test-behavior-not-implementation/badge)](https://www.skillsdirectory.com/skills/watt-mind-principle-test-behavior-not-implementation)

More formats (shields.io, HTML) on the badges page. Keep it an A: scan every change in CI with Pro.

Download with Pro
SKILL.md
---
name: principle-test-behavior-not-implementation
description: "Apply when writing, changing, or keeping a test. Assert what the code's users or callers observe, so tests fail when behavior breaks and survive internal refactors."
disable-model-invocation: true
---

# Test Behavior, Not Implementation

Assert observable behavior and contracts rather than internal private helpers, call counts, or mock choreography.

- **Test through real boundaries:** Prefer real inputs/outputs, deterministic fakes at external boundaries, and observable state transitions.
- **Keep tests falsifiable:** Verify new regression tests fail before the fix is applied.

## Guardrails

- **Structural contracts are valid targets:** When the output format _is_ the user-facing contract (such as OpenXML `.docx` run/node structure, generated JSON schemas, or rendered visual/audio stills), asserting on that output structure is testing behavior, not implementation.

Attribution

Is this your skill, or is something wrong with this listing? Request removal or report an issue. Author removals are honored within 72 hours.

View all in ai-agents →

Comments

Loading comments…

Newsletter

Get the weekly list of safe new skills, and the ones we pulled.