testing-patterns

Explain software testing patterns including the testing pyramid and AAA pattern.

Updated Jan 31, 2026
One-click install
npx skills add https://github.com/DaytimeBlues/ADHD-CADDI --skill testing-patterns-daytimeblues
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: testing-patterns
Source: https://github.com/DaytimeBlues/ADHD-CADDI/tree/main/.agent/skills/testing-patterns
Command: npx skills add https://github.com/DaytimeBlues/ADHD-CADDI --skill testing-patterns-daytimeblues

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill requires pytest, and includes scripts (resource) and references (resource) components.

What problem does it solve?

This Skill provides a comprehensive guide to software testing principles and patterns, helping developers write more reliable, maintainable, and efficient test suites.

Core Features & Use Cases

  • Testing Pyramid: Understand the ideal distribution of unit, integration, and E2E tests.
  • AAA Pattern: Learn the Arrange-Act-Assert structure for clear test cases.
  • Mocking Strategies: Discover when and how to use stubs, spies, mocks, and fakes.
  • Use Case: A developer struggling with flaky tests can consult this Skill to understand best practices for isolation, repeatability, and effective mocking, leading to more stable test results.

Quick Start

Explain the principles of the testing pyramid.

Frequently Asked Questions about testing-patterns

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

FAQPage Schema
What is the testing pyramid and how does it structure unit, integration, and E2E tests?

The AAA pattern structures tests into Arrange, Act, and Assert phases for clear test cases. You prepare the necessary data and context in Arrange, execute the test logic in Act, and verify the expected results in Assert.

When should I use mocking strategies like stubs, spies, mocks, and fakes in unit tests?

Use mocking strategies like stubs, spies, mocks, and fakes to isolate the code under test by replacing external dependencies. This ensures repeatability and prevents flaky tests by controlling the behavior of complex external systems during unit test execution.

How do I write effective integration tests with pytest?

Write effective integration tests with pytest by focusing on interactions between multiple components rather than isolated logic. Ensure proper test organization and use appropriate mocking techniques to manage external dependencies for reliable and maintainable integration test suites.

Why are my integration tests flaky and how can I fix them?

Flaky integration tests often stem from improper isolation and uncontrolled external dependencies. Fix them by applying effective mocking strategies to isolate components, ensuring test repeatability, and structuring test cases using the AAA pattern for consistent execution.

Does pytest support organizing tests by the AAA pattern for better maintainability?

Yes, pytest supports organizing tests using the Arrange-Act-Assert pattern. Structuring test cases this way improves code quality, readability, and maintainability by clearly separating data setup, logic execution, and result verification within your test functions.