Skip to content
Development
Skill

/test-strategy

测试策略和测试金字塔原则,定义单元测试、集成测试、E2E测试的分布和覆盖要求

From plugin
boss
55928 skills16 agents7 commands
Install
$ npx -y skills add echoVic/boss-skill --skill test-strategy --agent claude-code

How it fires

How this skill gets triggered: by you, by Claude, or both.

  • Fires itselfAuto-invocation. Claude auto-loads it when your prompt matches the work.Auto-invocation is when the right skill fires by itself at the right moment, driven by a FLOW.md router and a hook, instead of you invoking it by name. It is the difference between a skill being installed and a skill actually getting used.Read the full definition →
  • You can call itInvoke it directly when you want it.
  • Slash command/test-strategy

Context preview

The summary Claude sees to decide when to auto-load this skill.

测试策略和测试金字塔原则,定义单元测试、集成测试、E2E测试的分布和覆盖要求

SKILL.md

test-strategy.SKILL.md
name: qa/test-strategy
description: 测试策略和测试金字塔原则,定义单元测试、集成测试、E2E测试的分布和覆盖要求
version: 1.0.0
agent: qa
type: methodology
user-invocable: false
agent-invocable: true
dependencies:
  - shared/tech-stack-detection
triggers:
  - 开始测试工作时
  - 需要制定测试计划时

测试策略与测试金字塔

测试金字塔原则

          /\
         /  \
        / E2E \          ← ~10%:端到端用户流程【必须编写】
       /--------\
      /  集成测试  \       ← ~20%:组件/服务/API 交互
     /--------------\
    /    单元测试     \    ← ~70%:函数/组件/服务逻辑
   /--------------------\

E2E 测试是强制要求

**每个项目必须编写 E2E 测试**,最少覆盖:

  • 创建流程
  • 编辑流程
  • 删除流程
  • 列表展示
  • 核心业务流程

前端 vs 后端测试分布

| 层级 | 前端测试 | 后端测试 | |------|----------|----------| | **单元测试** | 组件渲染、Hooks、工具函数 | Service 层、业务逻辑、工具类 | | **集成测试** | 组件交互、状态管理、API 调用 | API 端点、数据库操作、服务间调用 | | **E2E 测试** | UI 用户流程 | API 完整流程、跨服务调用 |

QA Attack Protocol

  • **重放核心用户路径**:证明核心用户路径真实可用
  • **捕获真实 payload 与服务端响应**:验证请求 payload、服务端响应和 schema 一致性
  • **攻击认证授权**:覆盖匿名、授权、非授权、过期、越权
  • **攻击数据边界**:empty state、pagination、第二页、旧数据、illegal enum、long input、double submit
  • **攻击业务一致性**:核对界面展示与服务端业务常量一致
  • **验证产物类功能**:验证核心产物、记录或状态存在、可展示、可继续用于下游流程
  • **标记未验证路径**:若核心用户路径只由 Mock 或桩数据证明,必须标记为未验证,不能作为发布证据

安全测试

| 测试类型 | 测试内容 | 示例 | |----------|----------|------| | **SQL 注入** | 参数化查询验证 | `' OR '1'='1` | | **XSS** | 输出转义验证 | `<script>alert(1)</script>` | | **CSRF** | Token 验证 | 跨站请求测试 | | **认证** | Token 有效性 | 过期/伪造 Token | | **授权** | 权限边界 | 越权访问测试 | | **输入验证** | 边界值/格式 | 超长/特殊字符 |

性能测试

| 指标 | 前端目标 | 后端目标 | |------|----------|----------| | 首屏加载 | < 3s | - | | API P50 | - | < 100ms | | API P99 | - | < 500ms | | 并发用户 | - | ≥ 100 | | 内存泄漏 | 无 | 无 |

Read more
Ships withboss

Boss is an auditable agent-team workflow for coding agents. It turns one coding agent into a structured engineering team: PM, Architect, UI Designer, Tech Lead, Scrum Master, Frontend, Backend, QA, and DevOps.

Get the whole plugin