testing

Write unit, integration, and end-to-end tests using TDD Red-Green-Refactor and AAA patterns.

5|Updated Feb 3, 2026
One-click install
npx skills add https://github.com/elct9620/ai-coding-skills --skill testing-elct9620
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: testing
Source: https://github.com/elct9620/ai-coding-skills/tree/main/skills/testing
Command: npx skills add https://github.com/elct9620/ai-coding-skills --skill testing-elct9620

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

Write tests using TDD (Red-Green-Refactor) and AAA pattern. Use for every new feature, behavior change, or bug fix. Covers unit, integration, and E2E test selection.

Core Features & Use Cases

  • Provide a structured workflow for writing tests that verify features at multiple levels (unit, integration, E2E).
  • Enforce the Red-Green-Refactor cycle and the AAA pattern to improve test clarity and maintainability.
  • Help teams maintain high-quality software by ensuring new changes are guardable with tests across scenarios such as feature addition, refactors, or bug fixes.

Quick Start

Write a failing unit test for a new feature, then implement the minimal code to pass the test and refactor for readability.

Frequently Asked Questions about testing

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

FAQPage Schema
How do I write tests using TDD and AAA patterns?

To write tests using TDD and AAA patterns, you follow the Red-Green-Refactor cycle and structure tests with Arrange, Act, Assert sections. This enforces test clarity by writing a failing test first, then implementing minimal code to pass, and refactoring for readability.

What is the difference between unit, integration, and E2E test selection?

Unit, integration, and E2E test selection determines the verification level based on the feature scope. Unit tests verify individual components, integration tests check interactions between modules, and E2E tests validate complete user workflows across the entire system.

When should I use TDD for bug fixes and behavior changes?

You should use TDD for bug fixes and behavior changes to ensure new changes are guardable with deterministic tests. Writing a failing test that reproduces the bug or verifies the new behavior first guarantees the subsequent code implementation resolves the exact issue.

How do I structure test suites for reliable and maintainable execution?

You structure reliable test suites by enforcing strict naming conventions, deterministic execution, and clear failure signals. Using the AAA pattern isolates test logic into distinct arrangement, action, and assertion phases to improve long-term maintainability and readability.

What's the best way to start writing a failing test for a new feature?

The best way to start is to write a failing unit test for the new feature, implement the minimal code required to pass the test, and then refactor the implementation for readability. This Red-Green-Refactor cycle ensures the test accurately verifies the feature.

Why do my integration tests fail non-deterministically?

Integration tests fail non-deterministically when they lack clear failure signals or depend on uncontrolled external states. Enforcing the AAA pattern and ensuring deterministic execution by isolating the Arrange and Act phases prevents unpredictable test behavior and false failures.