From ccpp
Guides TDD process: write failing tests first (RED), minimal passing code (GREEN), refactor. Supports Vitest/Jest for JS/TS, pytest for Python. Use for test-first development.
npx claudepluginhub jh941213/my-cc-harness --plugin ccppThis skill is limited to using the following tools:
테스트를 먼저 작성하고, 코드를 구현하는 TDD 방식을 적용합니다.
Compares coding agents like Claude Code and Aider on custom YAML-defined codebase tasks using git worktrees, measuring pass rate, cost, time, and consistency.
Designs and optimizes AI agent action spaces, tool definitions, observation formats, error recovery, and context for higher task completion rates.
Designs, implements, and audits WCAG 2.2 AA accessible UIs for Web (ARIA/HTML5), iOS (SwiftUI traits), and Android (Compose semantics). Audits code for compliance gaps.
테스트를 먼저 작성하고, 코드를 구현하는 TDD 방식을 적용합니다.
RED → GREEN → REFACTOR → REPEAT
RED: 실패하는 테스트 작성
GREEN: 테스트 통과하는 최소 코드 작성
REFACTOR: 코드 개선 (테스트 유지)
REPEAT: 다음 기능/시나리오
// 타입 먼저 정의
interface CreateUserInput {
name: string;
email: string;
}
// 빈 구현체
export function createUser(input: CreateUserInput): User {
throw new Error('Not implemented');
}
테스트 순서: 정상 → 엣지 → 에러
describe('createUser', () => {
// 정상 케이스 먼저
it('유효한 입력으로 사용자를 생성해야 한다', () => {
const input = { name: '홍길동', email: 'hong@test.com' };
const result = createUser(input);
expect(result).toMatchObject({ name: '홍길동', email: 'hong@test.com' });
expect(result.id).toBeDefined();
});
// 엣지 케이스
it('이름 앞뒤 공백을 제거해야 한다', () => {
const result = createUser({ name: ' 홍길동 ', email: 'hong@test.com' });
expect(result.name).toBe('홍길동');
});
// 에러 케이스
it('이메일이 없으면 ValidationError를 던져야 한다', () => {
expect(() => createUser({ name: '홍길동', email: '' })).toThrow(ValidationError);
});
});
# 반드시 실패하는지 확인 — 바로 통과하면 테스트가 잘못된 것
npm test -- path/to/file.test.ts
# 또는
pytest path/to/test_file.py -v
실패 안 하면 STOP — 테스트를 다시 검토.
다음 테스트 케이스 추가 → RED부터 다시.
| 프레임워크 | 실행 | 워치 | 커버리지 |
|---|---|---|---|
| Vitest | npx vitest run | npx vitest | npx vitest --coverage |
| Jest | npx jest | npx jest --watch | npx jest --coverage |
| pytest | pytest -v | ptw | pytest --cov=src |
| 패턴 | 위치 |
|---|---|
| 코로케이션 | src/user.ts → src/user.test.ts |
| tests | src/user.ts → src/__tests__/user.test.ts |
| Python | src/user.py → tests/test_user.py |
기존 프로젝트 패턴을 따름.