testing-patterns

Define AAA structure, unit/integration selection rules, and mocking guidelines for test suites.

Updated May 19, 2026
One-click install
npx skills add https://github.com/TimeKast/AgendaInteligente --skill testing-patterns-timekast
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: testing-patterns
Source: https://github.com/TimeKast/AgendaInteligente/tree/main/.agent/skills/testing-patterns
Command: npx skills add https://github.com/TimeKast/AgendaInteligente --skill testing-patterns-timekast

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

This Skill helps you avoid flaky, slow, and hard-to-maintain test suites by standardizing practical patterns for unit and integration testing, including when and how to use mocking.

Core Features & Use Cases

  • AAA (Arrange-Act-Assert) testing structure to keep tests readable and outcome-focused.
  • Unit vs integration guidance to choose the right test type based on speed and what dependencies must be exercised.
  • Mocking principles and types (stub/spy/mock/fake) to isolate external APIs while still validating your code’s behavior.
  • Test organization and data strategies to structure suites with clear naming, grouping, fixtures, and factories.

Quick Start

Use the testing-patterns skill to review or plan your next test suite by ensuring each unit test is fast, isolated, and follows Arrange-Act-Assert while integration tests cover API/DB/service contracts with appropriate setup and teardown.

Frequently Asked Questions about testing-patterns

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

FAQPage Schema
How do I structure unit tests to make them more readable and maintainable?

Use the AAA (Arrange-Act-Assert) testing structure to keep unit tests readable and outcome-focused. Arrange sets up the state, Act executes the logic, and Assert verifies the result, reducing maintenance cost and flakiness.

When should I use integration tests instead of unit tests?

Use unit tests for fast, isolated, deterministic application logic checks. Use integration tests to cover API endpoints, database interactions, and service contracts where external dependencies must be exercised in a controlled environment.

What is the best way to isolate external API dependencies during testing?

Apply clear mock taxonomy using stubs, spies, mocks, and fakes to isolate external APIs. This isolates your code's behavior while validating interactions, reducing flakiness and maintenance cost in your test suites.

How do I manage test data to prevent flaky test suites?

Implement repeatable test data strategies using fixtures, factories, and builders. Consistent test organization with clear naming and grouping ensures repeatable test data strategies that reduce flakiness and maintenance overhead.

Can I use this testing approach for both database and API service contracts?

Yes, these testing patterns apply to building test suites for application logic, API endpoints, database interactions, and service contracts across both deterministic unit tests and controlled integration tests.