ln-630-test-auditor

Compare original and translation side by side

🇺🇸

Original

English
🇨🇳

Translation

Chinese

Test Suite Auditor (L2 Coordinator)

测试套件审核器(L2协调器)

Coordinates comprehensive test suite audit across 6 quality categories using 5 specialized workers.
通过5个专业工作组件,针对6个质量类别开展全面的测试套件审核。

Purpose & Scope

目标与范围

  • L2 Coordinator that delegates to L3 specialized audit workers
  • Audits all tests against 6 quality categories (via 5 workers)
  • Calculates Usefulness Score for each test (Keep/Remove/Refactor)
  • Identifies missing tests for critical business logic
  • Detects anti-patterns and isolation issues
  • Aggregates results into unified report
  • Creates single Linear task in Epic 0
  • Manual invocation by user; not part of Story pipeline
  • L2协调器,可将任务委派给L3专业审核工作组件
  • 针对6个质量类别(通过5个工作组件)审核所有测试用例
  • 为每个测试用例计算实用价值评分(保留/移除/重构)
  • 识别关键业务逻辑缺失的测试用例
  • 检测反模式与隔离性问题
  • 将结果汇总为统一报告
  • 在Epic 0中创建单个Linear任务
  • 由用户手动调用,不属于Story流水线的一部分

Core Philosophy

核心理念

"Write tests. Not too many. Mostly integration." — Kent Beck "Test based on risk, not coverage." — ISO 29119
Key Principles:
  1. Test business logic, not frameworks — bcrypt/Prisma/Express already tested
  2. No performance/load/stress tests — Tests infrastructure, not code correctness (use k6/JMeter separately)
  3. Risk-based prioritization — Priority ≥15 or remove
  4. E2E for critical paths only — Money/Security/Data (Priority ≥20)
  5. Usefulness over quantity — One useful test > 10 useless tests
  6. Every test must justify existence — Impact × Probability ≥15
"编写测试用例,但不要过多。主要以集成测试为主。" — Kent Beck "基于风险开展测试,而非覆盖率。" — ISO 29119
关键原则:
  1. 测试业务逻辑,而非框架 — bcrypt/Prisma/Express等框架已由官方完成测试
  2. 不包含性能/负载/压力测试 — 这类测试针对基础设施,而非代码正确性(请单独使用k6/JMeter)
  3. 基于风险的优先级划分 — 优先级≥15则保留,否则移除
  4. 仅针对关键路径开展E2E测试 — 涉及资金/安全/数据的路径(优先级≥20)
  5. 实用价值优先于数量 — 1个有用的测试用例胜过10个无用的测试用例
  6. 每个测试用例都必须证明其存在价值 — 影响程度 × 发生概率 ≥15

Workflow

工作流程

Phase 1: Discovery (Automated)

阶段1:发现(自动化)

Inputs: Codebase root directory
Actions:
  1. Find all test files using Glob:
    • **/*.test.*
      (Jest, Vitest)
    • **/*.spec.*
      (Mocha, Jasmine)
    • **/__tests__/**/*
      (Jest convention)
  2. Parse test file structure (test names, assertions count)
  3. Auto-discover Team ID from docs/tasks/kanban_board.md
Output:
testFilesMetadata
— list of test files with basic stats
输入: 代码库根目录
操作:
  1. 使用Glob规则查找所有测试文件:
    • **/*.test.*
      (Jest、Vitest)
    • **/*.spec.*
      (Mocha、Jasmine)
    • **/__tests__/**/*
      (Jest约定格式)
  2. 解析测试文件结构(测试名称、断言数量)
  3. docs/tasks/kanban_board.md中自动识别团队ID
输出:
testFilesMetadata
— 包含基础统计信息的测试文件列表

Phase 2: Research Best Practices (ONCE)

阶段2:研究最佳实践(仅执行一次)

Goal: Gather testing best practices context ONCE, share with all workers
Actions:
  1. Use MCP Ref/Context7 to research testing best practices for detected tech stack
  2. Load ../ln-513-auto-test-planner/references/risk_based_testing_guide.md
  3. Build
    contextStore
    with:
    • Testing philosophy (E2E primary, Unit supplementary)
    • Usefulness Score formulas (Impact × Probability)
    • Anti-patterns catalog
    • Framework detection patterns
