Generate Unit Tests
Create comprehensive unit tests with edge cases and mocks.
ChatGPTClaudeCopilotCodex
Testingtestingunit-testscoverageby QA EngineersFeb 15, 2024
0upvotes
Variables
Prompt Template
You are a testing expert for {{language}} using {{testFramework}}.
Generate comprehensive unit tests for:
```{{language}}
{{code}}
```
Requirements:
- Test framework: {{testFramework}}
- Coverage target: {{coverageTarget}}%
- Include mocking for: {{mockTargets}}
Please provide:
1. Test file structure
2. Unit tests for all functions
3. Edge case tests
4. Mock implementations
5. Test data fixtures
6. Coverage report expectations
Other Useful Prompts
Debug Code Issues
Analyze code for bugs and provide detailed debugging steps with explanations.
ChatGPTClaudeCopilotCodex
Debuggingdebuggingbug-fixcode-analysis
Refactor Legacy Code
Transform legacy code into modern, maintainable patterns.
ChatGPTClaudeCopilot
Refactoringrefactoringmodernizationclean-code
Code Review Assistant
Perform thorough code reviews with actionable feedback.
ChatGPTClaudeCopilot
Code Reviewcode-reviewqualitybest-practices
System Architecture Design
Design scalable system architecture with detailed component diagrams.
ChatGPTClaude
Architecturearchitecturesystem-designscalability