testing-best-practices

Enforce evidence-based testing principles with mode-driven workflows and Oracle Guard.

7|2|Updated Nov 30, 2025
One-click install
npx skills add https://github.com/ajbmachon/ajbm-skills --skill testing-best-practices-ajbmachon
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: testing-best-practices
Source: https://github.com/ajbmachon/ajbm-skills/tree/main/plugins/development-skills/skills/testing-best-practices
Command: npx skills add https://github.com/ajbmachon/ajbm-skills --skill testing-best-practices-ajbmachon

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill includes references (resource) components.

What problem does it solve?

Testing failures and flaky results waste time, and AI-generated tests can accidentally validate the current (possibly wrong) behavior instead of the intended requirements.

Core Features & Use Cases

  • Mode-based workflows (plan, write, review, report) to ensure consistent test strategy from conception through execution.
  • Testing Trophy test-level selection to choose the lowest test level that still provides meaningful confidence.
  • Oracle Guard + evidence reporting to prevent circular oracles by stating expected behavior first and requiring concrete execution outcomes.
  • Anti-pattern detection and mocking decision gates to reduce weak assertions, over-mocking, unrealistic fixtures, and conditional/interaction-heavy test bodies.
  • Application scope: unit, integration, and e2e test work for changes, reviews, and test status reporting.

Quick Start

Use testing-best-practices in write mode to update tests for your change by selecting observable outcomes, stating expected behavior up front, then running the tests and reporting concrete evidence.

Frequently Asked Questions about testing-best-practices

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

FAQPage Schema
Why do AI-generated tests accidentally validate wrong behavior, and how do I prevent it?

AI-generated tests can accidentally validate current wrong behavior instead of intended requirements, but an Oracle Guard prevents this by requiring you to state expected behavior up front before running tests to avoid circular validation.

How do I choose the right test level for unit, integration, and e2e testing?

To choose the right test level for unit, integration, and e2e testing, apply the Testing Trophy strategy to select the lowest possible test level that still provides meaningful confidence in your code changes.

What are common testing anti-patterns and how can I detect them during test review?

Common testing anti-patterns include weak assertions, over-mocking, unrealistic fixtures, and conditional test bodies. You can detect them during test review by applying structured anti-pattern checks and disciplined mocking decision gates.

How do I structure a reproducible test and report concrete execution evidence?

To structure reproducible tests and report concrete evidence, use a straight-line test structure without conditionals, then execute the tests and report the concrete command outputs and results to ensure the evidence is trustworthy.

What is the best way to plan, write, and review tests for a new feature?

The best way to plan, write, and review tests is to use mode-driven workflows. Start with plan mode to strategize, switch to write mode with mandatory Oracle Guard steps, then use review mode for anti-pattern checks before final reporting.

When should I use mocking in my tests, and when does it reduce test quality?

Mocking reduces test quality when overused, leading to unrealistic fixtures and weak assertions. Apply disciplined mocking decision gates during test creation to ensure mocks are only used where they genuinely improve test reliability without obscuring behavior.