KS
Killer-Skills

tdd-workflow — how to use tdd-workflow how to use tdd-workflow, tdd-workflow setup guide, test-driven development for AWS, Red-Green-Refactor workflow, tdd-workflow vs traditional testing, automating testing with tdd-workflow, tdd-workflow install, what is tdd-workflow, tdd-workflow alternative

v1.0.0
GitHub

About this Skill

Perfect for Development Agents needing advanced test-driven development workflow capabilities for AWS automation tdd-workflow is a test-driven development approach that enforces the Iron Law, ensuring no production code is written without a failing test first.

Features

Enforces the Iron Law of TDD: NO PRODUCTION CODE WITHOUT A FAILING TEST FIRST
Supports Red-Green-Refactor workflow for test-driven development
Automates testing for AWS projects with multi-account and region support
Generates Excel reports for test results
Follows a strict testing philosophy: write tests before writing code

# Core Topics

expeor expeor
[0]
[0]
Updated: 3/6/2026

Quality Score

Top 5%
39
Excellent
Based on code quality & docs
Installation
SYS Universal Install (Auto-Detect)
Cursor IDE Windsurf IDE VS Code IDE
> npx killer-skills add expeor/aws-automation/tdd-workflow

Agent Capability Analysis

The tdd-workflow MCP Server by expeor is an open-source Categories.community integration for Claude and other AI agents, enabling seamless task automation and capability expansion. Optimized for how to use tdd-workflow, tdd-workflow setup guide, test-driven development for AWS.

Ideal Agent Persona

Perfect for Development Agents needing advanced test-driven development workflow capabilities for AWS automation

Core Value

Empowers agents to follow the Iron Law of TDD, utilizing Red-Green-Refactor methodologies and supporting multi-account and region setups with Python

Capabilities Granted for tdd-workflow MCP Server

Automating AWS resource testing
Generating test cases for Iron Law compliance
Refactoring existing codebases for TDD adherence

! Prerequisites & Limits

  • Requires Python environment
  • AWS automation setup necessary
  • Strict adherence to Iron Law principles
Project
SKILL.md
7.6 KB
.cursorrules
1.2 KB
package.json
240 B
Ready
UTF-8

# Tags

[No tags]
SKILL.md
Readonly

TDD 워크플로우

테스트 주도 개발 가이드입니다.

철학: The Iron Law

NO PRODUCTION CODE WITHOUT A FAILING TEST FIRST

테스트 전에 코드를 작성했다면? 삭제하고 다시 시작.

  • "참고용으로 보관" 금지
  • "적용하면서 테스트 작성" 금지
  • 테스트로부터 새로 구현

Red-Green-Refactor

RED - 실패하는 테스트 작성

하나의 행위만 테스트하는 최소한의 테스트 작성.

python
1def test_find_unused_volumes_returns_unattached_volumes(): 2 """미연결 볼륨만 반환하는지 테스트""" 3 # Arrange 4 volumes = [ 5 {"VolumeId": "vol-1", "Attachments": []}, # 미연결 6 {"VolumeId": "vol-2", "Attachments": [{"InstanceId": "i-1"}]}, # 연결됨 7 ] 8 9 # Act 10 result = find_unused_volumes(volumes) 11 12 # Assert 13 assert len(result) == 1 14 assert result[0]["VolumeId"] == "vol-1"

요구사항:

  • 하나의 행위만 테스트
  • 명확한 이름 (무엇을_어떤상황에서_어떤결과)
  • 실제 코드 테스트 (가능하면 mock 최소화)

Verify RED - 반드시 실패 확인

bash
1pytest tests/plugins/ec2/test_ebs_audit.py::test_find_unused_volumes -v

확인:

  • 테스트가 실패하는가? (에러가 아닌 실패)
  • 실패 이유가 기능 미구현 때문인가? (오타 아님)

GREEN - 최소한의 코드

테스트를 통과시키는 가장 단순한 코드 작성.

python
1def find_unused_volumes(volumes: list[dict]) -> list[dict]: 2 return [v for v in volumes if not v.get("Attachments")]

