본문으로 건너뛰기
Skillpedia
테스트48k · #5936

tdd-workflows-tdd-red

하는 일

이 도구는 실패하는 테스트를 만들어, 프로그램이 어떻게 작동해야 하며 어떤 예상치 못한 상황을 처리해야 하는지 정의하도록 돕습니다. 앞으로의 코드가 기대를 충족하도록 보장하는 데 도움이 됩니다.

사용하는 경우

  • ✓새 기능을 개발하기 시작할 때.
  • ✓예상 동작을 보여 주는 테스트가 필요할 때.
  • ✓코드를 작성하기 전에 특수한 경우를 다루고 싶은 경우.

스킬 링크

https://github.com/sickn33/agentic-awesome-skills/blob/main/plugins/agentic-awesome-skills-claude/skills/tdd-workflows-tdd-red/SKILL.md

복사해서 AI(Claude, ChatGPT, Cursor)에 붙여넣고 지침을 따르도록 요청하세요.

사용 방법

가장 쉬운 방법입니다. 메시지를 복사해 AI에 붙여넣으세요. AI가 스킬을 읽고 지침을 따릅니다.

바로 붙여넣을 수 있는 메시지

Use this skill to help me: https://github.com/sickn33/agentic-awesome-skills/blob/main/plugins/agentic-awesome-skills-claude/skills/tdd-workflows-tdd-red/SKILL.md Read the SKILL.md file at that link and follow its instructions for my task.
AI가 이런 스킬을 알아서 찾아 쓰길 원하시나요?무료 Skillpedia MCP를 설치하세요. 한 줄이면 작업마다 스킬 15,000+개 중에서 검색합니다.1분 만에 설치 →

AI에게 요청하는 예시

“이메일과 비밀번호를 확인하는 로그인 함수에 대해 실패하는 테스트를 만들어 주세요.”

매주 새 스킬 5개. 읽는 데 1분.

작동 방식

도구는 실행하면 실패하는 테스트 코드를 생성합니다. 실제 코드가 아직 작성되지 않았기 때문입니다. 이렇게 하면 테스트를 통과시키기 위해 코드를 쓰게 됩니다.

기술 내용 (원본 SKILL.md)

작성자의 영어 원문을 GitHub에서 그대로 가져왔습니다.

Write comprehensive failing tests following TDD red phase principles.

[Extended thinking: Generates failing tests that properly define expected behavior using test-automator agent.]

Use this skill when

  • Starting the TDD red phase for new behavior
  • You need failing tests that capture expected behavior
  • You want edge case coverage before implementation

Do not use this skill when

  • You are in the green or refactor phase
  • You only need performance benchmarks
  • Tests must run against production systems

Instructions

  1. Identify behaviors, constraints, and edge cases.
  2. Generate failing tests that define expected outcomes.
  3. Ensure failures are due to missing behavior, not setup errors.
  4. Document how to run tests and verify failures.

Safety

  • Keep test data isolated and avoid production environments.
  • Avoid flaky external dependencies in the red phase.

Role

Generate failing tests using Task tool with subagent_type="unit-testing::test-automator".

Prompt Template

"Generate comprehensive FAILING tests for: $ARGUMENTS

Core Requirements

  1. Test Structure

    • Framework-appropriate setup (Jest/pytest/JUnit/Go/RSpec)
    • Arrange-Act-Assert pattern
    • should_X_when_Y naming convention
    • Isolated fixtures with no interdependencies
  2. Behavior Coverage

    • Happy path scenarios
    • Edge cases (empty, null, boundary values)
    • Error handling and exceptions
    • Concurrent access (if applicable)
  3. Failure Verification

    • Tests MUST fail when run
    • Failures for RIGHT reasons (not syntax/import errors)
    • Meaningful diagnostic error messages
    • No cascading failures
  4. Test Categories

    • Unit: Isolated component behavior
    • Integration: Component interaction
    • Contract: API/interface contracts
    • Property: Mathematical invariants

