testing-patterns
테스팅 패턴 적용
También disponible en: sickn33,0xDarkMatter,ChrisWiles,CleanExpo
효과적인 테스트 작성에는 각 시나리오에 맞는 올바른 패턴 이해가 필요합니다. 이 스킬은 테스트 피라미드부터 TDD 워크플로까지 범용적인 테스트 전략을 제공하여 신뢰할 수 있는 테스트 스위트를 구축할 수 있습니다.
Descargar el ZIP de la skill
Subir en Claude
Ve a Configuración → Capacidades → Skills → Subir skill
Activa y empieza a usar
Pruébalo
Usando "testing-patterns". Help me set up TDD for a shopping cart calculate_total function
Resultado esperado:
- Step 1 - RED: Write failing test for empty cart (returns 0)
- Step 2 - GREEN: Minimal code to pass the test
- Step 3 - Refactor: Add item support with proper assertions
- Next tests to add: single item, multiple items, discount handling
Usando "testing-patterns". What mocking strategy should I use for testing database queries?
Resultado esperado:
- Use stubs for predictable return values on repository methods
- Use spies to verify query calls and count
- Mock at the repository boundary, not inside the database layer
- Consider fakes for complex query scenarios
Usando "testing-patterns". How do I structure my test pyramid for a new API service?
Resultado esperado:
- Unit tests (70%): Test each endpoint handler and business logic in isolation
- Integration tests (20%): Test database queries and service interactions
- E2E tests (10%): Test critical user flows end-to-end
Auditoría de seguridad
Riesgo bajoDocumentation-focused skill providing testing pattern guidance. Static findings are false positives from markdown code examples. The scanner flagged backtick-delimited code blocks as shell execution, example DATABASE_URLs as credential access, and testing tool names like pytest/docker as reconnaissance. The single utility script (coverage-check.sh) is a benign pytest wrapper with no network access or credential handling.
Factores de riesgo
⚙️ Comandos externos (1)
⚡ Contiene scripts (1)
Puntuación de calidad
Lo que puedes crear
테스트 fundamentals 배우기
테스트 피라미드와 다양한 시나리오에 대한 테스트 구조화 방법 이해
테스트 전략 설계
올바른 격리 및 모킹 접근법으로 포괄적인 테스트 계획 작성
CI 테스트 파이프라인 구축
병렬화 및 커버리지 게이트가 포함된 효율적인 테스트 파이프라인 구성
Prueba estos prompts
Help me write a unit test for [function name] including arrange-act-assert structure and proper mocking of dependencies.
Design a test pyramid for my [feature name]. How many unit, integration, and E2E tests should I have?
Guide me through TDD for [feature]. Start with a failing test, then minimal code, then refactor.
Help me set up mocking for [external API/database] in my tests. Include stubs for responses and mocks for verifying interactions.
Mejores prácticas
- 새 기능에 TDD를 사용하여 프로덕션 코드 전에 테스트 작성
- 외부 경계(데이터베이스, API, 파일 시스템)에서만 모킹
- 테스트 간 독립성 유지하고 순서 의존성 없음
Evitar
- 구현 세부사항 대신 공개 동작 테스트
- 테스트 중인 코드 자체를 모킹
- 프로덕션 코드 로직을 반영하는 테스트 작성