testing-patterns

Codify testing pyramid, AAA, and mocking patterns for software test suites.

Updated Jan 3, 2026
One-click install
npx skills add https://github.com/thgterto/Gerenciador-de-estoque --skill testing-patterns-thgterto
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: testing-patterns
Source: https://github.com/thgterto/Gerenciador-de-estoque/tree/main/.agent/skills/testing-patterns
Command: npx skills add https://github.com/thgterto/Gerenciador-de-estoque --skill testing-patterns-thgterto

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill includes scripts (resource) components.

What problem does it solve?

Testing patterns provide a structured approach to design and maintain reliable test suites, reducing flakiness and maintenance overhead.

Core Features & Use Cases

  • Testing Pyramid guidance to balance unit, integration, and end-to-end tests across projects.
  • AAA (Arrange-Act-Assert) pattern for clear, deterministic tests.
  • Mocking strategies and test-data principles to improve isolation and reproducibility.
  • Use Case: Apply these patterns to standardize tests in a CI pipeline and accelerate debugging.

Quick Start

Start by structuring a new unit test with AAA, apply the pyramid approach, and adopt consistent mocking when testing interactions.

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 reduce flakiness and maintenance overhead?

Apply the AAA (Arrange-Act-Assert) pattern to structure unit tests for clear, deterministic execution. This separates setup, execution, and verification, reducing flakiness and maintenance overhead by isolating test logic and making failures easier to diagnose.

What is the testing pyramid and how do I balance unit and integration tests?

The testing pyramid balances test suites by prioritizing a broad base of unit tests, fewer integration tests, and minimal end-to-end tests. This framework optimizes test reliability and execution speed across CI workflows by allocating test types proportionally.

What's the best way to isolate dependencies when running integration tests?

The best way to isolate dependencies during integration testing is implementing consistent mocking strategies and test-data principles. This improves isolation and reproducibility by replacing external interactions with controlled mocks, ensuring tests remain independent and deterministic.

Can I apply these mocking strategies across different testing frameworks?

Yes, these testing patterns standardize software tests across various software projects, testing frameworks, and CI workflows. The mocking essentials and test organization principles are framework-agnostic, providing actionable guidance applicable to diverse environments.

Why does my test suite fail randomly in the CI pipeline and how do I fix it?

Test suites fail randomly in CI pipelines due to poor isolation and non-deterministic behavior. Fix flakiness by adopting consistent mocking strategies, applying the AAA pattern, and following testing pyramid guidance to standardize execution and accelerate debugging.