← 返回 Skills 市场
thanksjj

测试用例生成器

作者 thanksjj · GitHub ↗ · v1.1.0 · MIT-0
cross-platform ✓ 安全检测通过
158
总下载
0
收藏
1
当前安装
1
版本数
在 OpenClaw 中安装
/install auto-testcase-generator
功能描述
Automated test case generation from project documents. This skill should be used when generating structured test cases from requirements documents, API speci...
使用说明 (SKILL.md)

\r \r

✍️ 作者:十年腾讯测试小白\r \r

测试用例生成器\r

\r

  • 当前版本:v1.1.0\r
  • v1.1.0:新增「端到端流程」第七维度覆盖设计\r
  • v1.0.0:初始版本,支持六维度覆盖设计、四阶段工作流、三层交叉验证\r \r 从需求文档(PDF、Word、Markdown)自动生成结构化 Excel 测试用例,支持图片/流程图智能分析,确保测试覆盖完整。\r \r

核心能力\r

\r

  1. 文档解析:PDF、Word、Markdown 需求文档,提取文本和嵌入图片/流程图\r
  2. 图片处理:解读流程图/状态图/序列图,转化为可测试场景\r
  3. 变量提取:识别测试变量、边界值、边界条件\r
  4. 流程可视化:生成 Mermaid 格式流程图\r
  5. 路径覆盖:确保所有执行路径和决策点完全覆盖\r
  6. 用例生成:按标准模板生成 Excel 文件,单工作表按模块分组\r
  7. 验证报告:三层交叉验证(规则→用例、用例→规则、标准→用例)\r \r

依赖工具\r

\r | 工具 | 版本 | 用途 |\r |------|------|------|\r | Python | ≥3.8 | 脚本运行 |\r | PyMuPDF (fitz) | ≥1.23 | PDF图片提取 |\r | openpyxl | ≥3.1 | Excel生成 |\r \r

Checklist 规范(强制执行)\r

\r 每阶段必须:列表展示checklist → 逐项打勾 → 输出上下文传递卡 → 等待用户确认。\r \r

标准工作流程\r

\r

阶段零:测试范围确认\r

\r 接收文档后先划清测试边界,三区域划分:\r

  • Zone 1(核心区):直接测试的功能,完整分析并生成用例\r
  • Zone 2(交互区):有交互的外部模块,仅作背景知识\r
  • Zone 3(外部区):无关内容,排除\r \r 输出范围确认表 → checklist → 传递卡 → 用户确认。\r \r

阶段一:需求深度分析(仅 Zone 1)\r

\r 入口引用阶段零传递卡,执行:\r

  1. 文档解析(文本+图片),Zone 2 精简为背景知识\r
  2. 需求建模:提取规则(DR/BR/PR/CR/SR)、记录缺口和假设\r
  3. 需求缺口识别:标注严重程度\r
  4. 测试标准定义:正确性/性能/可靠性验收标准\r
  5. 风险评估:Top 5 关键风险\r
  6. 输出需求分析简报(格式参考 references/analysis_template.md)\r \r 输出 checklist → 传递卡 → 用户确认。\r \r

阶段二:模块识别与用例设计\r

\r 入口引用阶段一传递卡,执行:\r

  1. 功能模块划分\r
  2. 七维度覆盖设计:功能/异常/边界/集成/性能/安全/端到端\r
  3. 模块复杂度评估(🟢低510条/🟡中1025条/🔴高25~50+条)\r
  4. 同步分配优先级(P0/P1/P2/P3)和测试类型\r
  5. 端到端流程独立分组,串联完整业务路径(3~10条)\r
  6. 模块-维度覆盖矩阵\r \r 达标标准:规则覆盖100%、每模块≥5/7维度、缺口覆盖100%、单模块≥5条。\r \r 输出 checklist → 传递卡 → 用户确认。\r \r

阶段三:Excel 输出\r

\r 入口引用阶段二传递卡,执行:\r

  1. 读取模板(有则用,无则默认格式),格式参考 references/excel_format.md\r
  2. 12列标准结构:用例编号/优先级/测试类型/模块/场景/测试点/操作步骤/预期结果/测试结果/用例生成依据/图像来源/截图\r
  3. 格式自检:列数完整、编号连续、优先级着色、测试类型合规、换行符chr(10)、模块分隔行【模块名称】\r
  4. 优先级分布:P0:1015%, P1:3040%, P2:3040%, P3:1020%\r \r 输出 checklist → 传递卡 → 用户确认。\r \r

阶段四:三层交叉验证\r

\r 入口引用阶段三传递卡+阶段一验证基准,执行:\r

  • 第一层(规则→用例):每条规则至少1条用例覆盖,100%覆盖率\r
  • 第二层(用例→规则):每条用例可追溯到规则,0条孤立用例\r
  • 第三层(标准→用例):验收标准和Top5风险有对应用例\r \r 未通过自动修复→重新验证,直到全部通过。\r \r 输出验证汇总报告 → checklist → 传递卡 → 用户确认。\r \r

阶段五:交付\r

\r 交付物:Excel用例文件 + 需求分析简报 + 验证报告 + 全流程Checklist汇总表 + 关键指标汇总。\r \r

视觉内容处理\r

\r | 类型 | 方法 | 影响 |\r |------|------|------|\r | 流程图 | 提取决策节点和路径 | 路径和分支用例 |\r | 状态图 | 提取状态和转换条件 | 状态转换用例 |\r | 序列图 | 识别消息流和时序 | 集成和时序用例 |\r | UI原型 | 分析界面元素 | UI交互用例 |\r \r PDF图片提取使用 scripts/extract_pdf_images.py(xref+MD5去重+质量过滤)。\r \r

