
Testcase Generator
This generates structured test cases using equivalence class partitioning and boundary value analysis, pulling from your plan.md and requirements docs. It creates one markdown file per test point with concrete test data (no placeholders like {username}), verifiable expected results, and priority labels P1 through P5. The output follows a specific format with 12 test type categories and includes validation scripts to catch duplicate cases or formatting errors. It's aimed at teams that want systematic coverage without manually thinking through every edge case. The instructions are thorough, maybe overly so, with detailed Chinese examples about login forms and ad account filters. Comes with Excel export if you need to hand cases off to a QA tool.
- skills.sh installs
- 368
- GitHub stars
- 12
- last updated
- Aug 21, 2026
Install
$ npx -y skills add chyax98/twu --skill testcase-generator --agent claude-codeInstalls into .claude/skills of the current project.
Files
测试用例生成器(testcase-generator)
1. 目标
根据测试点生成结构化测试用例,覆盖正向、反向、边界场景。
2. 输入输出
- 输入:
test-case/plan.md、clarified-requirements/index.md、CLAUDE.md - 输出:
test-case/{ITEM}/{POINT}.md、test-case/all_cases.md
3. 核心原则
- 策略指导:提供判断标准,而非强制数量
- 场景驱动:基于实际场景复杂度生成用例
- 数据具体:测试数据必须具体,不用占位符
- 可验证性:预期结果必须明确可验证
触发条件
- 用户执行
/testcase-gen命令 test-case/plan.md存在
4. 核心理论
4.1 等价类划分法
将输入数据划分为若干等价类,从每类中选取代表性数据测试。
应用示例:
POINT: 用户名密码登录
输入项: 用户名、密码
用户名等价类:
有效: [6-20字符,字母数字下划线] → "test_user123"
无效: [<6] "ab" | [>20] "verylongusername12345" | [特殊字符] "user@name" | [空] ""
密码等价类:
有效: [8-20字符,含大小写+数字] → "Test1234"
无效: [<8] "Test12" | [缺大写] "test1234" | [空] ""
生成原则: 一次测试一个等价类,其他保持有效
4.2 边界值分析法
边界是最容易出错的地方。
边界三点法: 离点(min-1) | 上点(min) | 内点(中间值) | 上点(max) | 离点(max+1)
应用示例:
用户名长度 6-20 字符:
- 离点-下: 5字符 "abcde" → 失败
- 上点-下: 6字符 "abcdef" → 成功
- 内点: 13字符 "test_user_123" → 成功
- 上点-上: 20字符 "test_user_1234567890" → 成功
- 离点-上: 21字符 "test_user_12345678901" → 失败
4.3 用例数量判断
不强制数量,根据场景复杂度自适应调整。
判断标准:
- 输入项数量:输入项越多,用例越多
- 业务规则复杂度:规则越复杂,用例越多
- 风险等级:Critical 和 High 需要更多用例
- 测试关注点:关注点越多,用例越多
Sponsors
Details
- Repository
- github.com/chyax98/twu
- Category
- Automation & Workflows
- First seen
- Jun 3, 2026