context-driven-testing

Compare original and translation side by side

🇺🇸

Original

English
🇨🇳

Translation

Chinese

Context-Driven Testing

Context-Driven Testing

<default_to_action> When making testing decisions or adapting approaches:
  1. ANALYZE context: project goals, constraints, risks, team skills
  2. QUESTION practices: "Why this? What risk does it address? What's the cost?"
  3. INVESTIGATE not just check: Does software solve the problem, or create new ones?
  4. ADAPT approach based on context, not "best practices"
  5. DOCUMENT discoveries, not pre-written plans
Quick Context Analysis:
  • Mission: "Find important problems fast enough to matter" (not "execute test cases")
  • Risk: Safety-critical = high rigor; internal tool = lighter touch
  • Constraints: Startup with tight timeline ≠ enterprise with compliance
  • Skills: Novice needs structure; expert adapts intuitively
Critical Success Factors:
  • No "best practices" work everywhere - only good practices in context
  • Testing is investigation, not script execution
  • Context changes; your approach should too </default_to_action>
<default_to_action> 在制定测试决策或调整测试方法时:
  1. 分析上下文(ANALYZE context):项目目标、约束条件、风险、团队技能
  2. 质疑现有实践(QUESTION practices):"为什么采用这种方法?它能解决什么风险?成本是多少?"
  3. 开展调查而非仅做检查(INVESTIGATE not just check):软件是否解决了问题,还是带来了新的问题?
  4. 根据上下文调整方法(ADAPT approach):基于实际上下文,而非“最佳实践”
  5. 记录发现而非预设计划(DOCUMENT discoveries):记录测试过程中的发现,而非照搬预先编写的计划 </default_to_action>
快速上下文分析:
  • 核心目标(Mission):"及时发现关键问题"(而非"执行测试用例")
  • 风险(Risk):安全关键型系统需高严谨性;内部工具可采用更轻量化的测试方式
  • 约束条件(Constraints):时间紧张的初创项目 ≠ 需合规的企业级项目
  • 团队技能(Skills):新手团队需要结构化流程;专家团队可灵活调整
关键成功因素:
  • 不存在适用于所有场景的“最佳实践”,只有适配特定上下文的有效实践
  • 测试是一项调查工作,而非单纯执行脚本
  • 上下文会发生变化,测试方法也应随之调整

Quick Reference Card

快速参考卡片

When to Use

适用场景

  • Making testing decisions for new project
  • Questioning "that's how it's done" dogma
  • Adapting approach to specific constraints
  • Exploratory testing sessions
  • 为新项目制定测试决策时
  • 质疑“一直以来都是这么做的”固有教条时
  • 根据特定约束条件调整测试方法时
  • 开展探索性测试会话时

Seven Context-Driven Principles

七条Context-Driven Testing原则

  1. Value of any practice depends on its context
  2. Good practices in context, no universal best practices
  3. People working together are most important
  4. Projects unfold in unpredictable ways
  5. Product is a solution - if problem not solved, product fails
  6. Good testing is challenging intellectual work
  7. Judgment and skill determine right things at right times
  1. 任何实践的价值都取决于其所处的上下文
  2. 只存在适配上下文的有效实践,不存在通用的最佳实践
  3. 团队协作是最重要的因素
  4. 项目的发展具有不可预测性
  5. 产品是解决方案——若未解决问题,产品即失败
  6. 优质测试是一项具有挑战性的智力工作
  7. 判断能力和专业技能决定了在正确的时间做正确的事

Context Factors

上下文因素

FactorQuestions
ProjectBusiness goal? User needs? Failure impact?
ConstraintsTimeline? Budget? Team skills? Legacy?
RiskSafety-critical? Regulated? High volume?
TechnicalStack quirks? Integrations? Observability?
因素问题
项目(Project)业务目标是什么?用户需求是什么?失败的影响有多大?
约束条件(Constraints)时间周期?预算?团队技能?遗留系统?
风险(Risk)是否为安全关键型?是否受监管?交易量是否庞大?
技术(Technical)技术栈有哪些特性?集成情况如何?可观测性如何?

RST Heuristics

RST启发式方法