Output:
contextStore
— shared context for all workers
Key Benefit: Context gathered ONCE → passed to all workers → token-efficient
目标: 一次性收集测试最佳实践上下文,共享给所有工作组件
操作:
  1. 使用MCP Ref/Context7研究已检测技术栈的测试最佳实践
  2. 加载../ln-513-auto-test-planner/references/risk_based_testing_guide.md
  3. 构建
    contextStore
    ,包含:
    • 测试理念(以E2E测试为主,单元测试为辅)
    • 实用价值评分公式(影响程度 × 发生概率)
    • 反模式目录
    • 框架检测规则
输出:
contextStore
— 供所有工作组件共享的上下文
核心优势: 上下文仅收集一次 → 共享给所有工作组件 → 提升Token使用效率

Phase 3: Domain Discovery (NEW)

阶段3:域发现(新增功能)

Purpose: Detect project domains from production code folder structure for domain-aware coverage analysis.
Algorithm: (same as ln-360-codebase-auditor)
  1. Priority 1: Explicit domain folders
    • Check for:
      src/domains/*/
      ,
      src/features/*/
      ,
      src/modules/*/
    • Monorepo patterns:
      packages/*/
      ,
      libs/*/
      ,
      apps/*/
    • If found (>1 match) → use as domains
  2. Priority 2: Top-level src/ folders*
    • List folders:
      src/users/
      ,
      src/orders/
      ,
      src/payments/
    • Exclude infrastructure:
      utils
      ,
      shared
      ,
      common
      ,
      lib
      ,
      helpers
      ,
      config
      ,
      types
      ,
      interfaces
      ,
      constants
      ,
      middleware
      ,
      infrastructure
      ,
      core
    • If remaining >1 → use as domains
  3. Priority 3: Fallback to global mode
    • If <2 domains detected →
      domain_mode = "global"
    • All workers scan entire codebase (backward-compatible behavior)
Heuristics for domain detection:
HeuristicIndicatorExample
File count>5 files in folder
src/users/
with 12 files
Structurecontrollers/, services/, models/ presentMVC/Clean Architecture
Barrel exportindex.ts/index.js existsModule pattern
READMEREADME.md describes domainDomain documentation
Output:
json
{
  "domain_mode": "domain-aware",
  "all_domains": [
    {"name": "users", "path": "src/users", "file_count": 45},
    {"name": "orders", "path": "src/orders", "file_count": 32},
    {"name": "shared", "path": "src/shared", "file_count": 15, "is_shared": true}
  ]
}
Shared folder handling:
  • Folders named
    shared
    ,
    common
    ,
    utils
    ,
    lib
    ,
    core
    → mark
    is_shared: true
  • Shared code audited but grouped separately in report
目标: 从生产代码目录结构中检测项目域,实现域感知的覆盖率分析。
算法:(与ln-360-codebase-auditor相同)
  1. 优先级1:显式域目录
    • 检查以下路径:
      src/domains/*/
      src/features/*/
      src/modules/*/
    • 单体仓库模式:
      packages/*/
      libs/*/
      apps/*/
    • 若找到(匹配数>1)→ 将其作为域
  2. *优先级2:顶级src/目录
    • 列出目录:
      src/users/
      src/orders/
      src/payments/
    • 排除基础设施类目录:
      utils
      shared
      common
      lib
      helpers
      config
      types
      interfaces
      constants
      middleware
      infrastructure
      core
    • 若剩余目录数>1 → 将其作为域
  3. 优先级3:回退至全局模式
    • 若检测到的域数量<2 →
      domain_mode = "global"
    • 所有工作组件扫描整个代码库(向后兼容行为)
域检测启发式规则:
启发式规则指标示例
文件数量目录中文件数>5
src/users/
包含12个文件
结构存在controllers/、services/、models/MVC/整洁架构
桶导出存在index.ts/index.js模块模式
文档README.md描述了域内容域文档
输出:
json
{
  "domain_mode": "domain-aware",
  "all_domains": [
    {"name": "users", "path": "src/users", "file_count": 45},
    {"name": "orders", "path": "src/orders", "file_count": 32},
    {"name": "shared", "path": "src/shared", "file_count": 15, "is_shared": true}
  ]
}
共享目录处理:
  • 名为
    shared
    common
    utils
    lib
    core
    的目录 → 标记
    is_shared: true
  • 共享代码会被审核,但在报告中单独分组

