mh-cto-sdlc-performance-test-design
暂无简介
- License 许可
- MIT
- 最近更新
- 2026-05-13
- Stars
- ★ 2
- Forks
- 0
02 资源文件 2
- 其他customize.toml662 B
- 参考文档mh-skill-manifest.yaml446 B
03 SKILL.md 正文
Performance Test Design
Mode: synthesize-first (D34). Read the NFR spec, arch drivers, and tech stack. Derive performance test scenarios from measurable thresholds. Ask only where a threshold is missing or a scenario requires user journey context that is not in the artifacts.
Elite character: A performance test without an acceptance threshold is a benchmark, not a test — it produces a number with no pass/fail. A performance test without a realistic concurrency model produces a number that has no relation to production. Every performance test scenario must state: what we test, at what scale, with what ramp, and what the pass/fail criterion is.
Boring-first tool rule: Default tool is k6 (JS-native, Git-friendly scenarios, CI-embeddable). Deviate only if the constraint inventory documents a team tool preference or a protocol requirement (e.g., gRPC load testing).
Step 1 — Load Artifacts
Confirm present:
- NFR spec (
nfr-spec.md) ✓ / ✗ — REQUIRED - Arch drivers (
arch-drivers.md) ✓ / ✗ — REQUIRED - Tech stack (
tech-stack.md) ✓ / ✗ - Test strategy (
test-strategy.md) ✓ / ✗ - System diagram (
system-diagram.md) ✓ / ✗
Missing NFR spec: "Cannot design performance tests without measurable NFR thresholds. Ensure nfr-spec.md has quantified thresholds."
Step 2 — Extract Performance NFRs
From nfr-spec.md and arch-drivers.md, extract every quantified performance requirement:
For each requirement:
- NFR: [exact text or paraphrase]
- Metric: latency (P50/P95/P99) | throughput (req/s) | availability (%) | resource (CPU %) | recovery (RTO/RPO)
- Threshold: [the number — e.g. "P95 < 200ms", "500 req/s sustained", "99.9% uptime"]
- Scope: [which endpoints, services, or paths this applies to]
- Driver rank: Must / Should / Prefer
Skip NFRs with no measurable threshold. Flag them: "NFR '{text}' has no quantified threshold — cannot write a passing/failing test. Either specify a threshold or mark this NFR as not performance-testable."
Step 3 — Design Load Scenarios
For each performance NFR, design one or more load scenarios:
Scenario: {Name} — {NFR text}
Endpoint(s): {list of API endpoints or user journey steps}
Scenario type: Load | Stress | Spike | Soak
Concurrency model: {N} virtual users | {N} req/s sustained
Ramp: {N} VUs ramp from 0 to peak over {T} minutes, sustain for {T} minutes
Test data: {what test data the scenario requires — link to test-data-arch}
Dependencies: {external services — mock or real?}
Acceptance threshold:
- P95 response time: < {N}ms
- P99 response time: < {N}ms
- Error rate: < {N}%
- Throughput: ≥ {N} req/s
Pass condition: ALL thresholds met over the sustain period
Fail condition: ANY threshold exceeded for more than {T} seconds
Teardown: {how test data is cleaned up}
Scenario types:
- Load test: Simulates expected peak load. Validates the system handles normal + peak without degradation.
- Stress test: Pushes beyond peak to find the breaking point. Answers: where does it fail, how does it fail, does it recover?
- Spike test: Sudden concurrency jump (0 → peak in seconds). Validates autoscaling and connection pooling.
- Soak test: Sustained load over hours. Detects memory leaks, connection pool exhaustion, slow resource accumulation.
Minimum required: one load test per Must-satisfy performance NFR. Stress and soak tests for high-priority paths only.
Step 4 — Define Baseline Scenarios
For endpoints not covered by explicit performance NFRs, define a baseline smoke-load scenario:
Baseline: Every user-facing API endpoint gets at minimum a smoke-load test (10 VUs, 1 minute, pass threshold: error rate < 1%).
This catches regressions even when no explicit latency NFR exists.
Step 5 — Tool and Environment Specification
Tool selection (boring-first):
- Default: k6 — JS scenarios, runs in CI, integrates with Grafana for result dashboards
- Alternative (with rationale): Locust (Python-native teams), Artillery (YAML-config preference), Gatling (JVM/Scala shops)
Test environment requirements:
- Isolation: performance tests must run against a dedicated environment — not staging shared with manual testing
- Data: pre-seeded realistic data volume (% of expected production volume — specify)
- External services: mock external services unless the test specifically targets integration latency
- Monitoring: observability stack must be running during tests (metrics, traces) — performance failures without trace context are not actionable
Baseline metrics to capture alongside pass/fail:
- P50, P95, P99 latency per endpoint
- Error rate per endpoint
- CPU and memory of each service during test
- Database query latency (top 5 slow queries)
Step 6 — CI Integration Plan
Performance tests do not run on every PR (too slow). Define when they run:
| Gate | Trigger | Scenarios | Failure Policy |
|---|---|---|---|
| PR gate | PRs touching performance-critical paths | Smoke-load only | Warn (do not block) |
| Merge gate | Merge to main | Load test for Must-satisfy NFRs | Block if threshold exceeded |
| Release gate | Pre-release | Full scenario suite (load + stress + soak) | Block release |
| Scheduled | Weekly (cron) | Full suite + regression comparison | Alert on regression |
Step 7 — Write Output
Save to _mh-output/cto/sdlc/performance-test-design/{YYYY-MM-DD}_{r###}_performance-test-plan.md:
# Performance Test Plan
**Product:** {name}
**Date:** {date}
---
## Performance NFRs Covered
| NFR | Metric | Threshold | Rank | Scenario Count |
| --- | ------ | --------- | ---- | -------------- |
{rows}
## NFRs Flagged (no threshold)
{List — require threshold before test can be written}
## Load Scenarios
{Full scenario specs from Step 3}
## Baseline Scenarios
{List of endpoints with smoke-load specs}
## Tool Selection
{Tool + rationale}
## Environment Requirements
{From Step 5}
## CI Integration
{Table from Step 6}
Step 8 — Present Summary
Performance Test Design complete.
NFRs covered: {N} Must, {N} Should, {N} Prefer.
NFRs flagged (no threshold): {N} — require threshold before testing.
Scenarios designed: {N} load, {N} stress, {N} spike, {N} soak.
Tool: {chosen tool + one-sentence rationale}.
Next step: Run /mh-cto-sdlc-chaos-test-design to design chaos experiments.
04 同仓库更多 Skills
mh-vo-vault-brief
Weekly vault intelligence report — health score, pipeline status, OS alignment, and top issues. Use when the user says vault brief, weekly vault report, vault intelligence, run the vault brief, or weekly review brief.
mh-vo-output-bridge
Scan _mh-output/ for new artifacts and create or update corresponding vault entries. Use when the user says run the bridge, sync outputs to vault, output bridge, create vault entries, sync mh-output to vault, or bridge outputs.
mh-vo-moc-builder
Create or update Maps of Content for vault sections and ensure every note is reachable from a MOC. Use when the user says build MOCs, update MOCs, rebuild maps of content, MOC builder, create maps of content, or update the MOCs.
mh-vo-link-architect
Identify missing vault connections and generate precise link recommendations. Use when the user says recommend links, find missing connections, link architect, what should be connected, or identify missing links.
mh-vo-base-builder
Generate Obsidian Bases (.base files) for live database views of vault data. Use when the user says build base views, create base files, generate bases, build live views, or create database views.
mh-vo-taxonomy-enforcer
Audit vault tags and frontmatter, find drift, and apply corrections. Use when the user says fix the taxonomy, enforce tags, fix frontmatter, clean up tags, taxonomy enforcer, or fix tags.