All skills
asyrafhussin avatar

/testing-best-practices

@575c801

Unit testing, integration testing, and test-driven development principles. Use when writing tests, reviewing test code, improving test coverage, or setting up testing strategy. Triggers on "write tests", "review tests", "testing best practices", or "TDD".

Use this Skill: https://skilld.dev/gh/asyrafhussin/agent-skills/testing-best-practices

This session only. Nothing lands on disk.

README.md

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

Testing Best Practices v2.0.0

Unit testing, integration testing, and TDD principles for reliable, maintainable test suites.

Overview

  • Test structure (AAA pattern, descriptive names, one assertion per test)
  • Test isolation (independent, deterministic, no shared state)
  • Assertions (specific matchers, meaningful messages, custom matchers)
  • Test data (factories, builders, faker, fixtures)
  • Mocking (boundaries only, verify interactions, MSW)
  • Coverage (meaningful coverage, edge cases, unhappy paths)
  • Performance (fast unit tests, parallel execution, test organization)
  • 34 rules across 7 categories

Categories

1. Test Structure (Critical)

AAA pattern, descriptive names, one assertion, describe/it, BDD, setup/teardown.

2. Test Isolation (Critical)

Independent tests, no shared state, deterministic, cleanup, test doubles.

3. Assertions (High)

Specific assertions, meaningful messages, expected-first, custom matchers.

4. Test Data (High)

Factories, builders, faker, minimal data, realistic edge cases, fixtures.

5. Mocking (Medium)

Mock at boundaries, verify interactions, don't over-mock, realistic mocks.

6. Coverage (Medium)

Meaningful coverage, edge cases, error scenarios, 80% baseline not 100%.

7. Performance (Low)

Fast unit tests, parallel execution, organized test tiers.

Usage

Write tests for this service class
Review my test code for best practices
Set up testing strategy for this project

References

Source: SKILL.md on GitHub

No alerts16d5 checks · Risk SAFE
  • Gen Agent Trust Hub16d

    The skill provides comprehensive guidelines and best practices for unit testing, integration testing, and Test-Driven Development (TDD). It consists entirely of documentation and illustrative code examples using industry-standard tools like Jest and Vitest. No security risks or malicious patterns were detected.

  • Socket16d

    No alerts

  • Snyk16d

    Risk: LOW · No issues

  • Runlayer6mo

    29 files scanned · No issues

  • ZeroLeaks5mo

    Score: 93/100 · 2 sections analyzed

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

Last checked against GitHub last month.

Steadyupdated 7 months ago
metadata
{
  "author": "agent-skills",
  "version": "2.0.0"
}

README badge

README badge for asyrafhussin/agent-skills/testing-best-practices