testing-unit

Enforce BDD-style unit tests using Describe-Context-It with English names and Korean descriptions.

1|Updated Mar 16, 2026
One-click install
npx skills add https://github.com/iceflower/opencode-agents-and-skills --skill testing-unit-iceflower
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: testing-unit
Source: https://github.com/iceflower/opencode-agents-and-skills/tree/main/skills/testing-unit
Command: npx skills add https://github.com/iceflower/opencode-agents-and-skills --skill testing-unit-iceflower

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill includes references (resource) components.

What problem does it solve?

This Skill provides clear guidelines and best practices for writing effective, maintainable, and readable unit tests using the Behavior-Driven Development (BDD) style, ensuring accurate damage detection and well-explained failures.

Core Features & Use Cases

  • BDD Structure Enforcement: Mandates the use of Describe - Context - It for test organization.
  • Naming Conventions: Defines clear patterns for naming test blocks in English with Korean descriptions.
  • Test Quality Principles: Outlines essential criteria for good unit tests (accuracy, independence, readability, speed).
  • Behavior-Driven Testing: Emphasizes testing distinct behaviors rather than just functions.
  • Public API Testing: Guides users to test through public interfaces, not private implementation details.
  • Test Double Strategies: Provides recommendations on using Mocks, Stubs, and Fakes.
  • Assertion Best Practices: Recommends using appropriate matchers for clear failure messages.
  • Dependency Injection: Promotes DI for improved testability.
  • Use Case: When developing a new authentication module, use this Skill to ensure all login scenarios (valid credentials, invalid credentials, locked accounts) are covered with clear, descriptive BDD tests.

Quick Start

Use the testing-unit skill to write a BDD-style unit test for the UserRegistration class.

Frequently Asked Questions about testing-unit

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I write BDD-style unit tests that focus on behavior?

Behavior-Driven Development (BDD) unit testing focuses on testing distinct behaviors rather than just functions. You organize tests using a Describe-Context-It structure, targeting public APIs to ensure maintainable and reliable test suites.

What is the best way to structure unit tests for readability?

The best way to structure unit tests for readability is using a Describe-Context-It hierarchy. This BDD structure enforces clear organization, utilizing English naming conventions and descriptive text to accurately explain test scenarios and expected outcomes.

When should I use mocks, stubs, and fakes in unit testing?

Use test doubles like mocks, stubs, and fakes in unit testing when you need to isolate the code under test. Choose the appropriate double strategy to replace dependencies, ensuring test independence, accuracy, and preventing external state interference.

How do I unit test private methods and implementation details?

You should avoid unit testing private implementation details directly. Instead, test through public interfaces to validate distinct behaviors, which maintains test reliability and prevents brittle tests when internal implementations change.

Does dependency injection improve unit testability?

Dependency injection significantly improves unit testability. By injecting dependencies, you can easily substitute real components with test doubles like fakes or mocks, ensuring accurate damage detection and isolating the code under test.

What are the core principles of a good unit test suite?

Core principles of a good unit test suite include accuracy, independence, readability, and speed. These criteria ensure tests detect failures accurately, run fast, and employ clear assertions for maintainable BDD-style testing.