assertion-quality

Analyzes assertion variety and depth across test suites in any language.

Updated Jul 12, 2026
One-click install
npx skills add https://github.com/Patrick-Rex/DotNetTechSamples --skill assertion-quality-patrick-rex
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: assertion-quality
Source: https://github.com/Patrick-Rex/DotNetTechSamples/tree/main/.agents/plugins/dotnet-test/skills/assertion-quality
Command: npx skills add https://github.com/Patrick-Rex/DotNetTechSamples --skill assertion-quality-patrick-rex

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve? Test suites often pass while verifying very little: tests with no assertions, only trivial null checks, or the same equality assertion repeated everywhere give false confidence. This Skill audits assertion quality so you can see whether tests actually verify behavior, exceptions, state changes, and structure. ## Core Features & Use Cases - Assertion Classification: Classifies every assertion into 12 language-neutral categories (equality, exception, negative, state/side-effect, structural/deep, and more) across .NET, Python, TS/JS, Java, Go, Ruby, Rust, Swift, Kotlin, PowerShell, and C++. - Diversity Metrics: Computes per-test and suite-wide metrics such as average assertions per test, assertion type spread, zero-assertion tests, trivial-only tests, and self-referential/tautological assertions. - Calibrated Findings: Applies calibration rules so exception tests, meaningful boolean checks, mock verifications, and snapshot tests are not misflagged, then produces a summary dashboard, gap analysis, and prioritized recommendations. - Use Case: Point it at a freshly generated MSTest or pytest suite to find assertion-free tests and shallow tests before merging, or use it as a self-review step after AI test generation. ## Quick Start Analyze the assertion quality of the tests in my test project and report which tests are assertion-free, trivial, or lacking diversity.

Frequently Asked Questions about assertion-quality

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

FAQPage Schema
How do I check if my tests have meaningful assertions?

Run an assertion diversity analysis over your test files. Each assertion is classified into categories like equality, exception, negative, and state checks, then metrics reveal tests with zero assertions, only trivial null checks, or a single repeated assertion category.

What is a trivial assertion in unit tests?

A trivial assertion verifies nothing meaningful, such as Assert.IsNotNull(result), assert result is not None, or expect(x).toBeDefined() used alone. A null check followed by a real value assertion is a guard, not trivial; only tests with no meaningful value verification are flagged.

Does assertion analysis work with pytest, Jest, and Go tests?

Yes, the analysis is polyglot and covers MSTest, xUnit, NUnit, pytest, Jest, JUnit, Go testing, testify, RSpec, XCTest, Pester, GoogleTest, and more. Framework-specific assertion APIs are loaded from a language extension file before classification.

Are mock verifications counted as real assertions?

Yes. Mock-call verifications such as mock.Verify(...) in Moq, expect(mock).toHaveBeenCalledWith(...) in Jest, and verify(mock).method(...) in Mockito count as State/Side-effect assertions, so tests using them are not flagged as assertion-free.

When should I not use assertion diversity analysis?

Do not use it to write new tests, fix or rewrite assertions, measure line coverage, or run a general anti-pattern audit. It only evaluates the quality and diversity of existing assertions; exception-focused tests are also not penalized for low assertion counts.