スキル一覧に戻る
TKontu

tdd

by TKontu

0🍴 0📅 2026年1月25日
GitHubで見るManusで実行

SKILL.md


name: tdd description: Use when implementing any feature or bugfix - write test first, watch it fail, then implement

Test-Driven Development

The Rule

NO PRODUCTION CODE WITHOUT A FAILING TEST FIRST

Red-Green-Refactor Cycle

RED - Write Failing Test

def test_validates_empty_email():
    result = validate_email("")
    assert result.is_valid is False
    assert result.error == "Email required"

Run it. Watch it fail. Confirm it fails for the right reason (missing feature, not typo).

GREEN - Minimal Code

Write the simplest code that makes the test pass:

def validate_email(email: str) -> ValidationResult:
    if not email:
        return ValidationResult(is_valid=False, error="Email required")
    return ValidationResult(is_valid=True, error=None)

Run tests. All pass.

REFACTOR

Clean up only if needed. Keep tests green.

Repeat

Next failing test for next behavior.

Verification

pytest path/to/test.py -v

Must see:

  • Test fails first (RED)
  • Test passes after implementation (GREEN)
  • All other tests still pass

Quick Checklist

  • Test written before code
  • Watched test fail
  • Minimal implementation
  • All tests pass
  • No skipped steps

Anti-Patterns

BadGood
Write code, then testWrite test, watch fail, then code
"I'll test after"Test first proves it works
Multiple behaviors per testOne behavior per test
Test passes immediatelyTest must fail first

スコア

総合スコア

40/100

リポジトリの品質指標に基づく評価

SKILL.md

SKILL.mdファイルが含まれている

+20
LICENSE

ライセンスが設定されている

0/10
説明文

100文字以上の説明がある

0/10
人気

GitHub Stars 100以上

0/15
最近の活動

3ヶ月以内に更新がある

0/10
フォーク

10回以上フォークされている

0/5
Issue管理

オープンIssueが50未満

+5
言語

プログラミング言語が設定されている

+5
タグ

1つ以上のタグが設定されている

0/5

レビュー

💬

レビュー機能は近日公開予定です