176 lines
15 KiB
Markdown
176 lines
15 KiB
Markdown
---
|
||
runScope: 'epic-level'
|
||
runKey: 'epic-6'
|
||
workflowStatus: 'completed'
|
||
workflowType: 'testarch-test-design'
|
||
totalSteps: 5
|
||
stepsCompleted: ['step-01-detect-mode', 'step-02-load-context', 'step-03-risk-and-testability', 'step-04-coverage-plan', 'step-05-generate-output']
|
||
lastStep: 'step-05-generate-output'
|
||
nextStep: ''
|
||
lastSaved: '2026-09-13'
|
||
auditedRevision: '083974c27f3a21a15807dd248bb6bc4fe04a5cd8'
|
||
inputDocuments:
|
||
- '_bmad-output/planning-artifacts/epics.md'
|
||
- '_bmad-output/planning-artifacts/prds/prd-crank-2026-08-03/prd.md'
|
||
- '_bmad-output/planning-artifacts/architecture/architecture-crank-2026-08-03/ARCHITECTURE-SPINE.md'
|
||
- '_bmad-output/test-artifacts/test-design-architecture.md'
|
||
- '_bmad-output/test-artifacts/test-design-qa.md'
|
||
---
|
||
|
||
# Test Design: Epic 6 — Встроенная проверка производительности
|
||
|
||
**Date:** 2026-09-13
|
||
**Author:** Bsodfather / BMad TEA
|
||
**Status:** Updated planning baseline; qualification not evaluated.
|
||
|
||
## Executive Summary
|
||
|
||
Scope: FR-36–FR-40, 6 stories, system scenario families CP-22..24. This plan refines the current system design; it neither changes approved product scope nor marks stories complete.
|
||
|
||
3 inherent risks, 3 high (score ≥6). Coverage seeds: 8 P0 and 4 P1 independently assertable scenarios. Counts describe the two seeds per story below, not implemented tests, coverage percentages or the eventual parameterized case count. Every source AC remains mandatory.
|
||
|
||
## Existing Coverage and Evidence
|
||
|
||
Source inventory at main `083974c`: Runtime metric/overhead patterns in `crates/crank-runtime/tests/product_metrics.rs` and `crates/crank-metrics/tests/overhead.rs`; real MCP fixture in `apps/ui/scripts/playwright-http-fixture.js` and `apps/ui/tests/e2e/onboarding.spec.js`.
|
||
|
||
No Load Scenario, runner, safety-plan or report feature suites found. Existing microbenchmarks/local budget checks do not prove generated RPS, control-plane isolation or product capacity. DAU preview is a load model, not the measured unique-Agent DAU rollup of 5.8.
|
||
|
||
Source presence ≠ execution ≠ requirement coverage ≠ qualification. No product test, deployment or load execution was performed for this plan. Reuse source tests only after matching their oracle to the current AC and recording a run on the candidate under test.
|
||
|
||
## Not in Scope
|
||
|
||
| Item | Reason | Mitigation |
|
||
|---|---|---|
|
||
| Unrelated future-epic implementation and whole-product refactoring | This is Epic 6 test planning | Keep explicit prerequisites below; do not invent additional story acceptance |
|
||
| SSO/RBAC enterprise features, non-REST adapters, HA/rolling deployment | Outside approved Community scope | Preserve Community boundary checks |
|
||
| Declaring current production readiness from source inventory | No bound qualification run | Require real evidence before gate |
|
||
| Product-wide 72-hour soak / 30-day burn-in | Owned by Epic 8 | Component fault/performance obligations in this epic remain required |
|
||
|
||
## Risk Assessment
|
||
|
||
Score = probability × impact on a 1–3 scale. Score ≥6 needs verified mitigation; 9 is an unresolved critical release risk, not a command to implement every mitigation immediately. Categories: SEC security, DATA integrity, OPS operations, PERF performance, BUS user behavior, TECH architecture/testing.
|
||
|
||
| Risk ID | Category | Failure | P | I | Score | System risk | Mitigation / accountable role / deadline |
|
||
|---|---|---|---:|---:|---:|---|---|
|
||
| E6-R1 | SEC | Forged/stale load plan dispatches damaging writes | 3 | 3 | 9 | R-010 | Signed fingerprint + replay/SSRF/write negatives; Security, 6.3 |
|
||
| E6-R2 | OPS | Runner duplicates generation or cannot stop | 2 | 3 | 6 | R-010 | Owner fencing + reserved path + independent kill; Runner, 6.4–6.5 |
|
||
| E6-R3 | PERF | Generator bottleneck/aggregation reports false SUT performance | 3 | 3 | 9 | R-006 | External calibration + independent counts; Performance, 6.6 |
|
||
|
||
Medium risks: shared R-012 (4), deterministic test isolation; QA owns continuous monitoring. No additional low risk is invented just to fill a template. Residual risk is unmeasured until evidence exists.
|
||
|
||
## NFR Planning
|
||
|
||
Hard non-overridable ceilings1000RPS/512VU/2h/10,000,000iterations (6.3). Qualification100RPS30m +250RPS5m, per-minute success≥99.95% and saturation rejects≤0.1%; platform overheadp95≤50ms/p99≤150ms with10ms upstream/cache off. Arrival tolerance and stop/drain policy must be frozen by owning story, never chosen silently by tests.
|
||
|
||
| Category | Scenario linkage | Planned validation / evidence |
|
||
|---|---|---|
|
||
| Security/privacy | SEC risks and B scenarios below | Scope/abuse/canary tests, bounded sanitized logs and network/scan report |
|
||
| Reliability/data integrity | DATA/OPS risks and fault scenarios | Real authority/state assertions, fault schedule and reconciled counters/digests |
|
||
| Performance/scalability | Numeric epic obligations above | Calibrated raw latency/resource samples, achieved load and immutable config/topology fingerprint |
|
||
| Maintainability/compatibility | Every changed component | Existing `just verify`/UI gates as applicable, schema/contract diffs and traceable regression reports |
|
||
|
||
Unknowns: exact execution hardware and fresh qualification artifacts are not available from this audit. Where the owning story requires a new tolerance, limit or version selection, freeze it in its approved contract before writing a numeric assertion; never replace the PRD threshold with a guessed easier value. Full NFR verdict belongs to `bmad-testarch-nfr` after execution.
|
||
|
||
## Entry Criteria
|
||
|
||
- Approved owning story/spec and prerequisites are available in the same worktree.
|
||
- ATDD loads the actual ACs from `epics.md` / selected spec and the system QA design.
|
||
- Existing tests and baseline failures are inspected before adding tests; no duplicate test suite solely for new IDs.
|
||
- Counted controllable upstream; signed-plan negative fixtures with exact change fingerprints; isolated runner CPU/memory/network and reserved control path; host kill socket in disposable sandbox; external calibrated generator/counters to separate harness saturation from SUT saturation.
|
||
- Missing fixture, service or approval is reported as blocked/not-run, not silently skipped.
|
||
|
||
## Test Coverage Plan
|
||
|
||
P0/P1/P2/P3 indicate priority, **not execution timing**. Each table row has two separate scenario seeds: `<Story>-<Level>-A` and `...-B`. Split a seed when independent assertions require different fixtures. Reuse an existing equivalent test rather than duplicating it; ATDD records exact test name/path and AC mapping.
|
||
|
||
The AC-count column inventories all `Given` groups under that source story, not a claim that two tests exhaust those groups. The last two former 6.1 full-workflow acceptance groups now belong to 6.6; 6.1 retains scenario definition only. Story 6.4 adds the approved correlation acceptance group. ATDD must map each group (story + ordinal + quoted acceptance text) to existing test, new test, or explicit not-run prerequisite before implementation. The approved spec controls finer-grained cases.
|
||
|
||
### P0 — Critical
|
||
|
||
Security, irreversible data integrity and false acceptance have no safe user workaround.
|
||
|
||
| Story / scenario IDs | Requirements | AC groups | Primary level | Risk | A: expected behavior | B: rejection / fault |
|
||
|---|---|---:|---|---|---|---|
|
||
| 6.3 / 6.3-INT-A,B | FR-38 | 6 | INT | E6-R1 | Signed short-lived exact LoadAuthorizationPlan covers scope, resolved targets and safety limits | Forgery/expiry/replay/rebinding/revocation/writes without sandbox-cleanup fail before dispatch |
|
||
| 6.4 / 6.4-INT-A,B | FR-38 | 7 | INT | E6-R1/E6-R2 | Idempotent durable Start grants one isolated generator owner using only public MCP and correlates accepted Run, generator and report identities | Crash/restart/missing heartbeat or overloaded API cannot defeat ceilings and independent permission-restricted emergency kill; per-process spool is used only where the owning telemetry contract applies, not introduced as a blanket runner requirement |
|
||
| 6.5 / 6.5-E2E-A,B | FR-39 | 6 | E2E | E6-R2 | Fresh bounded live stats and idempotent Stop operate through reserved control capacity | Out-of-order/disconnect/terminal update cannot claim false pass; emergency stop reconciles after recovery |
|
||
| 6.6 / 6.6-SYS-A,B | FR-40 | 9 | SYS | E6-R3 | Immutable digest-bound report independently accounts achieved load, percentiles and comparable fingerprints, and owns the transferred full-workflow acceptance from 6.1 | Interrupted/changed/incompatible runs cannot pass/compare silently; malformed responses stay valid redacted JSON |
|
||
|
||
### P1 — High
|
||
|
||
Core user journeys and complex integrations; limited workaround, not relaxed acceptance.
|
||
|
||
| Story / scenario IDs | Requirements | AC groups | Primary level | Risk | A: expected behavior | B: rejection / fault |
|
||
|---|---|---:|---|---|---|---|
|
||
| 6.1 / 6.1-API-A,B | FR-36 | 6 | API | E6-R1 | Scenario versions pin Tool/Agent/schema/generator refs and weighted mix | Draft/foreign/unsafe write/invalid weights or oversized samples rejected; editing never changes old Run semantics; end-to-end navigation/fingerprint acceptance is owned by 6.6 |
|
||
| 6.2 / 6.2-UNIT-A,B | FR-37 | 5 | UNIT | E6-R3 | Explicit DAU assumptions + seed deterministically produce matching backend/UI arrival curve | Zero/overflow/NaN/short-window/think-time conflicts rejected; peak capacity breach blocks Start |
|
||
|
||
### P2 / P3
|
||
|
||
No additional mandatory scope. Optional focused exploratory/cosmetic variants may be recorded later with owner and justification; they do not become an endless implementation/review queue.
|
||
|
||
Levels: UNIT pure contract/model; INT real filesystem/database/runtime boundary; API actual handler/protocol; E2E critical browser journey; SYS isolated full-stack qualification; MANUAL named human protocol. Use unit cases for algorithms, real PG for transaction/fencing, wire fixtures for protocol, browser only for user-visible interaction. Intentional defense-in-depth checks different failure surfaces, not identical duplicated assertions.
|
||
|
||
## Execution Strategy
|
||
|
||
Run all functional tests in PRs when they fit the target 15-minute feedback window; defer only expensive infrastructure/duration, not inconvenient failures. Current Playwright is Chromium, one worker: parallelization is a future isolation-dependent optimization, not a current claim.
|
||
|
||
- **PR:** changed functional/negative regressions and boundary suites; applicable Rust/tooling/config and UI gates.
|
||
- **Nightly:** bounded fault/contention, repeated isolation and resource trend tests after the required seams exist.
|
||
- **Weekly:** calibrated production-size performance, fresh-host/offline/recovery and manual qualification as applicable.
|
||
- **Epic / RC acceptance:** every mandatory AC and quantitative obligation must have exact-candidate evidence, even if its normal execution tier is weekly. Epic 8 owns the immutable long-duration release windows.
|
||
|
||
Nightly/weekly scheduling is a proposed execution model; the current Gitea pipeline has PR/push and release jobs, not those schedules. This planning task does not create them. `just verify` does not replace Playwright, deployment/image or qualification jobs.
|
||
|
||
## Resource Estimates
|
||
|
||
Incremental QA test/evidence effort with working production seams and reusable fixtures, excluding feature implementation, provisioning lead time and unaccelerated duration. Low-confidence planning ranges, not token budgets or compulsory numbers of new tests; reassess at each story ATDD after deduplication.
|
||
|
||
| Priority | Estimated effort |
|
||
|---|---|
|
||
| P0 | 40–80 hours |
|
||
| P1 | 24–48 hours |
|
||
| Optional P2 | 0–8 hours |
|
||
| Optional P3 | 0–4 hours |
|
||
| Total envelope | 64–140 hours, approximately 2–4 contributor-weeks |
|
||
|
||
If a measurement environment is missing, report the prerequisite; do not run large workloads opportunistically inside a story session.
|
||
|
||
## Exit Criteria and Quality Gates
|
||
|
||
- P0 pass 100%; P1 ≥95% is an interim development signal only, **100% of mandatory P1 and manual ACs must pass for acceptance**.
|
||
- Every owning-story AC has test/protocol plus bound execution evidence; no mandatory skipped/flaky/blocked/not-run item becomes pass.
|
||
- No unresolved Critical/High defect; high-risk mitigation verified on the owning scenario before release. Mandatory Habr conditions have no waiver.
|
||
- Coverage targets remain system planning goals (80% workspace /90% new critical code where measured); **no coverage report currently proves them**. Scenario counts do not substitute for coverage instrumentation.
|
||
- NFR evidence names revision, config/topology, tool/data versions, command, seed, timestamps, raw sanitized output digest and result.
|
||
- Story completion follows its spec, not all remaining epic/system gaps; no automatic reopening of done stories.
|
||
|
||
## Mitigation Plans
|
||
|
||
Each high-risk owner in the matrix: (1) implement/reuse the production-safe seam; (2) run its A/B and detailed AC cases with controlled failures; (3) bind the output to the candidate; (4) re-evaluate residual risk. Status is planned or source-partial, never verified solely by this document. Required completion time is the owning story/epic milestone in the risk table. No generic follow-up review loop is created.
|
||
|
||
## Assumptions and Dependencies
|
||
|
||
Published Tools + shared execution safety, metrics/artifacts and observable outcomes before live validation. 6.1 → 6.2 → 6.3 → 6.4 → 6.5 → 6.6. No arbitrary external targets or production writes authorized by this plan.
|
||
|
||
Accountable roles are responsibilities, not claims of staffed teams. Reference hardware, operator credentials and manual reviewers must be assigned before relevant qualification. Use disposable fixtures while waiting; lack of resources blocks the affected evidence, not permission to mutate a live deployment.
|
||
|
||
## Interworking and Regression
|
||
|
||
Affected components and reusable suites are named in Existing Coverage. Preserve existing REST→MCP, auth/credential/approval, config/migration, correlation and Community-boundary behavior whenever those shared contracts change. Frontend failures need actual browser regression; registry races need real-PG assertions, not UI mocks.
|
||
|
||
## ATDD Handoff
|
||
|
||
For the selected not-yet-implemented story only, load this plan and the exact approved spec; freeze its finite AC-to-test checklist before implementation. Prefer existing Rust/PG/Playwright patterns, add only uncovered acceptance scenarios and reproduce RED for missing behavior without artificial failure. Existing correct behavior may already be GREEN: record it honestly. Resume matching incomplete ATDD, reuse completed matching checklists and update only changed ACs. Do not invoke whole-epic automation on each review.
|
||
|
||
Automatic pre-implementation ATDD requires the project build-auto handoff override; the stock bmad-loop0.11.1 TEA ATDD injection is post-dev and is not that sequence. Loop configuration is separate from completion of this plan. The design workflow itself does not run ATDD or product implementation.
|
||
|
||
## References and Validation
|
||
|
||
- Epic/AC source: `_bmad-output/planning-artifacts/epics.md`, Epic 6.
|
||
- System contract: [architecture](test-design-architecture.md), [QA inventory and execution](test-design-qa.md).
|
||
- Normative PRD and architecture spine: frontmatter inputDocuments.
|
||
- TEA knowledge: risk-governance, probability-impact, test-levels-framework, test-priorities-matrix, nfr-criteria.
|
||
- Utility integration: Playwright/Pact flags are true but packages absent. No imports, framework migration or Pact service are generated. Browser CLI unavailable; source-based design only.
|
||
- Validation: story IDs/requirements/AC counts, risk arithmetic/linkage and document paths checked; no final test/NFR PASS issued. Approval is planning-level user direction, not fabricated reviewer signatures.
|