最佳实践\r

\r

  1. 按阶段零→一→二→三→四→五顺序执行,每阶段用户确认后才进入下一步\r
  2. 每阶段输出可见checklist和上下文传递卡\r
  3. 单工作表输出,模块分隔用【模块名称】(不用=开头)\r
  4. 换行符用chr(10)+wrap_text,不用字符串\ \r
  5. 每条用例标注生成依据,确保可追溯\r
  6. 需求缺口标注"待确认"并给出测试假设\r
  7. 交付前必须通过三层交叉验证\r \r

资源说明\r

\r

  • scripts/extract_pdf_images.py:PDF图片优化提取\r
  • references/excel_format.md:Excel输出格式规范\r
  • references/analysis_template.md:需求分析简报模板\r
  • references/image_processing.md:图片处理最佳实践\r
安全使用建议
This skill appears coherent and non‑malicious. Before installing: (1) Review the included scripts (scripts/extract_pdf_images.py) — it only reads the supplied PDF and writes images to a local images/ directory; no network activity or credential use is present. (2) Ensure the agent/runtime has Python and the optional dependencies (PyMuPDF for image extraction, openpyxl if you want automated Excel writing). (3) Be mindful of what documents you feed the skill: extracted images and generated Excel files are written locally and may contain PII or sensitive diagrams. If you're concerned, run the skill in an isolated environment or with non-sensitive sample documents first. (4) Note that Excel generation is specified by guidelines and examples (references/excel_format.md) but full implementation is expected to run in the agent environment — confirm your runtime will implement the Excel creation as intended. Overall, no secrets or network endpoints are requested by the skill; it follows the documented workflow and checklists.
功能分析
Type: OpenClaw Skill Name: auto-testcase-generator Version: 1.1.0 The skill bundle is a comprehensive tool for generating structured test cases from project documentation (PDF, Word, Markdown). It includes a functional Python script (scripts/extract_pdf_images.py) for extracting and deduplicating images from PDFs using the PyMuPDF library and detailed documentation for Excel formatting and requirement analysis. The instructions in SKILL.md define a rigorous multi-phase workflow with mandatory checklists and user confirmation steps, showing no evidence of data exfiltration, malicious execution, or harmful prompt injection.
能力评估
Purpose & Capability
Name/description (automated test-case generation) matches the included artifacts: SKILL.md specifies parsing documents, image analysis, path coverage, and Excel output; references contain templates and an Excel-format guide; a helper script for PDF image extraction (expected for image analysis) is provided. Note: the repository provides guidance and a helper script but does not include a packaged Excel-generator binary — generation is intended to be performed by the agent environment (using openpyxl as documented). This is consistent with an instruction-only skill.
Instruction Scope
SKILL.md instructs the agent to parse user-provided docs, extract embedded images (via the included script), produce analysis reports and Excel files, and follow staged checklists that require user confirmations. The instructions reference only project-local files and the included script; they do not direct the agent to read unrelated system paths, access external endpoints, or exfiltrate secrets. Environment variables mentioned are only optional parameters for image extraction (MIN_WIDTH, MIN_HEIGHT, MIN_SIZE).
Install Mechanism
There is no install spec — the skill is instruction-only with one helper script included. The script depends on PyMuPDF (fitz) and the documentation references openpyxl; these are normal Python dependencies and no external download or obscure installer is used. No archives or remote URLs are fetched by the skill itself.
Credentials
The skill requests no credentials and declares no required environment variables. The only environment usage is optional configuration for the extraction script (MIN_WIDTH, MIN_HEIGHT, MIN_SIZE), which is proportional to image extraction. No hidden env vars or credential-like variables are present.
Persistence & Privilege
The skill is not forced-always and does not request persistent system privileges. It does not modify other skills or global agent settings. It writes extracted images to a local output directory (by design) but otherwise does not request elevated privileges.
如何使用
  1. 确保已安装 OpenClaw(本地或 Docker 部署)
  2. 在对话框中输入安装命令:/install auto-testcase-generator
  3. 安装完成后,直接呼叫该 Skill 的名称或使用 /auto-testcase-generator 触发
  4. 根据 Skill 的参数说明提供必要输入,即可获得结构化输出
版本历史
v1.1.0
v1.1.0: 新增端到端流程第七维度覆盖设计
元数据
Slug auto-testcase-generator
版本 1.1.0
许可证 MIT-0
累计安装 1
当前安装数 1
历史版本数 1
常见问题

测试用例生成器 是什么?

Automated test case generation from project documents. This skill should be used when generating structured test cases from requirements documents, API speci... 它是一个面向 Claude Code / OpenClaw 的 AI Agent Skill 插件,目前累计下载 158 次。

如何安装 测试用例生成器?

在 OpenClaw 或 Claude Code 对话框中运行命令「/install auto-testcase-generator」即可一键安装,无需额外配置。

测试用例生成器 是免费的吗?

是的,测试用例生成器 完全免费,采用 MIT-0 许可证,可自由下载、安装和使用。

测试用例生成器 支持哪些平台?

测试用例生成器 跨平台运行,可在任意部署了 OpenClaw / Claude Code 的环境中使用(cross-platform)。

谁开发了 测试用例生成器?

由 thanksjj(@thanksjj)开发并维护,当前版本 v1.1.0。

💬 留言讨论