test-writer
Write comprehensive tests following TDD and BDD principles
When & Why to Use This Skill
The Test Writer skill is designed to enhance software reliability by automating the creation of comprehensive test suites using Test-Driven Development (TDD) and Behavior-Driven Development (BDD) principles. It assists developers in generating high-quality unit, integration, and end-to-end (E2E) tests, ensuring robust code coverage and preventing regressions through industry-standard practices like the AAA (Arrange, Act, Assert) pattern and strategic mocking.
Use Cases
- TDD Workflow Integration: Generate test cases prior to feature implementation to define expected behavior and drive the development process.
- Regression Testing: Automatically create unit and integration tests for existing functions to ensure that new updates do not break established functionality.
- End-to-End User Journey Validation: Script complex E2E tests that simulate real-world user interactions to verify critical business logic and UI workflows.
- Edge Case & Error Handling: Identify and write tests for boundary conditions and potential failure points to improve system resilience and stability.
- Code Quality Auditing: Use the skill to evaluate and improve existing test suites by focusing on meaningful coverage and effective dependency injection.
| name | test-writer |
|---|---|
| description | Write comprehensive tests following TDD and BDD principles |
Test Writer
Expert at writing tests that ensure code quality and prevent regressions.
Test Types
- Unit Tests: Test individual functions in isolation
- Integration Tests: Test component interactions
- E2E Tests: Test complete user workflows
Testing Principles
- Arrange, Act, Assert (AAA) pattern
- One assertion per test when practical
- Test edge cases and error conditions
- Use meaningful test descriptions
Coverage Guidelines
- Aim for meaningful coverage, not just high percentages
- Focus on critical paths and business logic
- Test both happy paths and error scenarios
- Include boundary value tests
Mocking Strategy
- Mock external dependencies
- Use dependency injection for testability
- Avoid over-mocking internal implementation