bdd-unit-test

Generate Given-When-Then unit tests from analyzed source code across languages.

Updated Jan 31, 2026
One-click install
npx skills add https://github.com/Ting-s515/skills --skill bdd-unit-test
Or copy as Structured Prompt for Agent▼
Please help me install this Agent Skill.
Skill: bdd-unit-test
Source: https://github.com/Ting-s515/skills/tree/main/bdd-unit-test
Command: npx skills add https://github.com/Ting-s515/skills --skill bdd-unit-test

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

當你需要為程式碼撰寫符合 BDD 原則的單元測試時,這項技能提供結構化的指引與自動化測試生成功能,提升測試覆蓋率與一致性。

Core Features & Use Cases

  • 分析與識別公開介面:自動識別目標檔案的公開方法與介面,為測試定義範圍。
  • 場景產生與命名策略:根據 Given-When-Then 結構列出測試場景並對應命名規範。
  • 跨語言測試生成:依語言框架自動產生對應的測試檔案與目錄結構,支援 Jest (TS/JS)、xUnit (C#)、JUnit/TestNG (Java)、pytest/unittest (Python)。
  • 快速啟動輸出:可直接輸出符合專案結構的測試草稿,便於接續完善。

Quick Start

請先提供要測試的檔案或模組,系統將分析其公開介面並產生符合 Given-When-Then 結構的測試草稿。

Frequently Asked Questions about bdd-unit-test

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

FAQPage Schema
How do I generate BDD-style unit tests from existing source code?▼

BDD-style unit tests structure test scenarios into Given-When-Then blocks. This format clarifies the initial context, the action taken, and the expected outcome, improving test readability and consistency across the codebase.

Can I automatically generate Jest test scaffolds for TypeScript files?▼

Yes, Jest test scaffolds can be generated for TypeScript files. The system detects file extensions, selects language-specific templates, and outputs test drafts matching the standard project structure for TypeScript and JavaScript.

Does BDD unit test generation work with Python pytest and Java JUnit frameworks?▼

BDD unit test generation works with Python pytest/unittest and Java JUnit/TestNG frameworks. It also supports xUnit for C#, automatically adapting the test output to match your target language's specific testing framework.

What is the best way to structure unit test scenarios using Given-When-Then?▼

The best way to structure unit test scenarios using Given-When-Then is to explicitly define the initial state, the action performed, and the expected result. The system automates this by listing scenarios and mapping them to naming conventions.

How do I start creating a unit test draft for a specific module?▼

To start creating a unit test draft, provide the target file or module. The system analyzes its public methods and interfaces to define the testing scope, then generates a structured BDD test draft ready for refinement.

What are the limitations of automated BDD test scaffold generation?▼

Automated BDD test scaffold generation produces structural test drafts rather than complete test logic. You must manually refine the generated Given-When-Then scenarios with specific assertions, mock data, and edge case validations.