testing

Review and refactor automated test suites for flakiness and coverage.

18|1|Updated Apr 17, 2026
One-click install
npx skills add https://github.com/kid-sid/codex-spellbook --skill testing-kid-sid
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: testing
Source: https://github.com/kid-sid/codex-spellbook/tree/main/skills/testing
Command: npx skills add https://github.com/kid-sid/codex-spellbook --skill testing-kid-sid

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

This Skill solves the common pain point of inconsistent, flaky, and poorly structured test suites that are hard to maintain, miss critical coverage, and fail unpredictably, wasting engineering time and letting regressions slip through.

Core Features & Use Cases

  • AAA Test Structure Guidance: Enforces Arrange-Act-Assert pattern to keep tests isolated, single-purpose, and easy to debug.
  • Coverage Target Recommendations: Provides tailored line coverage thresholds for shared libraries (≥90%), backend services (≥80% plus integration coverage), and frontend apps (≥70% on logic modules plus E2E coverage).
  • Mock vs Real Dependency Rules: Clear guidelines for when to mock (unstable boundaries like databases and HTTP clients) vs use real implementations (deterministic domain logic, serialization) to avoid unnecessary complexity and flakiness.
  • TDD and Parameterization Support: Step-by-step TDD workflow guidance and code examples for parameterized tests in Python and TypeScript to reduce duplicated test logic.
  • Flakiness Prevention: Actionable strategies to eliminate common flakiness causes like time dependence, randomness, order dependence, and external network calls.
  • Use Case Example: If your backend service has a flaky test suite with missing coverage for critical payment flows, use this Skill to enforce 80% line coverage, mock external payment gateway calls, and refactor duplicated tests into parameterized cases.

Quick Start

Use the testing skill to review your existing test suite for flakiness and missing coverage on critical user flows.

Frequently Asked Questions about testing

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

FAQPage Schema
How do I fix flaky tests caused by time, randomness, or external network calls?

To fix flaky tests, you must isolate and mock external boundary dependencies like network calls and inject deterministic values for time and randomness, preventing unpredictable test failures and false regressions.

What is the best way to structure unit tests for easier debugging?

The Arrange-Act-Assert (AAA) pattern is the best way to structure unit tests, keeping them isolated and single-purpose so that failures are easy to trace, debug, and maintain across your codebase.

When should I mock dependencies vs use real implementations in automated tests?

You should mock dependencies when dealing with unstable boundaries like databases and HTTP clients, but use real implementations for deterministic domain logic and serialization to avoid unnecessary test complexity and flakiness.

What code coverage targets should I enforce for backend services and shared libraries?

For shared libraries, enforce at least 90% line coverage. Backend services require 80% line coverage plus integration coverage, while frontend apps need 70% coverage on logic modules along with E2E tests.

How do I reduce duplicated test logic in Python and TypeScript?

You can reduce duplicated test logic by implementing parameterized tests in Python and TypeScript, allowing you to run the same test logic against multiple input combinations efficiently within a single test structure.

Does this testing approach support TDD workflows across Python, TypeScript, and Go?

Yes, this testing approach supports TDD workflows across Python, TypeScript, and Go codebases, providing step-by-step guidance to write tests first and enforce coverage on critical user flows.