testing-bdd-for-apps

testing-bdd-for-apps is a cursor rule for Cursor from SyntaxArc/archipy-plugin. It costs 2,299 tokens per session, scanned A, original, MIT.

A guide to behavior-driven development (BDD), a way to describe application behavior in examples and test those examples. It uses Behave for acceptance tests and test containers for running required services during tests.

In plain words
What is it for?
Use it to organize feature files and step definitions, share data during a test scenario, and start services such as databases only when tagged tests need them.
Why use it?
It gives tests a consistent structure and manages setup and cleanup for each scenario. This reduces repeated test code and avoids tests interfering with one another.

Cursor rule for Cursor

Written for Cursor: a Cursor rule (.mdc).

Good fit Use it to organize feature files and step definitions, share data during a test scenario, and start services such as databases only when tagged tests need them.

Compare 6 cursor rules from other repositories ↓
Install with agentmods
npx agentmods add rules/syntaxarc/archipy-plugin/testing-bdd-for-apps
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.

Clone the repo
git clone --depth 1 https://github.com/SyntaxArc/archipy-plugin

Made for: Cursor.

Wrote this? Show the measurements

A badge with what this costs and how it scanned, read live from this page, so it follows the numbers instead of freezing them. Markdown for a README, HTML for a documentation site or a project page.

agentmods badge for testing-bdd-for-apps

README.md
[![agentmods](https://agentmods.dev/badge/rules/syntaxarc/archipy-plugin/testing-bdd-for-apps/github.svg)](https://agentmods.dev/rules/syntaxarc/archipy-plugin/testing-bdd-for-apps)
Your own site
<a href="https://agentmods.dev/rules/syntaxarc/archipy-plugin/testing-bdd-for-apps"><img src="https://agentmods.dev/badge/rules/syntaxarc/archipy-plugin/testing-bdd-for-apps/github.svg" alt="Measured on agentmods" height="20"></a>

Or the 80×15 button, for a site that already has a row of RSS and ATOM ones. Only the verdict fits; the numbers stay here.

agentmods 80×15 button for testing-bdd-for-apps

Your own site · 80×15
<a href="https://agentmods.dev/rules/syntaxarc/archipy-plugin/testing-bdd-for-apps"><img src="https://agentmods.dev/badge/rules/syntaxarc/archipy-plugin/testing-bdd-for-apps.svg" alt="Reviewed on agentmods" width="80" height="20"></a>
Per session 2,299 This file is loaded in full into every session.
When invoked 2,299 The same file — it is already loaded in full.
Security scan A 0 findings. A grade says what 26 rules found in the file — not that it is safe.
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.1 $0.02299 $0.02299
Opus 5.5 $0.00920 $0.00920
Sonnet 5.5 $0.00460 $0.00460
Haiku 4.5 $0.00230 $0.00230

Measured 6d ago against content hash 7f2a2edd200c, method: parsed. Prices are Anthropic first-party input rates as of 2026-10-07, from the pricing page.

Security

Grade A, and why

testing-bdd-for-apps 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 6d 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.

rules/testing-bdd-for-apps.mdc · 175 lines

How it starts

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

BDD Testing for ArchiPy Apps

ArchiPy-style apps use Behave (not pytest) for acceptance tests. Every scenario drives the app through its services layer — the real REST or gRPC transport — against real infrastructure in testcontainers.

One exception: a process/task project (no REST or gRPC surface — Temporal/queue workers, Kafka consumers, scheduled or batch jobs, CLIs) has no services layer, so its scenarios drive the logic layer instead. See "Process/Task Projects" below.

Live: https://syntaxarc.github.io/ArchiPy/tutorials/testing_strategy/

Layout

features/
├── *.feature
├── steps/
├── environment.py                   # TestConfig + containers → app harness → per-scenario reset
├── test_containers.py               # ContainerManager + one container per @needs-* tag
├── app_harness.py                   # TestClient, real gRPC server + channel, Temporal worker, schema/reset hooks
├── scenario_context.py              # Per-scenario storage + cleanup
├── scenario_context_pool_manager.py # Singleton pool by scenario ID
└── test_helpers.py                  # get_current_scenario_context, rest_client, grpc_channel
.env.test

Extras: uv add --group dev "archipy[behave,testcontainers]". REST uses FastAPI's built-in TestClient (httpx ships with archipy[fastapi]); gRPC uses the app's generated stubs over a real channel.

The Seam Is the Transport

Steps call only the app's public API:

The harness always creates the app under test with AppUtils and registers the same routers/servicers as the production entrypoint — never a bare FastAPI() or grpc.server() — so exception handlers, interceptors, middleware, and lifespan match production:

  • REST: AppUtils.create_fastapi_app() + the app's create_<domain>_v{n}_router(container) routers, wrapped in fastapi.testclient.TestClient (entered as a context manager so the lifespan runs). Steps use rest_client(context).
  • gRPC: AppUtils.create_grpc_app(config) (sync) or create_async_grpc_app(config) (async) + the app's register_<domain>_v{n}_servicers(server, container), bound to 127.0.0.1:0 and started for real. Steps build generated *Stubs from grpc_channel(context). Do not use grpc_testing or call servicer methods directly — that skips the ArchiPy exception interceptor.
  • Async gRPC: in async def steps, async with context.app.async_grpc_channel() as channel:.

Read the full file on GitHub · 175 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. 6d ago Changed · +6 lines · +77 tokens per session 7f2a2edd200c
  2. 17d ago Changed · +24 lines · +439 tokens per session 1832c1f9f1b0
  3. 19d ago Changed · +29 lines · +810 tokens per session 91f1bded8aac
  4. 1mo ago Changed · +1 lines · +28 tokens per session acb867e28abf
  5. 1mo ago Changed · +54 lines · +479 tokens per session 08505f86661c
  6. 1mo ago First seen · 61 lines · 466 tokens per session scan A f7a13ac539b0

Subscribe to this mod's changes

testing-bdd-for-apps is a cursor rule published in the GitHub repository SyntaxArc/archipy-plugin (3 stars, last pushed 2d ago), licensed MIT. It adds 2,299 tokens to every session, about $0.0092 per session on Opus 5.5. 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-31.