CtrlK
BlogDocsLog inGet started
Tessl Logo
SkillPublic

testing-strategies

Choose the shortest feedback loop that exercises affected behaviour. Use for focused verification, regression tests, observable contracts, narrow integrations, test data, and deliberate coverage analysis in TypeScript projects, with supplementary Python examples.

Quality

77%

Does it follow best practices?

Run evals on this skill

Adds up to 20 points to the overall score

View guide
SecuritybySnyk

Passed

No findings from the security scan

Fix and improve this skill with Tessl

tessl review fix ./.agents/references/agent/ref.9ype9HjZ/SKILL.md
SKILL.md
Quality
Evals
Security

Testing Strategies

Start with the affected behaviour

Use the shortest feedback loop that exercises the affected behaviour.

This practice governs verification selection, order and scope throughout the kit. Follow repository-mandated gates at their defined stages.

  1. Start the normal application or native entry point when applicable. Observe diagnostics and exercise the changed behaviour.
  2. Use focused tests for added evidence. Keep the relevant tests in watch mode while iterating, using the project's installed tooling.
  3. Expand verification according to impact: affected consumers, shared logic, integration boundaries, and critical user journeys.
  4. Run comprehensive suites for integration, release, CI, or explicit requirements rather than after every local edit.

For an actual bug, reproduce it first, then retain a focused regression when it provides useful ongoing protection. For poorly understood existing behaviour, characterize the relevant outcome before changing internals.

See fast feedback examples for the development loop and observable contract examples for choosing assertions.

Choose the evidence you need

Protect observable state and consumer contracts. Real local collaborators are useful when they keep the test simple and meaningful. Assert interactions when the request, event, count, or ordering is itself contractual.

Affected behaviourFocused evidenceRead next
calculateTotal(items) or a domain ruleInputs → returned result; boundary cases that matterUnit patterns
POST /api/users or a database queryRequest/response, persisted state, or transaction across the relevant boundaryIntegration patterns
Registration form → API → redirectTargeted journey through the applicationE2E patterns
Service A → B communicationConsumer expectations plus provider verificationService contracts
Generated configuration or installed packageWhat the consumer can load, import, execute, or observeObservable contracts
Parser, serializer, or many input variationsKnown fixtures and useful invariantsTest data

Use the decision tree to select a boundary. Use the testing pyramid to review suite design, not to impose test-count quotas on a change.

Keep boundaries meaningful

  • Exercise the real behaviour under test. Preserve the relevant real integration boundary or use a faithful double backed by contract evidence.
  • Use fixtures or local HTTP interception for routine vendor API tests; run external contract and sandbox checks selectively.
  • Control time, randomness, and test data where reproducibility matters. Dispose of temporary files, database contexts, and handlers after use.
  • Prefer returned domain results, visible state changes, persisted records, and contractual events over private helper-call sequences.

See mocking strategies for boundary selection and test data strategies for fixtures, factories, seeds, and counterexamples.

Analyse coverage deliberately

Coverage shows what executed, not whether useful behaviour was verified. Request coverage analysis when it helps identify missing affected branches or assess suite quality. Use mutation testing selectively for important logic. Honour existing project and CI thresholds without introducing a new per-task percentage target.

See coverage strategies. CI and release verification can combine broader integration, service contracts, critical journeys, and existing coverage checks according to project requirements. Keep that separate from the focused edit/watch loop.

Use the project's tooling

Follow installed runner versions and project scripts. Use Vitest guidance for Vitest-specific execution and watch workflows, and test generation when deriving focused cases from requirements or existing behaviour.

The supplied examples demonstrate patterns; adapt them to the application's actual entry points and contracts:

TypeScript test conventions

Use the bundled TypeScript test conventions for AAA, isolation, descriptions, query priority, and snapshot restraint. Consuming repository conventions take precedence.

Repository

slurpyb/pi-taskfile

Path

.agents/references/agent/ref.9ype9HjZ/SKILL.md

Last updated
First committed

Is this your skill?

If you maintain this skill, you can claim it as your own. Once claimed, you can manage eval scenarios, bundle related skills, attach documentation or rules, and ensure cross-agent compatibility.