← ClaudeAtlas

csp-test-methodologylisted

Choose and combine testing methods so no requirement falls through the cracks. Use when planning test strategy for a feature, when single-layer tests pass but the feature breaks end-to-end, when deciding smoke vs sanity vs E2E vs integration vs contract vs property vs fuzz vs mutation vs exploratory vs chaos vs load vs a11y vs security testing, when mapping requirements to test methods to find untested functionality, or when preventing fragmented ("割裂") testing that validates one function in isolation and misses linked effects. Provides the full testing-method taxonomy, a blind-spot complementarity matrix, and requirement traceability gap analysis. The methodology layer above csp-cross-layer-testing.
maythyai/code-skills-package · ★ 1 · Testing & QA · score 70
Install: claude install-skill maythyai/code-skills-package
# Test Methodology — 测试方法谱系与联想覆盖 > **联想测试**的本意:每种测试方法都有盲点,单测发现不了集成断链、E2E 发现不了边界数据、 > smoke 发现不了深层逻辑——按"盲点互补"把方法组合起来,让并集覆盖任何单一方法看不见的缺陷; > 再用需求可追溯把每条需求绑到至少一种方法,未映射的需求 = 潜在功能缺失。 ## 1. 反割裂:为什么单一方法不够 割裂测试的典型失败:每个功能点单测都绿,但联动时崩——下单单测绿、库存单测绿、付款单测绿, 组合起来"扣库存却没回滚订单"。**只测功能点而不测联动效果**,是漏 bug 的主因。 | 你以为 | 实际盲点 | 该叠什么方法 | |--------|----------|--------------| | 单测过了=功能对 | 集成断链、跨层不一致 | 集成 + 跨层联动 | | E2E 过了关键路径 | 边界数据、并发、错误路径 | property / fuzz / negative | | smoke 绿=能上线 | 只验"活着",不验正确性 | sanity + 关键集成 | | API 契约测了=前后端兼容 | 运行期数据一致性 | 跨层联动(DB 断言) | ## 2. 测试方法完整谱系 ### 2.1 按粒度(金字塔/钻石) | 方法 | 范围 | 速度 | 抓什么 bug | 盲点 | |------|------|------|-----------|------| | **Unit** | 纯函数/模块 | 极快 | 逻辑错误、边界 | 集成、IO、跨层 | | **Component/Integration** | 模块间、API+DB | 快 | 接口契约、组件交互 | 真 UI、跨部署 | | **Contract (CDC)** | 服务间契约 | 快 | 版本兼容、字段漂移 | 运行期数据状态 | | **Cross-layer/round-trip** | UI→API→DB→UI 因果 | 快-中 | 数据不一致、副作用、走过场 | 跨部署、并发 | | **E2E** | 全部署栈真实旅程 | 慢 | 真实用户流、路由、环境 | 边界、并发、深层 | | **Smoke** | 广度:能跑+关键路径 | 极快 | 构建是否活着、是否基本可用 | 正确性、深度 | | **Sanity** | 窄:一个断言 | 极快 | 上线后该改的改没改 | 覆盖面 | > smoke vs sanity 的区别:smoke 验"系统活着且关键路径能走",广而不深;sanity 验"我刚改的这一个东西对不对",窄而准。部署后两件事都要做。 ### 2.2 按意图(挖 bug 能力) | 方法 | 抓什么 bug | 盲点 | |------|-----------|------| | **Regression** | 防止回归已修缺陷 | 只覆盖已知回归点 | | **Property-based** | 生成输入证不变量,挖边界/等价类 | 需可表达的不变量;UI 退化弱 | | **Mutation** | 注入变异测"测试本身"质量 | 不直接测产品,测测试 | | **Fuzz** | 随机/畸形输入致崩/安全 | 不证正确,只找崩溃 | | **Exploratory** | 人按 charter 探索,挖剧本外 | 不可重复、不可规模化 | | **Negative** | 错误路径、非法输入 | 不验 happ