Documentation
README
Unit Test Generator
根据源代码自动生成单元测试,支持多种语言和测试框架。
Automatically generate unit tests based on source code, supporting multiple languages and testing frameworks.
When to Use
当用户请求以下操作时使用此 skill:
- 生成单元测试 / Generate unit tests
- 为函数/类编写测试 / Write tests for functions/classes
- 创建测试用例 / Create test cases
- 提高代码覆盖率 / Improve code coverage
Instructions
分析步骤 / Analysis Steps
- 识别代码 - 确定编程语言和代码结构
- 分析功能 - 理解函数/方法的输入、输出和行为
- 确定边界 - 识别边界条件和边缘情况
- 选择框架 - 根据语言选择合适的测试框架
- 生成测试 - 编写全面的测试用例
支持的语言和框架 / Supported Languages
| 语言 | 测试框架 |
|---|---|
| Python | pytest, unittest |
| JavaScript/TypeScript | Jest, Mocha, Vitest |
| Java | JUnit, TestNG |
| Go | testing (built-in) |
| Rust | cargo test (built-in) |
测试类型 / Test Types
This is the opening of the README. Read the full README on GitHub.