use-bdd-style-test-naming
Installation
SKILL.md
Summary
When writing tests, use a Behavior-Driven Development (BDD) style for naming test cases. Focus on the behavior and outcome rather than the implementation details.
Rationale
- Readability: The test output reads like a specification of the system.
- Clarity: Forces the writer to think about behavior rather than just "test case 1" or "function X".
- Consistency: Standardizes how tests are described across the codebase, regardless of language.
Guidance
- Prefix: Start test descriptions with "it should" or "it must" (or just "should" if the framework provides
italready). - Content: Describe the specific behavior and expected result.
- Scope: This applies to:
t.Run()descriptions in Go.it()/test()descriptions in JavaScript/TypeScript (Vitest, Jest).@Testdisplay names in Java.