Notre avis
Cette compétence impose une stratégie de test TDD/BDD obligatoire avec exécution des tests et vérification de la couverture avant chaque commit.
Points forts
- Garantit une couverture de code minimale de 80 %
- Adopte une syntaxe BDD claire et lisible
- Exige l'exécution réelle des tests avec preuve de sortie
- Favorise des tests déterministes et rapides
Limites
- Peut ralentir les premières itérations de développement
- Nécessite une discipline stricte de l'équipe
- Ne couvre pas les tests d'interface utilisateur complexes
Lors du développement de fonctionnalités critiques où la fiabilité et la non-régression sont essentielles.
Pendant les phases d'exploration rapide ou de prototypage où les exigences changent fréquemment.
Analyse de sécurité
SûrThe skill instructs running standard test commands (pytest, npm test) and does not contain destructive, exfiltrating, or obfuscated instructions. No external payloads, no disabling of safety measures. Execution of tests is a normal development activity.
Aucun point d'attention détecté
Exemples
Write a BDD test for the login feature before implementing the actual login logic. Use describe/it syntax and test that a valid user can log in with correct credentials.Run the existing test suite with coverage reporting for the backend Python code using pytest with --cov=app, then show the test execution output and confirm coverage is at least 80%.Create failing tests for a new API endpoint /api/users that returns a list of users. Then implement the endpoint to make the tests pass, ensuring all tests run successfully with ≥80% coverage.Mandatory TDD/BDD Testing Strategy
Core Principles
- BDD Style:
describe/itsyntax for tests - Test-First: Write failing tests before implementation
- Deterministic: Use data-testid, role, label selectors
- Fast & Light: Prefer unit/integration tests
Example BDD Structure
describe('Calculator', () => {
it('adds two positive numbers', () => {
expect(add(5, 7)).to.equal(12);
});
});
Mandatory Test Execution
Requirements
- Actually run test suite with coverage
- Confirm all tests pass
- Verify ≥80% coverage
- Include test execution output
Backend (Python)
python3 -m pytest tests/ -v --cov=app --cov-report=term-missing
Frontend (TypeScript)
npm test -- --coverage
Evidence Requirement
## Test Execution Evidence
### Command:
`pytest tests/test_showcase_videos.py -v --cov=app.api`
### Output:
20 passed in 3.42s
Coverage: 87%
Enforcement
- MANDATORY with NO EXCEPTIONS
- Tests run LOCALLY before commit
- Test output in PR descriptions
- Actual coverage percentages required
Violation Consequences
- Broken code in production
- Undetected bugs
- Loss of test suite confidence
Reference
references/bdd-patterns.mdreferences/coverage-requirements.md
TDD Red-Green-Refactor
Testing
Skill qui guide Claude a travers le cycle TDD complet.
Audit d'Accessibilité Web
Testing
Réalise un audit d'accessibilité web complet selon les normes WCAG.
Générateur de Tests UAT
Testing
Génère des cas de test d'acceptation utilisateur structurés et complets.