testing-guide

Guides writing and reviewing tests with assertion, coverage, and mutation quality rules.

Updated Jan 12, 2026
One-click install
npx skills add https://github.com/ab300819/keel-workflow --skill testing-guide-ab300819
Or copy as Structured Prompt for Agent▼
Please help me install this Agent Skill.
Skill: testing-guide
Source: https://github.com/ab300819/keel-workflow/tree/main/skills/testing-guide
Command: npx skills add https://github.com/ab300819/keel-workflow --skill testing-guide-ab300819

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill includes references (resource) components.

What problem does it solve? Teams often write tests that achieve high line coverage but fail to actually verify behavior, relying on weak assertions, missing branch coverage, and tests derived from implementation code rather than requirements. This Skill enforces a test quality discipline so tests genuinely validate behavior. ## Core Features & Use Cases - Assertion and naming constraints: Bans weak assertions (toBeDefined, toBeTruthy) as sole assertions, requires behavior-describing test names, and enforces AAA structure with one behavior per test. - Quality thresholds and mutation testing: Defines authoritative thresholds for line/branch coverage and mutation score (80% target, 60% minimum), with configuration templates for Stryker, mutmut, PIT, and six other languages. - Branch coverage analysis (BCA): AI-driven analysis of defensive code branches (guards, exception paths, loop boundaries) to generate supplementary BCA-numbered tests complementing requirement-driven tests. - Use Case: After implementing an order-processing service, ask the AI to review the test suite; it flags weak assertions, analyzes uncovered branches like null guards and database error paths, and generates properly annotated supplementary tests. ## Quick Start Ask the AI to review the test file for your service module and identify weak assertions, untested branches, and missing requirement traceability.

Frequently Asked Questions about testing-guide

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

FAQPage Schema
How do I write effective unit tests that verify behavior?▼

Derive test cases from requirements and acceptance criteria rather than implementation code. Use AAA structure (Arrange, Act, Assert), name tests as '[method] should [expected behavior] when [condition]', and include at least one concrete assertion per test.

What are weak assertions in testing and why avoid them?▼

Weak assertions like toBeDefined, toBeTruthy, and not.toBeNull verify almost nothing about actual behavior. Tests using them as the sole assertion pass even when logic is broken, so they are treated as blockers; use specific value or structure assertions instead.

What is mutation testing and which tools support it?▼

Mutation testing automatically modifies code to check whether tests detect the changes, producing a mutation score. Supported tools include Stryker for JavaScript/TypeScript, mutmut for Python, PIT for Java, Stryker.NET for C#, Mull for C/C++, Muter for Swift, go-mutesting for Go, and cargo-mutants for Rust.

How do I find untested code branches in my project?▼

Run branch coverage analysis after requirement-driven tests are complete: enumerate conditionals, exception paths, guard clauses, and loop boundaries, map them against existing tests, then generate supplementary tests annotated with @covers-branch for defensive logic gaps.

What code coverage threshold should a project enforce?▼

The standard target is 80% for both line and branch coverage, with 60% as the minimum acceptable floor. Coverage is a necessary but not sufficient condition, so pair it with mutation score targets of 80% for core business logic.

When should I mock dependencies in unit tests?▼

Mock only external dependencies you do not own, such as databases, network requests, file systems, and third-party APIs. Never mock internal implementation details or pure functions, and always verify mock call arguments and invocation counts.