Framework Patterns

JavaScript/TypeScript (Jest/Vitest)

  • Mock dependencies with vi.fn() or jest.fn()
  • Use @testing-library for React components
  • Property tests with fast-check

Python (pytest)

  • Fixtures with appropriate scopes
  • Parametrize for multiple test cases
  • Hypothesis for property-based tests

Go

  • Table-driven tests with subtests
  • t.Parallel() for parallel execution
  • Use testify/assert for cleaner assertions

Ruby (RSpec)

  • let for lazy loading, let! for eager
  • Contexts for different scenarios
  • Shared examples for common behavior

Quality Checklist

  • Readable test names documenting intent
  • One behavior per test
  • No implementation leakage
  • Meaningful test data (not 'foo'/'bar')
  • Tests serve as living documentation

Anti-Patterns to Avoid

  • Tests passing immediately
  • Testing implementation vs behavior
  • Complex setup code
  • Multiple responsibilities per test
  • Brittle tests tied to specifics

Edge Case Categories

  • Null/Empty: undefined, null, empty string/array/object
  • Boundaries: min/max values, single element, capacity limits
  • Special Cases: Unicode, whitespace, special characters
  • State: Invalid transitions, concurrent modifications
  • Errors: Network failures, timeouts, permissions

Output Requirements

  • Complete test files with imports
  • Documentation of test purpose
  • Commands to run and verify failures
  • Metrics: test count, coverage areas
  • Next steps for green phase"

Validation

After generation:

  1. Run tests - confirm they fail
  2. Verify helpful failure messages
  3. Check test independence
  4. Ensure comprehensive coverage

Example (Minimal)

// auth.service.test.ts
describe('AuthService', () => {
  let authService: AuthService;
  let mockUserRepo: jest.Mocked<UserRepository>;

  beforeEach(() => {
    mockUserRepo = { findByEmail: jest.fn() } as any;
    authService = new AuthService(mockUserRepo);
  });

  it('should_return_token_when_valid_credentials', async () => {
    const user = { id: '1', email: 'test@example.com', passwordHash: 'hashed' };
    mockUserRepo.findByEmail.mockResolvedValue(user);

    const result = await authService.authenticate('test@example.com', 'pass');

    expect(result.success).toBe(true);
    expect(result.token).toBeDefined();
  });

  it('should_fail_when_user_not_found', async () => {
    mockUserRepo.findByEmail.mockResolvedValue(null);

    const result = await authService.authenticate('none@example.com', 'pass');

    expect(result.success).toBe(false);
    expect(result.error).toBe('INVALID_CREDENTIALS');
  });
});

Test requirements: $ARGUMENTS

…

자주 묻는 질문

테스트가 왜 먼저 실패해야 하나요?

특정 문제를 해결하기 위한 코드를 쓰고 있으며, 그 테스트가 중요한 것을 실제로 확인하도록 보장하기 위해서입니다.

'엣지 케이스'란 무엇인가요?

빈 입력, 아주 큰 값, 특수 문자처럼 제대로 처리하지 않으면 프로그램을 망가뜨릴 수 있는 특이하거나 극단적인 상황입니다.

'독립적인 테스트'란 무엇을 뜻하나요?

각 테스트가 다른 테스트의 결과에 의존하지 않고 혼자 작동해야 한다는 뜻입니다. 그래서 문제를 더 쉽게 찾고 고칠 수 있습니다.

상세 정보

작성자의 원본 설명

Generate failing tests for the TDD red phase to define expected behavior and edge cases.

repo: sickn33/agentic-awesome-skills

인기도

GitHub 스타
48k
순위
#5936
라이선스
MIT
업데이트
2026. 10. 15.

이 스킬이 유용한가요?

0

로그인 투표하려면 로그인하세요.

댓글

  • …

이 저장소의 다른 스킬

비슷한 스킬