writing-good-tests

Guide unit and integration tests toward behavior-focused, maintainable patterns.

13|Updated Jan 18, 2026
One-click install
npx skills add https://github.com/pbdeuchler/llm-plugins --skill writing-good-tests-pbdeuchler
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: writing-good-tests
Source: https://github.com/pbdeuchler/llm-plugins/tree/main/plugins/house-style/skills/writing-good-tests
Command: npx skills add https://github.com/pbdeuchler/llm-plugins --skill writing-good-tests-pbdeuchler

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

Writing robust tests is essential but easy to do poorly; this skill guides you to focus on real behavior, avoid test-only production methods, and adopt proven patterns.

Core Features & Use Cases

  • Encourages table-driven testing to improve coverage with minimal maintenance.
  • Provides guidance on waiting strategies, mocking, and test isolation for reliable CI.
  • Use case: you need stable tests for a complex integration flow with multiple dependencies.

Quick Start

Start by drafting a table-driven test suite that covers happy and edge cases for the code under test.

Frequently Asked Questions about writing-good-tests

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

FAQPage Schema
How do I write unit tests that verify real behavior instead of implementation details?

To write tests verifying real behavior, focus on observable outputs and state changes rather than internal method calls. This approach ensures your unit tests remain maintainable and do not break during refactoring.

What is the best way to structure table-driven tests for edge cases?

Table-driven testing structures test cases as data rows in a table, allowing you to execute the same test logic against multiple inputs and expected outputs. This pattern improves coverage and simplifies maintenance for edge cases.

How do I manage mocking in integration tests without creating test-only production methods?

Manage mocking in integration tests by applying careful mocking strategies to external dependencies only. Avoiding test-only production methods keeps your codebase clean while ensuring test isolation and reliable CI feedback.

Why does my test suite fail in CI but pass locally when testing complex integration flows?

Integration tests failing in CI often stem from missing waiting strategies or inadequate test isolation for multiple dependencies. Implementing proper waiting strategies and mocking external services ensures reliable CI execution.

When should I avoid mocking dependencies in my test suite?

You should avoid mocking dependencies when integration tests need to validate real behavior across complex flows. Over-mocking can create brittle tests that pass locally but fail to prove actual system behavior in production.