testing

Design language-agnostic test strategies using TDD, BDD, and AAA patterns.

3|Updated May 18, 2019
One-click install
npx skills add https://github.com/barnabasJ/dotfiles --skill testing-barnabasj
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: testing
Source: https://github.com/barnabasJ/dotfiles/tree/main/agents/skills/testing
Command: npx skills add https://github.com/barnabasJ/dotfiles --skill testing-barnabasj

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill includes references (resource) components.

What problem does it solve?

This Skill provides language-agnostic expertise in software testing, helping users design, implement, and maintain robust test suites. It addresses common challenges like slow, fragile, or interdependent tests, ensuring high-quality software and reducing post-release bugs.

Core Features & Use Cases

  • Methodologies & Strategies: Apply TDD (Red-Green-Refactor) and BDD (Given-When-Then) patterns, and learn what to test (and what not to test) for effective coverage.
  • Test Organization & Quality: Structure tests using the AAA pattern, write clear test names, and ensure isolation, readability, and maintainability.
  • Mocking & Data Management: Master when and how to use mocks/stubs effectively, and choose between fixtures, factories, or inline data for efficient test setup.
  • Use Case: When starting a new project, use this skill to design a comprehensive testing strategy, including unit, integration, and E2E tests, ensuring all critical paths are covered and tests are fast and reliable.

Quick Start

Use the testing skill to explain the AAA pattern for test structure and provide an example of a well-named test case.

Frequently Asked Questions about testing

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I structure unit tests using the AAA pattern?

The AAA pattern (Arrange-Act-Assert) structures unit tests by setting up test data, executing the code under test, and verifying results. This approach ensures tests are readable, isolated, and maintainable across any programming language.

What's the best way to write test names that are clear and maintainable?

Clear test names describe what is being tested and the expected outcome, following conventions like "should_[behavior]_when_[condition]". Descriptive naming makes tests self-documenting and helps identify failures quickly without reading the test body.

How do I decide between unit tests, integration tests, and E2E tests?

Unit tests verify individual components in isolation; integration tests check how components work together; E2E tests validate entire workflows. Combining all three ensures comprehensive coverage—unit tests catch bugs early and run fast, integration tests verify interactions, E2E tests confirm user-facing functionality.

When should I use mocks versus real test data fixtures?

Use mocks to isolate code under test and avoid external dependencies; use fixtures or factories for realistic test data when integration is required. Mocks speed up tests and reduce brittleness; fixtures ensure tests reflect production scenarios.

What does TDD (Test-Driven Development) accomplish, and how does it differ from BDD?

TDD writes tests first (Red-Green-Refactor cycle) to drive implementation; BDD uses Given-When-Then syntax to align tests with business requirements. TDD focuses on code structure; BDD emphasizes behavior and stakeholder communication.

How do I make tests faster and prevent flaky or interdependent test failures?

Ensure test isolation by avoiding shared state, use mocks instead of real I/O, and keep setup minimal. Fast, independent tests run reliably in any order, catch regressions early, and enable confident continuous integration.