금지 사항:

  • 미래를 위한 확장성 추가
  • 요청받지 않은 기능 추가
  • "개선"을 위한 리팩토링

Verify GREEN - 통과 확인

bash
1pytest tests/plugins/ec2/test_ebs_audit.py -v

확인:

  • 테스트 통과
  • 다른 테스트도 통과
  • 경고/에러 없음

REFACTOR - 코드 개선

GREEN 이후에만:

  • 중복 제거
  • 이름 개선
  • 헬퍼 추출

테스트는 항상 통과 상태 유지.


프로젝트 테스트 구조

tests/
├── conftest.py           # 공유 fixtures
├── cli/                  # CLI 테스트
├── core/                 # Core 모듈 테스트
│   ├── parallel/         # 병렬 처리 테스트
│   └── tools/            # 도구 테스트
└── plugins/              # 플러그인 테스트
    └── cloudwatch/       # CloudWatch 배치 메트릭 테스트

AWS 모킹 (moto)

기본 패턴

python
1import boto3 2from moto import mock_aws 3 4@mock_aws 5def test_describe_instances(): 6 # moto가 AWS를 모킹 7 client = boto3.client('ec2', region_name='ap-northeast-2') 8 9 # 테스트 데이터 생성 10 client.run_instances( 11 ImageId='ami-12345678', 12 MinCount=1, 13 MaxCount=1, 14 InstanceType='t2.micro', 15 ) 16 17 # 테스트 실행 18 response = client.describe_instances() 19 assert len(response['Reservations']) == 1

Fixture 사용

python
1# tests/conftest.py 2import pytest 3import boto3 4from moto import mock_aws 5 6@pytest.fixture 7def aws_credentials(): 8 """Mocked AWS Credentials""" 9 import os 10 os.environ['AWS_ACCESS_KEY_ID'] = 'testing' 11 os.environ['AWS_SECRET_ACCESS_KEY'] = 'testing' 12 os.environ['AWS_SECURITY_TOKEN'] = 'testing' 13 os.environ['AWS_SESSION_TOKEN'] = 'testing' 14 15@pytest.fixture 16def mock_ec2(aws_credentials): 17 """Mocked EC2 client""" 18 with mock_aws(): 19 yield boto3.client('ec2', region_name='ap-northeast-2') 20 21@pytest.fixture 22def mock_ctx(): 23 """Mocked CLI context""" 24 from unittest.mock import MagicMock 25 ctx = MagicMock() 26 ctx.provider.get_session.return_value = boto3.Session() 27 ctx.regions = ['ap-northeast-2'] 28 return ctx

테스트 명명 규칙

python
1def test_함수명_상황_예상결과(): 2 ... 3 4# 예시 5def test_find_unused_volumes_when_no_attachments_returns_volume(): 6 ... 7 8def test_analyze_region_with_access_denied_returns_empty_list(): 9 ...

테스트 실행

bash
1# 전체 테스트 2pytest tests/ -v 3 4# 특정 파일 5pytest tests/plugins/ec2/test_ebs_audit.py -v 6 7# 특정 함수 8pytest tests/plugins/ec2/test_ebs_audit.py::test_unused_volumes -v 9 10# 커버리지 11pytest tests/ --cov=core --cov=cli --cov=plugins --cov-report=html 12 13# 실패 시 즉시 중단 14pytest tests/ -x 15 16# 마지막 실패 테스트만 17pytest tests/ --lf

테스트 카테고리

단위 테스트

개별 함수/메서드 테스트:

python
1def test_validate_account_id(): 2 assert validate_account_id('123456789012') is True 3 assert validate_account_id('invalid') is False

통합 테스트

모듈 간 상호작용 테스트:

python
1@mock_aws 2def test_ebs_audit_full_workflow(): 3 # 데이터 생성 → 분석 → 결과 검증

E2E 테스트

전체 CLI 플로우 테스트:

python
1from click.testing import CliRunner 2from core.cli.app import cli 3 4def test_list_tools_command(): 5 runner = CliRunner() 6 result = runner.invoke(cli, ['list-tools']) 7 assert result.exit_code == 0 8 assert 'ec2' in result.output