HeuristicApplication
SFDIPOTStructure, Function, Data, Interfaces, Platform, Operations, Time
OraclesConsistency with history, similar products, expectations, docs
ToursBusiness District, Historical, Bad Neighborhood, Tourist, Museum

启发式方法应用场景
SFDIPOT结构(Structure)、功能(Function)、数据(Data)、接口(Interfaces)、平台(Platform)、运维(Operations)、时间(Time)
Oracles与历史记录、同类产品、用户预期、文档的一致性
Tours商业区(Business District)、历史区(Historical)、不良区域(Bad Neighborhood)、游客区(Tourist)、博物馆区(Museum)

Context-Driven Decisions

Context-Driven Testing决策

Example: Test Automation Level

示例:测试自动化程度

Startup Context:
  • Small team, rapid changes, unclear product-market fit
  • Decision: Light automation on critical paths, heavy exploratory
  • Rationale: Requirements change too fast for extensive automation
Enterprise Context:
  • Stable features, regulatory requirements, large team
  • Decision: Comprehensive automated regression suite
  • Rationale: Stability allows automation investment to pay off
初创项目上下文:
  • 团队规模小、需求变化快、产品市场适配性不明确
  • 决策: 仅对关键路径进行轻量自动化测试,重点开展探索性测试
  • 理由: 需求变化过快,大规模自动化测试投入性价比低
企业级项目上下文:
  • 功能稳定、有合规要求、团队规模大
  • 决策: 构建全面的自动化回归测试套件
  • 理由: 功能稳定,自动化测试投入可获得长期回报

Example: Documentation

示例:测试文档

Regulated (FDA/medical):
  • Decision: Detailed test protocols, traceability matrices
  • Rationale: Regulatory compliance isn't optional
Fast-paced startup:
  • Decision: Lightweight session notes, risk logs
  • Rationale: Bureaucracy slows more than it helps

受监管场景(如FDA/医疗领域):
  • 决策: 编写详细的测试规程和可追溯性矩阵
  • 理由: 合规要求是硬性规定
快节奏初创项目:
  • 决策: 仅保留轻量化的测试会话记录和风险日志
  • 理由: 繁琐的文档流程对效率的负面影响大于其价值

Investigation vs. Checking

调查 vs 检查

CheckingTesting (Investigation)
Did API return 200?Does API meet user needs?
Does button work?What happens under load?
Match the spec?Does it solve the problem?

检查(Checking)测试(调查,Testing (Investigation))
API是否返回200状态码?API是否满足用户需求?
按钮是否可正常点击?高负载下会出现什么情况?
是否符合规格说明?是否解决了实际问题?

Red Flags: Not Context-Driven

警示信号:非Context-Driven Testing场景

  • Follow process "because that's how it's done"
  • Can't explain why you're doing something
  • Measure test cases executed, not problems found
  • Test plan could apply to any project
  • Stop thinking once you have a script

  • 遵循流程仅仅因为“一直以来都是这么做的”
  • 无法解释采用某一做法的原因
  • 以执行的测试用例数量而非发现的问题数量作为衡量标准
  • 测试计划可直接套用于任意项目
  • 编写完测试脚本后就停止思考

Agent-Assisted Context-Driven Testing

Agent辅助的Context-Driven Testing

typescript
// Agent analyzes context and recommends approach
const context = await Task("Analyze Context", {
  project: 'e-commerce-platform',
  stage: 'startup',
  constraints: ['timeline: tight', 'budget: limited'],
  risks: ['payment-security', 'high-volume']
}, "qe-fleet-commander");

// Context-aware agent selection
// - qe-security-scanner (critical risk)
// - qe-performance-tester (high volume)
// - Skip: qe-visual-tester (low priority in startup context)

// Adaptive testing strategy
await Task("Generate Tests", {
  context: 'startup',
  focus: 'critical-paths-only',
  depth: 'smoke-tests',
  automation: 'minimal'
}, "qe-test-generator");

typescript
// Agent analyzes context and recommends approach
const context = await Task("Analyze Context", {
  project: 'e-commerce-platform',
  stage: 'startup',
  constraints: ['timeline: tight', 'budget: limited'],
  risks: ['payment-security', 'high-volume']
}, "qe-fleet-commander");

