test-design-review

使用测试设计准则对测试用例和测试计划进行审查,评估其设计质量并指出改进点。

仓库最近推送
GitHub Stars
194
Forks
13
Issues / PRs
0

安装方式

先用 Prompt 核对来源与依赖。也可下载安装包。

用 AI 助手安装

复制提示词,让助手先核对固定版本和依赖。

查看 Prompt收起 Prompt
先检查当前 Agent 是否已安装 SkillPI Skill Finder。如果尚未安装,请按官方仓库的说明安装并启用:https://github.com/Findskills/skillpi。然后使用 Skill Finder 打开此 SkillPI 详情页并定位 "test-design-review":https://skillpi.com/zh/skills/deepskill-6388de9949c197b2774de0e5e33b9a2bd4215007d7c6220402e422a760402498。安装前核对上游来源和版本:https://github.com/jasonswett/llm-skills。来源不一致时停止并说明差异。核对通过后,用 Skill Finder 安装目标 Skill,并报告安装路径和来源版本。

来源与配置

github.com

配置方式待核实

请查看原始来源中的适用工具、依赖和权限要求。

安装实测待补充

使用测试设计准则对测试用例和测试计划进行审查,评估其设计质量并指出改进点。

0 下载

介绍来源: third_party · jasonswett · 0.0.1 参考来源

SkillPi 解读

能完成的任务
翻译待完成,请参阅来源文档。
输入和输出
减记
实测状态
未测试

文件浏览

在原站浏览文件 ↗

原始 SKILL.md

打开原文 ↗
Frontmatter
name: test-design-review
description: >
  Critically review tests or diffs against Dave Farley's Properties of Good Tests
  and Gojko Adzic's Specification by Example principles. Evaluates test speed,
  determinism, atomicity, maintainability, necessity, and behavior-versus-implementation
  fidelity, flagging violations with concrete fixes. Triggers on: 'test review',
  'review tests', 'review these tests', 'critique tests', 'test design review'.

Test Design Review

Review tests (or a git diff containing tests) against an authoritative dual rubric: Dave Farley's Properties of Good Tests and Gojko Adzic's Specification by Example (BDD).


The Dual Rubric

1. Dave Farley's Properties of Good Tests

Every unit and integration test must satisfy Farley's 6 core properties:

Property Standard Violation Tells
Fast Unit tests execute in milliseconds; test suite runs in seconds. Use of sleep(), artificial delays, network calls, slow disk I/O in unit tests.
Maintainable Tests change only when requirements change, not when internal code refactors. Fragile mocks coupling to private methods; copy-pasted 50-line test setups.
Repeatable Deterministic: passes 1,000 times out of 1,000 runs in any order on any machine. Flakiness, reliance on system timezone/clock, random seeds without fixed seeding, database pollution across runs.
Atomic Each test is completely self-contained, tests one logical behavior, and fails for exactly one reason. Cascading failures (Test B fails only if Test A runs first), .first or .last queries dependent on DB ordering.
Necessary Every assertion validates a required domain capability or invariant. Tautological assertions (assert true), testing standard library or framework features, redundant is_successful checks before body checks.
Understandable Serves as living documentation. Clear Arrange-Act-Assert structure and intention-revealing names. Vague test names (test_case_1, it_works), mixed levels of abstraction, obscure assertions.

2. Gojko Adzic's Specification by Example (BDD)

Tests are executable specifications. They must reflect business behavior, not mechanical wiring:

Principle Standard Violation Tells
Behavior over Implementation Specify what happens in response to a business event, not how functions communicate internally. Asserting method call counts (verify(service, times(3))), mocking internal collaborators excessively, inspecting private state.
High Signal-to-Noise Ratio Every variable, input, and assertion in the test directly influences the outcome. Incidental boilerplate, 20 unneeded mock returns, arbitrary dummy data obscuring the relevant parameter.
Concrete Domain Examples Illustrate edge cases and rules with realistic domain examples rather than abstract placeholders. Meaningless test values (foo, bar, asdf, test1), lack of domain edge-case verification.
Living Documentation Specification names describe scenarios and business consequences. Technical names (test_process_data_flag_false) instead of domain rules (when_account_is_suspended_reject_withdrawal).

Review Process