Phase 4: Delegate to Workers

阶段4:委派给工作组件

CRITICAL: All delegations use Task tool with
subagent_type: "general-purpose"
for context isolation.
Prompt template:
Task(description: "Test audit via ln-63X",
     prompt: "Execute ln-63X-{worker}. Read skill from ln-63X-{worker}/SKILL.md. Context: {contextStore}",
     subagent_type: "general-purpose")
Anti-Patterns:
  • ❌ Direct Skill tool invocation without Task wrapper
  • ❌ Any execution bypassing subagent context isolation
关键注意事项: 所有委派操作都使用Task工具,并设置
subagent_type: "general-purpose"
以实现上下文隔离。
提示模板:
Task(description: "Test audit via ln-63X",
     prompt: "Execute ln-63X-{worker}. Read skill from ln-63X-{worker}/SKILL.md. Context: {contextStore}",
     subagent_type: "general-purpose")
反模式:
  • ❌ 不使用Task包装器直接调用Skill工具
  • ❌ 任何绕过子代理上下文隔离的执行方式

Phase 4a: Global Workers (PARALLEL)

阶段4a:全局工作组件(并行执行)

Global workers scan entire test suite (not domain-aware):
#WorkerCategoryWhat It Audits
1ln-631-test-business-logic-auditorBusiness Logic FocusFramework/Library tests (Prisma, Express, bcrypt, JWT, axios, React hooks) → REMOVE
2ln-632-test-e2e-priority-auditorE2E PriorityE2E baseline (2/endpoint), Pyramid validation, Missing E2E tests
3ln-633-test-value-auditorRisk-Based ValueUsefulness Score = Impact × Probability<br>Decisions: ≥15 KEEP, 10-14 REVIEW, <10 REMOVE
5ln-635-test-isolation-auditorIsolation + Anti-PatternsIsolation (6 categories), Determinism, Anti-Patterns (6 types)
Invocation (4 workers in PARALLEL):
javascript
FOR EACH worker IN [ln-631, ln-632, ln-633, ln-635]:
  Task(description: "Test audit via " + worker,
       prompt: "Execute " + worker + ". Read skill. Context: " + JSON.stringify(contextStore),
       subagent_type: "general-purpose")
全局工作组件扫描整个测试套件(不具备域感知能力):
序号工作组件类别审核内容
1ln-631-test-business-logic-auditor业务逻辑聚焦框架/库测试用例(Prisma、Express、bcrypt、JWT、axios、React hooks)→ 移除
2ln-632-test-e2e-priority-auditorE2E优先级E2E基准(每个端点2个用例)、测试金字塔验证、缺失的E2E测试用例
3ln-633-test-value-auditor基于风险的价值实用价值评分 = 影响程度 × 发生概率<br>决策:≥15保留,10-14待评审,<10移除
5ln-635-test-isolation-auditor隔离性 + 反模式隔离性(6个类别)、确定性、反模式(6种类型)
调用方式(4个工作组件并行执行):
javascript
FOR EACH worker IN [ln-631, ln-632, ln-633, ln-635]:
  Task(description: "Test audit via " + worker,
       prompt: "Execute " + worker + ". Read skill. Context: " + JSON.stringify(contextStore),
       subagent_type: "general-purpose")

Phase 4b: Domain-Aware Worker (PARALLEL per domain)

阶段4b:域感知工作组件(按域并行执行)

Domain-aware worker runs once per domain:
#WorkerCategoryWhat It Audits
4ln-634-test-coverage-auditorCoverage GapsMissing tests for critical paths per domain (Money 20+, Security 20+, Data 15+, Core Flows 15+)
Invocation:
javascript
IF domain_mode == "domain-aware":
  FOR EACH domain IN all_domains:
    domain_context = {
      ...contextStore,
      domain_mode: "domain-aware",
      current_domain: { name: domain.name, path: domain.path }
    }
    Skill(skill="ln-634-test-coverage-auditor", args=JSON.stringify(domain_context))
ELSE:
  // Fallback: invoke once for entire codebase (global mode)
  Skill(skill="ln-634-test-coverage-auditor", args=JSON.stringify(contextStore))
