Unit Test Generation
中级testing最低上下文:32K
Generates comprehensive unit tests for existing code, covering happy paths, edge cases, error conditions, and boundary values. Follows testing best practices including the test pyramid, DAMP over DRY, and the Arrange-Act-Assert pattern. Adapts to the project's existing test framework and conventions.
使用场景
- Generating tests for untested legacy code
- Achieving coverage targets for CI gates
- TDD red-green-refactor workflow
- Regression test creation after bug fixes
- Testing edge cases and error paths
示例提示词
Generate comprehensive unit tests for the following function. Include tests for: - Happy path with typical inputs - Edge cases (empty inputs, null values, boundary values) - Error conditions and exception handling - Type coercion or unexpected input types Use the project's existing test framework. Follow Arrange-Act-Assert pattern. Each test should have a descriptive name explaining what it verifies. Function to test: ``` [paste function here] ```
推荐模型
兼容工具
claude-codecursorgithub-copilotkiroany
模态
输入: code, text
→输出: code, text
相关 Skills
作者
OpenModels Community