When reviewing tests:

  1. Locate Target Tests:
    • If specific files/lines are provided, review those.
    • If a diff or branch is provided, extract all modified or added test files (git diff origin/main...HEAD -- '*test*' '*spec*').
  2. Evaluate Farley Properties:
    • Audit test speed, isolation, determinism, and atomicity.
    • Check for test pollution risks (global state, uncleaned fixtures, ordering dependencies).
  3. Evaluate Adzic Specification Fidelity:
    • Check if tests read as executable specifications.
    • Identify tests coupled to implementation details rather than behavior.
    • Check signal-to-noise: flag incidental setup or redundant assertions.
  4. Produce Structured Review Report:
    • Output the Farley Scorecard & Adzic Scorecard.
    • For every flagged violation: provide file path, line numbers, offending code, explanation, and a drop-in replacement fix.

Review Report Output Template

# Test Design Review

## Summary & Recommendation
- **Target:** `<file or diff>`
- **Verdict:** [PASS / NEEDS REVISION / BLOCKING]
- **Key Takeaway:** <1-2 sentences on overall test quality>

## Farley Properties Scorecard
- **Fast:** [Pass / Warning / Fail] — <notes>
- **Maintainable:** [Pass / Warning / Fail] — <notes>
- **Repeatable:** [Pass / Warning / Fail] — <notes>
- **Atomic:** [Pass / Warning / Fail] — <notes>
- **Necessary:** [Pass / Warning / Fail] — <notes>
- **Understandable:** [Pass / Warning / Fail] — <notes>

## Adzic Specification Scorecard
- **Behavior over Implementation:** [Pass / Warning / Fail] — <notes>
- **Signal-to-Noise Ratio:** [Pass / Warning / Fail] — <notes>
- **Concrete Examples:** [Pass / Warning / Fail] — <notes>

## Detailed Findings & Fixes

### 1. [Violation Name] (`path/to/test.ext:L12-L25`)
- **Rubric Rule:** Farley (Atomic) / Adzic (Behavior over Implementation)
- **Problem:** <explanation of the defect>
- **Offending Code:**
```code
<bad code>
  • Recommended Fix:
    <improved code>

当前收录版本

0.0.1

核对来源版本 ↗

质量评测

满分100 · 来自 SkillPi LAB 实验室的评测报告。

场景价值85/100

亮点

  • 基于 Dave Farley 和 Gojko Adzic 的权威测试设计准则,提供专业级测试质量评估框架
  • 支持对测试速度、确定性、原子性、可维护性等关键属性进行系统性审查
触发精准95/100

亮点

  • 触发词覆盖全面且语义明确,包括 'test review'、'critique tests' 等多种自然表达
结构规范80/100

待提升项

  • 缺少 When to Use 章节和端到端示例 原报告严重程度:轻微

    文档提供了输出模板但未展示一个完整的实际审查案例,用户可能难以理解如何应用该 Skill

    改进建议:补充一个真实的测试审查示例,展示从输入到输出的完整流程

亮点

  • 采用双维度评分卡结构(Farley Properties + Adzic Specification),逻辑清晰且专业性强
  • 每个违规项均提供具体修复建议,具备强可操作性
执行可靠65/100

待提升项

  • 未处理无效输入和执行环境依赖 原报告严重程度:重大

    未说明当用户提供非测试文件、空 diff 或缺乏 Git 环境时的处理机制,可能导致执行失败

    改进建议:增加输入验证逻辑说明,并明确所需执行环境(如是否需要 Git、是否支持多种语言测试文件)

亮点

  • 输出报告模板结构化程度高,便于集成到 CI/CD 或代码评审流程中
证据可验 (前四项均值)81/100

取前四项原始分值的算术平均,四舍五入取整。可通过收录报告核对各项评分与说明,运行记录需单独查证。

正文静态检测

100 / 100 · skillpi-20261123-no-r3-v1

正文未命中当前规则。

分数仅反映正文中的规则命中,供使用前参考。附件与运行行为不在此评分范围内。

权限与使用前检查

根据当前主文档自动整理,命中内容可能是示例或防护说明;不是实际权限声明,也未覆盖附件、外部依赖或运行行为。

未从主文档识别到上述常见操作,不能据此判断无需权限或没有风险。

本站展示提示不会授予权限。涉及文件改动、密钥、外部发送或费用时,仍由你使用的工具按需确认。

安全评级与访问范围

safe · 静态证据核验,不代表运行安全保证。

使用前请由宿主核对并授权实际文件读写、外部服务和联网目的地;本站的核验不会授予任何运行权限。