Skills

Assertion Quality

Analyze assertion quality, depth, variety, and false confidence in existing tests.

Install

npx skills add managedcode/dotnet-skills --skill assertion-quality -g -a claude-code -y
Category
Testing
Updated
6d ago
License
MIT
Context cost
Mediumabout 3,000 tokens
Runs scripts
No, instructions only

What it does

Analyze assertion quality, depth, variety, and false confidence in existing tests. ALWAYS USE when asked about weak, shallow, trivial, always-true, self-referential, assertion-free, presence/truthiness-only, or insufficiently diverse assertions, including MSTest, Jest, pytest, and Go. DO NOT USE for direct fixes: writing-mstest-tests owns supplied MSTest assertions; code-testing owns new cases. Use test-gap-analysis when asked whether tests would catch a production change, and test-anti-patterns for general severity-ranked audits.

Assertion Diversity Analysis

Analyze test code in any supported language to measure how varied and meaningful the assertions are. Produce a metrics report that reveals whether tests verify different facets of correctness, not just "output equals X" but also structure, exceptions, state transitions, side effects, and invariants.

Language-specific guidance: Read the caller-provided or runtime-listed test-analysis-extensions catalog, then its matching language file (dotnet.md, python.md, typescript.md, go.md, etc.). test-analysis-extensions is reference-only; do not invoke it as a skill. If the bundle is absent, use the pinned framework and this skill's rules, report the missing reference, and do not search installation directories.

Why Assertion Diversity Matters

Low assertion diversity signals shallow testing. Tests may pass while bugs hide in unasserted logic. Common symptoms:

ProblemSymptomConsequence
Trivial assertionsTest contains only Assert.IsNotNull(result) / assert result is not None / expect(x).toBeDefined()Test passes but doesn't verify correctness
Single-value obsessionAlways check one field or return valueBugs in unasserted logic slip through
No negative assertionsNever check what shouldn't happenRegressions sneak in through false positives
No state checksDon't verify object state changesMissed side-effects or lifecycle issues
No structural checksOnly assert top-level valueBugs in nested objects go unnoticed
Assertion-free testsTests that call but don't verifyCode coverage lies; false security

When to Use

Read the whole SKILL.md on GitHub

More in Testing