// Context-aware agent selection
// - qe-security-scanner (critical risk)
// - qe-performance-tester (high volume)
// - Skip: qe-visual-tester (low priority in startup context)

// Adaptive testing strategy
await Task("Generate Tests", {
  context: 'startup',
  focus: 'critical-paths-only',
  depth: 'smoke-tests',
  automation: 'minimal'
}, "qe-test-generator");

Agent Coordination Hints

Agent协作提示

Memory Namespace

内存命名空间

aqe/context-driven/
├── context-analysis/*    - Project context snapshots
├── decisions/*           - Testing decisions with rationale
├── discoveries/*         - What was learned during testing
└── adaptations/*         - How approach changed over time
aqe/context-driven/
├── context-analysis/*    - Project context snapshots
├── decisions/*           - Testing decisions with rationale
├── discoveries/*         - What was learned during testing
└── adaptations/*         - How approach changed over time

Fleet Coordination

集群协作

typescript
const contextFleet = await FleetManager.coordinate({
  strategy: 'context-driven',
  context: {
    type: 'greenfield-saas',
    stage: 'growth',
    compliance: 'gdpr-only'
  },
  agents: ['qe-test-generator', 'qe-security-scanner', 'qe-performance-tester'],
  exclude: ['qe-visual-tester', 'qe-requirements-validator']  // Not priority
});

typescript
const contextFleet = await FleetManager.coordinate({
  strategy: 'context-driven',
  context: {
    type: 'greenfield-saas',
    stage: 'growth',
    compliance: 'gdpr-only'
  },
  agents: ['qe-test-generator', 'qe-security-scanner', 'qe-performance-tester'],
  exclude: ['qe-visual-tester', 'qe-requirements-validator']  // Not priority
});

Practical Tips

实用技巧

  1. Start with risk assessment - List features, ask: How likely to fail? How bad? How hard to test?
  2. Time-box exploration - 2 hours checkout, 30 min error handling, 15 min per browser
  3. Document discoveries - Not "Enter invalid email, verify error" but "Payment API returns 500 instead of 400, no user-visible error. Bug filed."
  4. Talk to humans - Developers, users, support, product
  5. Pair with others - Different perspectives = different bugs

  1. 从风险评估入手 - 列出所有功能,思考:故障发生的概率有多大?影响有多严重?测试难度如何?
  2. 为探索性测试设定时间盒 - 结账流程测试2小时、错误处理测试30分钟、每个浏览器测试15分钟
  3. 记录测试发现 - 不要写“输入无效邮箱,验证错误提示”,而是写“支付API返回500状态码而非400,无用户可见错误提示,已提交Bug”
  4. 与相关人员沟通 - 开发人员、用户、支持人员、产品经理
  5. 结对测试 - 不同视角能发现不同的Bug

Related Skills

相关技能

  • agentic-quality-engineering - Context-aware agent selection
  • holistic-testing-pact - Adapt holistic model to context
  • risk-based-testing - Context affects risk assessment
  • exploratory-testing-advanced - RST techniques

  • agentic-quality-engineering - 上下文感知的Agent选择
  • holistic-testing-pact - 使整体模型适配上下文
  • risk-based-testing - 上下文对风险评估的影响
  • exploratory-testing-advanced - RST技术

Remember

要点回顾

Context drives decisions. No universal best practices. Skilled testers make informed decisions based on specific goals, constraints, and risks.
You're not a test script executor. You're a skilled investigator helping teams build better products.
With Agents: Agents analyze context, adapt strategies, and learn what works in your situation. Use agents to scale context-driven thinking while maintaining human judgment for critical decisions.
上下文驱动决策。 不存在通用的最佳实践。优秀的测试人员会根据具体的目标、约束条件和风险做出明智的决策。
你不是测试脚本的执行者,而是一名专业的调查人员,帮助团队打造更优质的产品。
借助Agent: Agent可分析上下文、调整策略,并学习适配你的场景的方法。利用Agent扩大Context-Driven Testing的覆盖范围,同时保留人类在关键决策中的判断能力。