Index of every page on this site: llms.txt
All skills
nnennandukwe avatar

/tdd-bdd

@6837c5b
Run it yourself

Drive implementation and bug fixes from behavior and failing tests. Use when working in test-driven development or behavior-driven development style: translate requirements or bugs into Given/When/Then scenarios, choose the smallest useful test layer, write a failing test before production code, implement the minimum change to pass, and refactor with coverage preserved.

Use this Skill: https://skilld.dev/gh/nnennandukwe/skills/tdd-bdd

Nothing lands on disk. Nothing to clean up.

Fork this Skill

Edit a local copy. It keeps the author and licence.

referencestest-layer-selection.md

≈572 tokens on demand. Your agent reads this file only when SKILL.md points to it.

Test Layer Selection

Use this reference when deciding where a TDD or BDD scenario should live.

Core rule: choose the lowest layer that can fail for the intended reason.

Fast Decision Guide

Choose a unit test when the behavior is:

  • Pure branching logic
  • Value transformation
  • Parsing and validation with no real I/O
  • Small policy rules

Choose an integration test when the behavior depends on:

  • Database reads or writes
  • Filesystem interactions
  • Queue, cache, or message broker behavior
  • Multiple components collaborating inside one service

Choose a contract test when the behavior depends on:

  • HTTP request/response shape
  • Serialized event payload shape
  • SDK adapters or provider boundaries
  • Compatibility with a specific external schema

Choose an end-to-end test when the behavior only matters if proven across:

  • UI plus backend
  • Multiple services or processes
  • Authentication and routing layers together
  • A critical operator journey where wiring is the risk

Selection Questions

Ask:

  1. What exact regression am I trying to catch?
  2. Which layer would fail if that regression returned?
  3. What is the cheapest realistic place to assert it?
  4. Which dependencies should stay real for the failure to mean anything?

Practical Defaults

  • Start at unit level for pure rules.
  • Move to integration when the rule spans persistence or component collaboration.
  • Add contract tests at external boundaries that can drift independently.
  • Use end-to-end sparingly and intentionally.

Mocking Rule

Mock unstable or expensive boundaries. Keep the boundary under test real.

Examples:

  • Parsing rule: no mocks, plain unit test
  • Repository write behavior: real repository plus ephemeral database if practical
  • External API adapter: real serializer, mocked network
  • UI purchase flow: real UI and app wiring, mocked payment provider if the provider is not the subject

Warning Signs

You chose too low a layer if:

  • The test passes while the user-facing bug still exists
  • The assertions mostly restate private helper behavior
  • You need to mock half the call graph to get through setup

You chose too high a layer if:

  • The failure signal is slow or noisy
  • The test breaks for unrelated wiring changes
  • A narrower test could prove the same rule

Source: SKILL.md on GitHub

No rule matched.

skilld matched fixed text patterns in SKILL.md and file names. Patterns miss obfuscated code.

skilld run checks every file with the same patterns. It asks for approval before it loads a Skill with a behavior marked Needs approval.

No alerts3mo3 checks · Risk SAFE
  • Gen Agent Trust Hub3mo

    The skill provides instructional guidance for Test-Driven Development (TDD) and Behavior-Driven Development (BDD). It contains no executable code, remote downloads, or suspicious instructions.

  • Socket3mo

    No alerts

  • Snyk3mo

    Risk: LOW · No issues

Signed by skilld at 6837c5b. This ties the file your Agent reads to that commit on GitHub. It does not review the instructions.

Last checked against GitHub 2 months ago.

Steadyupdated 4 months ago

README badge

README badge for nnennandukwe/skills/tdd-bdd