scenario_testing

A testing rule that requires tests to model realistic user scenarios instead of checking only isolated functions. It considers different users, action sequences, concurrent load, and both short and long runs.

In plain words
What is it for?
Use it to design tests around real user goals and behavior, covering personas, sequences, concurrency, multiple load levels, bursts, sustained use, and longer sessions.
Why use it?
It aims to expose failures that simple happy-path tests miss, including problems caused by scale, timing, distracted users, slow connections, or competing sessions.

Cursor rule for Cursor

Install

Getting it into your agent

One page per mod, every tool's command on it. A separate URL per tool would split the same page into five that compete with each other.

agentmods
npx agentmods add rules/homenshum/nodebenchai/scenario_testing
Clone the repo
git clone --depth 1 https://github.com/HomenShum/NodeBenchAI

Made for: Cursor.

Per session 0 Nothing until a file matches its globs; then the whole rule loads.
When invoked 837 The whole file, excluding the scripts and references it only reads on demand.
Security scan A 0 findings. Scan, not verified.
Origin original No closer match found in the catalogue.
Token cost

What it costs to keep this loaded

Counted locally with the o200k_base tokenizer, which is exact for GPT models; Claude uses its own tokenizer and its counts differ. Treat this as one consistent yardstick across the catalogue rather than a bill. Prices are per million input tokens.

ModelPer sessionOnce invoked
Fable 5 $0.00000 $0.00837
Opus 5 $0.00000 $0.00418
Sonnet 5 $0.00000 $0.00167
Haiku 4.5 $0.00000 $0.00084

Measured 2d ago against content hash 058d4d300aa0, method: parsed. Prices are Anthropic first-party input rates as of 2026-08-30, from the pricing page.

Security

Grade A, and why

scenario_testing scanned grade A with 0 findings against 26 rules in 11 categories — prompt injection, anti-refusal, data exfiltration, privilege escalation, supply chain, agent snooping, system-prompt leakage, SSRF and excessive agency — measured 2d ago.

A static scan of the body, not an audit. Every finding is printed with the line that produced it so you can judge whether it matters here. A mod is markdown that instructs an agent; that is exactly why what it instructs is worth reading.

Nothing flagged

None of the 26 patterns this scan looks for appear in this file: no shell pipes, no recursive deletes, no credential paths, no hidden text, no instruction-override or anti-refusal phrasing, no agent-config snooping. That is not a guarantee, it is the absence of the things that are checkable.

.cursor/rules/scenario_testing.mdc · 73 lines

How it starts

The opening of the file, as written. The whole thing — 73 lines — stays where its author put it; the contents beside it link to each section on GitHub.

Scenario-Based Testing

Tests that don't model real human behavior are false confidence — not test coverage.

Core mandate

Never write simple tests. Every test must be scenario-based: start from a real user context, simulate realistic behavior, and verify system behavior under that context at scale.

"Do not go for simple tests — they are not able to truly address how real people's behavior is going to show up during production. Tests must always be scenario-based, catered and aligned with real human behaviors in all angles. Do not go shallow — they must go thoroughly, deeply, and must consider scale. They must consider long-running and short-running."

What "scenario-based" means

Every test must answer all six of these:

  1. Who — Which user persona? (first-timer, power user, distracted, adversarial, mobile/slow network, concurrent session)
  2. What — What is the user trying to achieve? (start from goal, not function signature)
  3. How — What is the action sequence, timing, and concurrency pattern?
  4. Scale — What happens at 1 user, 10 concurrent, 100 sustained? Single-user happy paths are necessary but not sufficient.
  5. Duration — Short-running (burst, spike) AND long-running (sustained load, state accumulation, memory leak over time). A test that passes in 1 second but fails after 30 minutes is a production gap.
  6. Failure modes — Edge cases, race conditions, degraded inputs, partial failures, auth expiry mid-flow, retry storms.

Required test categories per feature

Category What it covers
Single user — happy path Baseline correctness
Single user — all sad paths Every error condition, invalid input, boundary value
Concurrent users Race conditions, dirty reads, double-submit
Degraded conditions Slow network, auth expiry, partial API failures, quota exhaustion
Long-running accumulation State after 100+ sessions, memory/DB growth, stale cache eviction
Adversarial Injection, unexpected payloads, replay attacks on idempotent operations

Read the full file on GitHub · 73 lines

Changes

What this file has done since we first saw it

Hashed on every crawl. A supply-chain change to an agent config is a question of when, not whether, so the history is kept rather than the latest state alone.

  1. 2d ago First seen · 73 lines · 0 tokens per session scan A 058d4d300aa0

Subscribe to this mod's changes

scenario_testing is a cursor rule published in the GitHub repository HomenShum/NodeBenchAI (14 stars, last pushed 18d ago), licensed MIT. It costs nothing until one of its globs matches a file; then it loads 837 tokens. A static security scan graded it A with 0 findings. No closer match exists in the catalogue, so it is treated as the original; first seen 2026-08-30.