Auditing Test Quality

Audit test suites for vanity tests and mock-to-assertion ratios.

1|Updated Jun 4, 2025
One-click install
npx skills add https://github.com/kynoptic/markdownlint-trap --skill auditing-test-quality
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: Auditing Test Quality
Source: https://github.com/kynoptic/markdownlint-trap/tree/main/.claude/skills/tests-audit-quality
Command: npx skills add https://github.com/kynoptic/markdownlint-trap --skill auditing-test-quality

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill includes scripts (resource) components.

What problem does it solve?

Poor quality tests (e.g., vanity tests, low mock-to-assertion ratio) lead to false confidence, high maintenance, and missed bugs. This Skill systematically audits test suites to identify and fix these issues, ensuring your tests provide real value.

Core Features & Use Cases

  • Automated Quality Audit: Runs a script to assess test quality, identifying non-behavioral names, excessive mocks, and poor assertion ratios.
  • Prioritized Issue Fixing: Guides users through fixing high, medium, and low-priority test issues, transforming vanity tests into robust behavioral tests.
  • CI/CD Integration: Provides configurations for pre-commit hooks and CI workflows to enforce test quality standards continuously.
  • Use Case: Review a legacy test suite to identify and refactor tests that only assert mocks were called, turning them into meaningful behavioral validations.

Quick Start

Use the "Auditing Test Quality" skill to run a quality audit on the project's test suite and suggest improvements.

Frequently Asked Questions about Auditing Test Quality

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

FAQPage Schema
How do I identify vanity tests in my test suite?

Vanity tests are tests that only assert mocks were called without validating actual behavior. Run the audit script to detect non-behavioral test names, excessive mocks, and poor mock-to-assertion ratios that indicate vanity tests masking low test quality.

What's the best way to audit test quality automatically?

Use an automated audit script (scripts/audit_tests.py or make audit-tests) that counts mocks and assertions, identifies non-behavioral naming, and reports issues with severity levels and remediation guidance for systematic improvement.

Can I integrate test quality checks into my CI/CD pipeline?

Yes. This Skill provides pre-commit hook and CI workflow configurations that enforce test quality standards continuously, catching vanity tests and poor mock-to-assertion ratios before code merges.

How do I fix tests with poor mock-to-assertion ratios?

The audit prioritizes issues by severity. Focus on high-priority tests first by converting mock-heavy assertions into behavioral validations that test actual outcomes rather than just call verification.

Does test auditing work with both unit and integration tests?

Yes. The audit applies to unit and integration tests in projects using behavioral naming conventions and mock/assertion counting practices, surfacing quality issues across both test types.

What do I need before running a test quality audit?

Your project must have a test audit script, tooling to count mocks and assertions, behavioral naming conventions in place, and a standardized output format to report issues and remediation paths.