TDD Guide - Test Driven Development for Engineering Teams
A comprehensive Test Driven Development skill that provides intelligent test generation, coverage analysis, framework integration, and TDD workflow guidance across multiple languages and testing frameworks.
Capabilities
Test Generation
Generate Test Cases from Requirements: Convert user stories, API specs, and business requirements into executable test cases
Create Test Stubs: Generate test function scaffolding with proper naming, imports, and setup/teardown
Generate Test Fixtures: Create realistic test data, mocks, and fixtures for various scenarios
TDD Workflow Support
Guide Red-Green-Refactor: Step-by-step guidance through TDD cycles with validation
@tdd-guide
I need tests for my authentication module. Here's the code:
[paste code or provide file path]
Generate comprehensive test cases covering happy path, error cases, and edge cases.
Coverage Analysis
@tdd-guide
Analyze test coverage for my TypeScript project. Coverage report: coverage/lcov.info
Identify gaps and provide prioritized recommendations.
TDD Workflow
@tdd-guide
Guide me through TDD for implementing a password validation function.
Requirements:
- Min 8 characters
- At least 1 uppercase, 1 lowercase, 1 number, 1 special char
- No common passwords
Multi-Framework Support
@tdd-guide
Convert these Jest tests to Pytest format:
[paste Jest tests]
Scripts
Core Modules
test_generator.py: Intelligent test case generation from requirements and code
coverage_analyzer.py: Parse and analyze coverage reports (LCOV, JSON, XML)
metrics_calculator.py: Calculate comprehensive test and code quality metrics
E2E Testing: Use dedicated E2E tools (Playwright, Cypress, Selenium)
Performance Testing: Use JMeter, k6, or Locust
Security Testing: Use OWASP ZAP, Burp Suite, or security-focused tools
Manual Testing: Some scenarios require human exploratory testing
Example Workflows
Workflow 1: Generate Tests from Requirements
Input: User story + API specification
Process: Parse requirements → Generate test cases → Create test stubs
Output: Complete test files ready for implementation
Workflow 2: Improve Coverage
Input: Coverage report + source code
Process: Identify gaps → Suggest tests → Generate test code
Output: Prioritized test cases for uncovered code
Workflow 3: TDD New Feature
Input: Feature requirements
Process: Guide red-green-refactor → Validate each step → Suggest refactorings
Output: Well-tested feature with clean code
Workflow 4: Framework Migration
Input: Tests in Framework A
Process: Parse tests → Translate patterns → Generate equivalent tests
Output: Tests in Framework B with same coverage
Integration Points
CI/CD Integration
Parse coverage reports from CI artifacts
Generate coverage badges and reports
Fail builds on coverage thresholds
Track coverage trends over time
IDE Integration
Generate tests for selected code
Run coverage analysis on save
Highlight untested code paths
Quick-fix suggestions for test gaps
Code Review
Validate test coverage in PRs
Check test quality standards
Identify missing test scenarios
Suggest improvements before merge
Version Support
Node.js: 16+ (Jest 29+, Vitest 0.34+)
Python: 3.8+ (Pytest 7+)
Java: 11+ (JUnit 5.9+)
TypeScript: 4.5+
Related Skills
This skill works well with:
code-review: Validate test quality during reviews
refactoring-assistant: Maintain tests during refactoring
ci-cd-helper: Integrate coverage in pipelines
documentation-generator: Generate test documentation