Parallelism strategy:
  • Phase 4a: All 4 global workers run in PARALLEL
  • Phase 4b: All N domain-aware invocations run in PARALLEL
  • Example: 3 domains → 3 ln-374 invocations in single message
Worker Output Contract (Unified):
All workers MUST return JSON with this structure:
json
{
  "category": "Category Name",
  "score": 7,
  "total_issues": 12,
  "critical": 0,
  "high": 3,
  "medium": 7,
  "low": 2,
  "findings": [
    {
      "severity": "HIGH",
      "location": "path/file.ts:123",
      "issue": "Description of the issue",
      "principle": "Category / Sub-principle",
      "recommendation": "How to fix",
      "effort": "S"
    }
  ]
}
Unified Scoring Formula (all workers):
penalty = (critical × 2.0) + (high × 1.0) + (medium × 0.5) + (low × 0.2)
score = max(0, 10 - penalty)
Domain-aware workers add optional fields:
domain
,
scan_path
域感知工作组件针对每个域执行一次:
序号工作组件类别审核内容
4ln-634-test-coverage-auditor覆盖率缺口每个域的关键路径缺失的测试用例(资金类≥20、安全类≥20、数据类≥15、核心流程≥15)
调用方式:
javascript
IF domain_mode == "domain-aware":
  FOR EACH domain IN all_domains:
    domain_context = {
      ...contextStore,
      domain_mode: "domain-aware",
      current_domain: { name: domain.name, path: domain.path }
    }
    Skill(skill="ln-634-test-coverage-auditor", args=JSON.stringify(domain_context))
ELSE:
  // 回退:针对整个代码库调用一次(全局模式)
  Skill(skill="ln-634-test-coverage-auditor", args=JSON.stringify(contextStore))
并行执行策略:
  • 阶段4a:所有4个全局工作组件并行执行
  • 阶段4b:所有N个域感知调用并行执行
  • 示例:3个域 → 在单个消息中调用3次ln-374
工作组件输出规范(统一格式):
所有工作组件必须返回如下结构的JSON:
json
{
  "category": "Category Name",
  "score": 7,
  "total_issues": 12,
  "critical": 0,
  "high": 3,
  "medium": 7,
  "low": 2,
  "findings": [
    {
      "severity": "HIGH",
      "location": "path/file.ts:123",
      "issue": "Description of the issue",
      "principle": "Category / Sub-principle",
      "recommendation": "How to fix",
      "effort": "S"
    }
  ]
}
统一评分公式(所有工作组件适用):
penalty = (critical × 2.0) + (high × 1.0) + (medium × 0.5) + (low × 0.2)
score = max(0, 10 - penalty)
域感知工作组件可添加可选字段:
domain
scan_path

Phase 5: Aggregate Results

阶段5:汇总结果

Goal: Merge all worker results into unified Test Suite Audit Report
Aggregation Algorithm:
1. Collect JSON from all 5 workers
2. Merge findings from all workers into single array
3. Sum severity counts:
   total_critical = sum(worker.critical for all workers)
   total_high = sum(worker.high for all workers)
   total_medium = sum(worker.medium for all workers)
   total_low = sum(worker.low for all workers)
4. Calculate Overall Score:
   overall_score = average(worker.score for all workers)
5. Sort findings by severity: CRITICAL → HIGH → MEDIUM → LOW
6. Group findings by category for report sections
Actions:
  1. Collect results from all workers (global + domain-aware)
  2. Merge findings into single flat array (all workers use unified format)
  3. Sum severity counts across all workers
  4. Calculate overall score = average of 5 worker scores
  5. Domain-aware worker (ln-634) → group by domain.name if domain_mode="domain-aware"
  6. Generate Executive Summary (2-3 sentences)
  7. Create Linear task in Epic 0 with full report (see Output Format below)
  8. Return summary to user
Findings grouping:
  • Categories 1-3, 5-6 (Business Logic, E2E, Value, Isolation, Anti-Patterns) → single tables (global)
  • Category 4 (Coverage Gaps) → subtables per domain (if domain_mode="domain-aware")
目标: 将所有工作组件的结果合并为统一的测试套件审核报告
汇总算法:
1. 收集所有5个工作组件的JSON结果
2. 将所有工作组件的检测结果合并为单个数组
3. 汇总严重程度计数:
   total_critical = sum(worker.critical for all workers)
   total_high = sum(worker.high for all workers)
   total_medium = sum(worker.medium for all workers)
   total_low = sum(worker.low for all workers)