고급 패턴

Parameterized 테스트

python
1import pytest 2 3@pytest.mark.parametrize("volume,expected", [ 4 ({"VolumeId": "vol-1", "Attachments": []}, True), # 미연결 5 ({"VolumeId": "vol-2", "Attachments": [{}]}, False), # 연결됨 6 ({"VolumeId": "vol-3", "Attachments": None}, True), # None 처리 7]) 8def test_is_volume_unused(volume, expected): 9 assert is_volume_unused(volume) == expected

예외 테스트

python
1import pytest 2from botocore.exceptions import ClientError 3 4def test_collect_with_access_denied_returns_empty(): 5 """AccessDenied 에러 시 빈 결과 반환""" 6 with pytest.raises(ClientError) as exc_info: 7 raise_access_denied() 8 9 assert exc_info.value.response['Error']['Code'] == 'AccessDenied'

Async 테스트

python
1import pytest 2 3@pytest.mark.asyncio 4async def test_async_collect(): 5 result = await async_collect_resources() 6 assert len(result) > 0

TDD 체크리스트

작업 시작 전

  • 구현하려는 기능 명확히 이해
  • 실패하는 테스트 먼저 작성

RED 단계

  • 하나의 행위만 테스트
  • 테스트 이름이 행위를 설명
  • 테스트 실행 → 실패 확인
  • 실패 이유가 기능 미구현 (오타 아님)

GREEN 단계

  • 최소한의 코드만 작성
  • YAGNI 원칙 (필요 없는 것은 만들지 않음)
  • 테스트 통과 확인
  • 다른 테스트도 통과

REFACTOR 단계

  • GREEN 상태에서만 리팩토링
  • 리팩토링 후에도 테스트 통과
  • 중복 제거, 이름 개선

완료 전

  • 모든 새 함수에 테스트 있음
  • 엣지 케이스 테스트 (빈 목록, None 등)
  • 에러 케이스 테스트 (AccessDenied 등)
  • 린트 통과 (ruff check)

흔한 합리화 (금지)

합리화현실
"너무 단순해서 테스트 불필요"단순한 코드도 깨진다. 테스트 30초면 됨.
"나중에 테스트 작성"통과하는 테스트는 아무것도 증명 못함.
"수동 테스트했음"기록 없음, 재실행 불가, 누락 가능.
"시간 낭비"TDD가 디버깅보다 빠름.
"이미 X시간 투자"매몰 비용. 신뢰할 수 없는 코드 유지가 더 낭비.

참조

  • obra-superpowers/skills/test-driven-development/ - TDD 철학 상세
  • wshobson-agents/plugins/python-development/skills/python-testing-patterns/ - pytest 고급 패턴
  • core/parallel/errors.py - ErrorCollector 테스트 예시
  • tests/conftest.py - 공유 fixtures

Related Skills

Looking for an alternative to tdd-workflow or building a Categories.community AI Agent? Explore these related open-source MCP Servers.

View All

widget-generator

Logo of f
f

widget-generator is an open-source AI agent skill for creating widget plugins that are injected into prompt feeds on prompts.chat. It supports two rendering modes: standard prompt widgets using default PromptCard styling and custom render widgets built as full React components.

149.6k
0
Design

chat-sdk

Logo of lobehub
lobehub

chat-sdk is a unified TypeScript SDK for building chat bots across multiple platforms, providing a single interface for deploying bot logic.

73.0k
0
Communication

zustand

Logo of lobehub
lobehub

The ultimate space for work and life — to find, build, and collaborate with agent teammates that grow with you. We are taking agent harness to the next level — enabling multi-agent collaboration, effortless agent team design, and introducing agents as the unit of work interaction.

72.8k
0
Communication

data-fetching

Logo of lobehub
lobehub

The ultimate space for work and life — to find, build, and collaborate with agent teammates that grow with you. We are taking agent harness to the next level — enabling multi-agent collaboration, effortless agent team design, and introducing agents as the unit of work interaction.

72.8k
0
Communication