Skip to main content

principle-test-behavior-not-implementation

Apply when you write, change, or keep a test. Call the code the way its users do and assert the result they observe against a literal expected value.

Source facts

Repository
Aqua-123/pstack-for-codex
Last source activity
September 10, 2026 at 16:19
Detected SKILL.md language
English
Stars
92
Forks
16

Install options

The review-first prompt is selected by default. You can switch to a direct command or download a local copy.

Review the source files

Read SKILL.md and any companion files shown by SkillsMP before deciding whether to install.

File Explorer
2 files

Showing SKILL.md

SKILL.md
Source instructions · Read-only preview
name
principle-test-behavior-not-implementation
description
Apply when you write, change, or keep a test. Call the code the way its users do and assert the result they observe against a literal expected value.
# Test Behavior, Not Implementation A test calls the code the way its users do and asserts the result they observe against a literal expected value. If every imported function returned `undefined`, a useful test would fail when the subject's behavior is wrong. Rewrite tests that only assert calls, truthiness, presence, constants, mocks, or fixture shape. Test the mechanism with one concrete input and a literal output or observable effect. Keep relation checks when the relation itself is the contract.
View on GitHub