4. 计算整体评分:
   overall_score = average(worker.score for all workers)
5. 按严重程度对检测结果排序:CRITICAL → HIGH → MEDIUM → LOW
6. 按类别分组检测结果,用于报告章节展示
操作:
  1. 收集结果:收集所有全局和域感知工作组件的结果
  2. 合并检测结果:将所有结果合并为单个扁平化数组(所有工作组件使用统一格式)
  3. 汇总严重程度计数:汇总所有工作组件的各类严重程度数量
  4. 计算整体评分 = 5个工作组件评分的平均值
  5. 域感知工作组件(ln-634) → 若
    domain_mode="domain-aware"
    ,则按
    domain.name
    分组
  6. 生成执行摘要(2-3句话)
  7. 创建Linear任务:在Epic 0中创建包含完整报告的Linear任务(见下方输出格式)
  8. 返回摘要:向用户返回结果摘要
检测结果分组:
  • 类别1-3、5-6(业务逻辑、E2E、价值、隔离性、反模式)→ 单个表格(全局)
  • 类别4(覆盖率缺口)→ 按域分表(若
    domain_mode="domain-aware"

Output Format

输出格式

markdown
undefined
markdown
undefined

Test Suite Audit Report - [DATE]

测试套件审核报告 - [日期]

Executive Summary

执行摘要

[2-3 sentences: test suite health, major issues, key recommendations]
[2-3句话:测试套件健康状况、主要问题、关键建议]

Severity Summary

严重程度摘要

SeverityCount
CriticalX
HighX
MediumX
LowX
TotalX
严重程度数量
关键X
X
X
X
总计X

Compliance Score

合规性评分

CategoryScoreNotes
Business Logic FocusX/10X framework tests found
E2E Critical CoverageX/10X critical paths missing E2E
Risk-Based ValueX/10X low-value tests
Coverage GapsX/10X critical paths untested
Isolation & Anti-PatternsX/10X isolation + anti-pattern issues
OverallX/10Average of 5 categories
类别评分说明
业务逻辑聚焦X/10发现X个框架测试用例
E2E关键路径覆盖率X/10X个关键路径缺失E2E测试
基于风险的价值X/10X个低价值测试用例
覆盖率缺口X/10X个关键路径未测试
隔离性与反模式X/10X个隔离性+反模式问题
整体X/105个类别的平均值

Domain Coverage Summary (NEW - if domain_mode="domain-aware")

域覆盖率摘要(新增 - 若
domain_mode="domain-aware"

DomainCritical PathsTestedCoverage %Gaps
users8675%2
orders12867%4
payments6583%1
Total261973%7
关键路径已测试覆盖率 %缺口
users8675%2
orders12867%4
payments6583%1
总计261973%7

Audit Findings

检测结果

SeverityLocationIssuePrincipleRecommendationEffort
CRITICALroutes/payment.ts:45Missing E2E for payment processing (Priority 25)E2E Critical Coverage / Money FlowAdd E2E: successful payment + discount edge casesM
HIGHauth.test.ts:45-52Test 'bcrypt hashes password' validates library behaviorBusiness Logic Focus / Crypto TestingDelete — bcrypt already tested by maintainersS
HIGHdb.test.ts:78-85Test 'Prisma findMany returns array' validates ORMBusiness Logic Focus / ORM TestingDelete — Prisma already testedS
HIGHuser.test.ts:45Anti-pattern 'The Liar' — no assertionsAnti-Patterns / The LiarAdd specific assertions or delete testS
MEDIUMutils.test.ts:23-27Test 'validateEmail' has Usefulness Score 4Risk-Based Value / Low PriorityDelete — likely covered by E2E registrationS
MEDIUMorder.test.ts:200-350Anti-pattern 'The Giant' — 150 linesAnti-Patterns / The GiantSplit into focused testsM
LOWpayment.test.tsAnti-pattern 'Happy Path Only' — no error testsAnti-Patterns / Happy PathAdd negative testsM
严重程度位置问题原则建议工作量
关键routes/payment.ts:45支付处理缺失E2E测试(优先级25)E2E关键路径覆盖率 / 资金流添加E2E测试:成功支付+折扣边缘场景M
auth.test.ts:45-52测试'bcrypt hashes password'验证库行为业务逻辑聚焦 / 加密测试删除 — bcrypt已由维护者完成测试S
db.test.ts:78-85测试'Prisma findMany returns array'验证ORM业务逻辑聚焦 / ORM测试删除 — Prisma已完成测试S
user.test.ts:45反模式'说谎者' — 无断言反模式 / 说谎者添加具体断言或删除测试用例S
utils.test.ts:23-27测试'validateEmail'实用价值评分为4基于风险的价值 / 低优先级删除 — 可能已被注册E2E测试覆盖S
order.test.ts:200-350反模式'巨人' — 150行代码反模式 / 巨人拆分为聚焦的测试用例M
payment.test.ts反模式'仅快乐路径' — 无错误测试反模式 / 快乐路径添加负面测试用例M

Coverage Gaps by Domain (if domain_mode="domain-aware")

按域划分的覆盖率缺口(若
domain_mode="domain-aware"

Domain: users (src/users/)

域:users (src/users/)

SeverityCategoryMissing TestLocationPriorityEffort
CRITICALMoneyE2E: processRefund()services/user.ts:12020M
HIGHSecurityUnit: validatePermissions()middleware/auth.ts:4518S
严重程度类别缺失测试用例位置优先级工作量
关键资金E2E: processRefund()services/user.ts:12020M
安全单元测试: validatePermissions()middleware/auth.ts:4518S

Domain: orders (src/orders/)

域:orders (src/orders/)

SeverityCategoryMissing TestLocationPriorityEffort
CRITICALMoneyE2E: applyDiscount()services/order.ts:4525M
HIGHDataIntegration: orderTransaction()repositories/order.ts:7816M
undefined
严重程度类别缺失测试用例位置优先级工作量
关键资金E2E: applyDiscount()services/order.ts:4525M
数据集成测试: orderTransaction()repositories/order.ts:7816M
undefined

Worker Architecture

工作组件架构

Each worker:
  • Receives
    contextStore
    with testing best practices
  • Receives
    testFilesMetadata
    with test file list
  • Loads full test file contents when analyzing
  • Returns structured JSON with category findings
  • Operates independently (failure in one doesn't block others)
Token Efficiency:
  • Coordinator: metadata only (~1000 tokens)
  • Workers: full test file contents when needed (~5000-10000 tokens each)
  • Context gathered ONCE, shared with all workers
每个工作组件:
  • 接收包含测试最佳实践的
    contextStore
  • 接收包含测试文件列表的
    testFilesMetadata
  • 分析时加载完整的测试文件内容
  • 返回包含类别检测结果的结构化JSON
  • 独立运行(单个组件故障不影响其他组件)
Token效率:
  • 协调器:仅处理元数据(约1000个Token)
  • 工作组件:必要时加载完整测试文件内容(每个约5000-10000个Token)
  • 上下文仅收集一次,共享给所有工作组件

Critical Rules

关键规则

  • Two-stage delegation: Global workers (4) + Domain-aware worker (ln-374 × N domains)
  • Domain discovery: Auto-detect domains from folder structure; fallback to global mode if <2 domains
  • Parallel execution: All workers (global + domain-aware) run in PARALLEL
  • Domain-grouped output: Coverage Gaps findings grouped by domain (if domain_mode="domain-aware")
  • Delete > Archive: Remove useless tests, don't comment out
  • E2E baseline: Every endpoint needs 2 E2E (positive + negative)
  • Justify each test: If can't explain Priority ≥15, remove it
  • Trust frameworks: Don't test Express/Prisma/bcrypt behavior
  • No performance/load tests: Flag and REMOVE tests measuring throughput/latency/memory (DevOps Epic territory)
  • Code is truth: If test contradicts code behavior, update test
  • Language preservation: Report in project's language (EN/RU)
  • 两阶段委派: 全局工作组件(4个) + 域感知工作组件(ln-374 × N个域)
  • 域发现: 从目录结构自动检测域;若域数量<2则回退至全局模式
  • 并行执行: 所有全局和域感知工作组件并行运行
  • 域分组输出: 覆盖率缺口检测结果按域分组(若
    domain_mode="domain-aware"
  • 删除而非归档: 移除无用测试用例,不要注释掉
  • E2E基准: 每个端点需要2个E2E测试用例(正向+反向)
  • 每个测试用例都需证明价值: 若无法说明优先级≥15,则移除
  • 信任框架: 不要测试Express/Prisma/bcrypt的内置行为
  • 不包含性能/负载测试: 标记并移除测量吞吐量/延迟/内存的测试用例(属于DevOps Epic范畴)
  • 代码即事实: 若测试用例与代码行为矛盾,则更新测试用例
  • 语言保留: 报告使用项目的语言(英文/俄文)

Definition of Done

完成标准

  • All test files discovered via Glob
  • Context gathered from testing best practices (MCP Ref/Context7)
  • Domain discovery completed (domain_mode determined)
  • contextStore built with test metadata + domain info
  • Global workers (4) invoked in PARALLEL
  • Domain-aware worker (ln-374) invoked per domain in PARALLEL
  • All workers completed successfully (or reported errors)
  • Results aggregated with domain grouping (if domain_mode="domain-aware")
  • Domain Coverage Summary built (if domain_mode="domain-aware")
  • Compliance scores calculated (6 categories)
  • Keep/Remove/Refactor decisions for each test
  • Missing tests identified with Priority (grouped by domain if applicable)
  • Anti-patterns catalogued
  • Linear task created in Epic 0 with full report
  • Summary returned to user
  • 所有测试文件通过Glob规则被发现
  • 从测试最佳实践中收集上下文(MCP Ref/Context7)
  • 完成域发现(确定
    domain_mode
  • 构建包含测试元数据+域信息的
    contextStore
  • 全局工作组件(4个)已并行调用
  • 域感知工作组件(ln-374)已按域并行调用
  • 所有工作组件已成功完成(或报告错误)
  • 结果已汇总并按域分组(若
    domain_mode="domain-aware"
  • 已构建域覆盖率摘要(若
    domain_mode="domain-aware"
  • 已计算合规性评分(6个类别)
  • 已为每个测试用例做出保留/移除/重构的决策
  • 已识别缺失的测试用例并标记优先级(若适用则按域分组)
  • 已归类反模式
  • 已在Epic 0中创建包含完整报告的Linear任务
  • 已向用户返回结果摘要

Reference Files

参考文件

  • Orchestrator lifecycle:
    shared/references/orchestrator_pattern.md
  • Risk-based testing methodology:
    shared/references/risk_based_testing.md
  • Task delegation pattern:
    shared/references/task_delegation_pattern.md
  • Audit scoring formula:
    shared/references/audit_scoring.md
  • Audit output schema:
    shared/references/audit_output_schema.md
  • 编排器生命周期:
    shared/references/orchestrator_pattern.md
  • 基于风险的测试方法论:
    shared/references/risk_based_testing.md
  • 任务委派模式:
    shared/references/task_delegation_pattern.md
  • 审核评分公式:
    shared/references/audit_scoring.md
  • 审核输出 schema:
    shared/references/audit_output_schema.md

Related Skills

相关技能

  • Workers:
    • ln-631-test-business-logic-auditor — Framework tests detection
    • ln-632-test-e2e-priority-auditor — E2E baseline validation
    • ln-633-test-value-auditor — Usefulness Score calculation
    • ln-634-test-coverage-auditor — Coverage gaps identification
    • ln-635-test-isolation-auditor — Isolation + Anti-Patterns
  • Reference:
    • ../ln-513-auto-test-planner — Risk-Based Testing Guide
    • ../ln-620-codebase-auditor — Codebase audit coordinator (similar pattern)

Version: 4.0.0 Last Updated: 2025-12-23
  • 工作组件:
    • ln-631-test-business-logic-auditor — 框架测试用例检测
    • ln-632-test-e2e-priority-auditor — E2E基准验证
    • ln-633-test-value-auditor — 实用价值评分计算
    • ln-634-test-coverage-auditor — 覆盖率缺口识别
    • ln-635-test-isolation-auditor — 隔离性+反模式检测
  • 参考:
    • ../ln-513-auto-test-planner — 基于风险的测试指南
    • ../ln-620-codebase-auditor — 代码库审核协调器(类似模式)

版本: 4.0.0 最后更新: 2025-12-23 ",