w03-testing-and-diagnostics
Compare original and translation side by side
🇺🇸
Original
English🇨🇳
Translation
Chinese测试与诊断规范
Testing and Diagnosis Specification
适用于代码变更后的测试执行与排障,确保结果可靠、补救完整。
Suitable for test execution and troubleshooting after code changes, ensuring reliable results and complete remediation.
⚠️ 核心强制要求
⚠️ Core Mandatory Requirements
第一步:创建测试任务文档
Step 1: Create Test Task Document
测试开始前必须先创建
agent-task-log/ongoing/TEST_[日期]_[任务].md完成后归档至
agent-task-log/archive/[年月]/markdown
undefinedMust create first before starting testing
agent-task-log/ongoing/TEST_[Date]_[Task].mdAfter completion, archive to
agent-task-log/archive/[Year-Month]/markdown
undefined测试任务:[任务名称]
Test Task: [Task Name]
当前状态
Current Status
阶段:🔄 执行测试
下一步:运行单元测试
Phase: 🔄 Executing Tests
Next Step: Run Unit Tests
进度
Progress
| 阶段 | 状态 |
|---|---|
| 执行测试 | 🔄 进行中 |
| 诊断(如需) | ⬜ 待定 |
| Phase | Status |
|---|---|
| Executing Tests | 🔄 In Progress |
| Diagnosis (if needed) | ⬜ Pending |
测试记录
Test Records
(待填写)
undefined(To be filled)
undefined第二步:执行测试
Step 2: Execute Tests
- 后端变更()→ 单元测试
backend/** - 前端变更()→ 浏览器测试
frontend/** - 全栈变更 → 先单元测试,再浏览器测试
- Backend Changes () → Unit Tests
backend/** - Frontend Changes () → Browser Tests
frontend/** - Full-stack Changes → First run unit tests, then browser tests
第三步:更新文档
Step 3: Update Document
测试完成后立即更新文档,记录结果
Update the document immediately after test completion and record the results
基线约束
Baseline Constraints
- 测试完成前不得提交交付结果
- 失败时必须先修复再继续
- 无法执行测试时需说明原因和补测计划
- Do not submit delivery results before test completion
- Must fix issues before proceeding if tests fail
- If tests cannot be executed, explain the reason and make a supplementary test plan
AI Agent 行为要求
AI Agent Behavior Requirements
测试任务开始时
At the Start of Test Task
- 先创建 TEST_*.md 文档
- 根据变更类型选择测试
- 执行测试并更新文档
- 失败时触发诊断流程(最多三轮)
- First create the TEST_*.md document
- Select tests based on the type of change
- Execute tests and update the document
- Trigger diagnosis workflow if tests fail (maximum 3 rounds)
诊断流程
Diagnosis Workflow
每轮:观察 → 推断 → 操作 → 结果
升级条件:
- 三轮排查无果
- 高风险或涉及架构/安全决策
Each round: Observe → Infer → Operate → Result
Escalation Conditions:
- No results after 3 rounds of troubleshooting
- High-risk or involves architecture/security decisions
恢复执行
Resume Execution
新对话检查 ,从"当前状态"继续
agent-task-log/TEST_*.mdNew conversations check and continue from the "Current Status"
agent-task-log/TEST_*.md人机协作
Human-AI Collaboration
AI 无法 100% 自主完成所有测试,部分场景需要人类协助:
可请求人类协助的情况:
- 浏览器页面需要手动打开或导航
- 需要人工验证视觉效果
- 涉及复杂的用户交互流程
- AI 工具无法访问的系统资源
协作方式:
- 明确告知用户需要协助的具体操作
- 用户完成后,AI 继续后续测试步骤
- 记录协作点到测试文档
原则:半自动化测试同样有效,AI 分担大部分工作,人类补充 AI 难以处理的环节。
AI cannot complete all tests 100% autonomously; human assistance is required in some scenarios:
Situations where human assistance can be requested:
- Browser pages need to be manually opened or navigated
- Manual verification of visual effects is required
- Involves complex user interaction flows
- System resources inaccessible to AI tools
Collaboration Method:
- Clearly inform the user of the specific operations requiring assistance
- After the user completes the task, AI continues with subsequent test steps
- Record collaboration points in the test document
Principle: Semi-automated testing is also effective; AI handles most of the work, while humans supplement the parts that AI finds difficult to handle.
与 W00 协同(自动 + 手动)
Collaboration with W00 (Automatic + Manual)
- 进入测试前可自动调用 记录测试起点与下一步。
w00-workflow-checkpoint checkpoint - 测试失败并进入诊断时,可自动更新 issue 为 并记录 blocker。
status:blocked - 用户可手动执行 补记测试节点与读档信息。
/w00-workflow-checkpoint
- Before entering testing, automatically call to record the test starting point and next step.
w00-workflow-checkpoint checkpoint - When tests fail and enter diagnosis, automatically update the issue to and record the blocker.
status:blocked - Users can manually execute to supplement test nodes and checkpoint information.
/w00-workflow-checkpoint
禁止事项
Prohibited Items
- ❌ 跳过或延迟测试
- ❌ 未记录结果就报告完成
- ❌ 失败后继续提交
- ❌ Skip or delay testing
- ❌ Report completion without recording results
- ❌ Submit changes after test failure
工具脚本
Tool Scripts
- - 单元测试工作流
scripts/run_test_workflow.py - - 浏览器测试工作流
scripts/run_browser_tests.py - - 自动诊断
scripts/auto_diagnose.py
- - Unit test workflow
scripts/run_test_workflow.py - - Browser test workflow
scripts/run_browser_tests.py - - Automatic diagnosis
scripts/auto_diagnose.py
参考资料
Reference Materials
- - 测试工作流详细说明
references/testing-workflow.md - - 浏览器测试详细说明
references/browser-testing.md - - 诊断流程详细说明
references/diagnosis-workflow.md
- - Detailed testing workflow description
references/testing-workflow.md - - Detailed browser testing description
references/browser-testing.md - - Detailed diagnosis workflow description
references/diagnosis-workflow.md