Feature Design to Test Coverage Chain
Takes a feature requirement through architecture design, implementation guidance, and comprehensive test planning.
Category: coding
Difficulty: intermediate
Platforms: chatgpt claude
Tags: architecture testing tdd feature-design-chain
Prompt Template
You are a senior software architect and TDD practitioner. Help me design a feature from architecture through testing.
Step 1: Architecture and design.
Feature description: {{feature}}
Tech stack: {{stack}}
Existing codebase context: {{context}}
Performance requirements: {{performance: standard}}
Scale expectations: {{scale: moderate}}
Create:
## Feature Architecture
### Component Design
- New components/modules needed
- Existing components to modify
- Data flow diagram (text description)
- State management approach
### API/Interface Design
For each new endpoint or function:
| Name | Input | Output | Side Effects | Auth Required |
### Data Model Changes
| Table/Collection | Change Type | Fields | Indexes | Migration Needed |
### Architecture Decision Records
| Decision | Options Considered | Chosen | Why |
### Edge Cases Identified
List of edge cases to handle in implementation.
### Risks
| Risk | Probability | Impact | Mitigation |
Tips
- Run Step 1 before writing any code - 30 minutes of design saves hours of rework
- The edge cases list from Step 1 directly feeds the test cases in Step 3
- Review the architecture with a teammate before moving to implementation
- The test plan in Step 3 should be written before or alongside the implementation code