← 返回
未分类 中文

TDD Workflow

Test-driven development workflow enforcing 80%+ code coverage with unit, integration, and E2E tests. Write tests first, validate RED state, implement minimal...
遵循测试驱动开发流程,要求代码覆盖率80%以上,包括单元、集成和端到端测试。先编写测试并验证RED状态,再实现最小化代码。
djc00p djc00p 来源
未分类 clawhub v1.0.0 1 版本 100000 Key: 无需
★ 0
Stars
📥 552
下载
💾 7
安装
1
版本
#latest

概述

Test-Driven Development Workflow

Ensure all code development follows TDD principles with 80%+ code coverage.

When to Activate

  • Writing new features or functionality
  • Fixing bugs or issues
  • Refactoring existing code
  • User says "write tests", "add specs", "how should I test this"

Quick Start

  1. Write user journey in acceptance-test format ("As a [role], I want...")
  2. Generate test cases (happy path + edge cases + errors)
  3. Run tests → verify RED state (must fail before implementation)
  4. Implement minimal code to make tests pass → GREEN state
  5. Refactor while keeping tests green
  6. Verify 80%+ coverage achieved

Key Concepts

  • Tests before code — Write tests first, then implementation
  • RED-GREEN-REFACTOR — Fail → Pass → Improve (no exceptions)
  • 80% coverage minimum — Unit, integration, and E2E combined
  • Unit-level isolation — Mock dependencies, test behavior not implementation
  • Independent tests — No test ordering dependencies; each can run solo

Common Usage

Most frequent patterns:

  • Unit tests for functions and components
  • Integration tests for API endpoints and database operations
  • E2E tests for critical user flows
  • Edge case and error path testing
  • Fast execution (unit tests < 50ms each)

References

  • references/workflow-steps.md — Detailed 7-step TDD cycle with git checkpoints
  • references/patterns-and-best-practices.md — Test patterns, common mistakes, success metrics

版本历史

共 1 个版本

  • v1.0.0 当前
    2026-05-03 06:15 安全 安全

安全检测

腾讯云安全 (Keen)

安全,无风险
查看报告

腾讯云安全 (Sanbu)

安全,无风险
查看报告

🔗 相关推荐

dev-programming

Github

steipete
使用 `gh` CLI 与 GitHub 交互,通过 `gh issue`、`gh pr`、`gh run` 和 `gh api` 管理议题、PR、CI 运行及高级查询。
★ 686 📥 331,237
dev-programming

YouTube

byungkyu
使用托管OAuth集成YouTube Data API,支持搜索视频、管理播放列表、获取频道数据及评论互动,适用于用户需要时使用此技能。
★ 142 📥 42,128
ai-agent

Agent Cost Strategy

djc00p
分层模型选择与成本优化,适用于多智能体 AI 工作流。在为任务选择模型或启动子代理时使用此技能。
★ 0 📥 814