ValorVie

test-coverage-assistant

0
0
# Install this skill:
npx skills add ValorVie/custom-skills --skill "test-coverage-assistant"

Install specific skill from multi-skill repository

# Description

|

# SKILL.md


name: test-coverage-assistant
scope: partial
description: |
Evaluate test completeness using the 8 dimensions framework.
Use when: writing tests, reviewing test coverage, ensuring test quality.
Keywords: test coverage, completeness, dimensions, 8 dimensions, test quality, AI test quality, ๆธฌ่ฉฆ่ฆ†่“‹, ๆธฌ่ฉฆๅฎŒๆ•ดๆ€ง, ๅ…ซ็ถญๅบฆ.


Test Coverage Assistant

Language: English | ็น้ซ”ไธญๆ–‡

Version: 1.1.1
Last Updated: 2026-01-30
Applicability: Claude Code Skills


Purpose

This skill helps evaluate and improve test completeness using the 8 dimensions framework, ensuring comprehensive test coverage for each feature.

Quick Reference

The 8 Dimensions

โ”Œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”
โ”‚              Test Completeness = 8 Dimensions                โ”‚
โ”œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”ค
โ”‚  1. Happy Path        Normal expected behavior              โ”‚
โ”‚  2. Boundary          Min/max values, limits                โ”‚
โ”‚  3. Error Handling    Invalid input, exceptions             โ”‚
โ”‚  4. Authorization     Role-based access control             โ”‚
โ”‚  5. State Changes     Before/after verification             โ”‚
โ”‚  6. Validation        Format, business rules                โ”‚
โ”‚  7. Integration       Real query verification               โ”‚
โ”‚  8. AI Generation     AI-generated test quality (NEW)       โ”‚
โ””โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”˜

Dimension Summary Table

# Dimension What to Test Key Question
1 Happy Path Valid input โ†’ expected output Does the normal flow work?
2 Boundary Min/max values, limits What happens at edges?
3 Error Handling Invalid input, not found How do errors behave?
4 Authorization Role permissions Who can do what?
5 State Changes Before/after states Did the state change correctly?
6 Validation Format, business rules Is input validated?
7 Integration Real DB/API calls Does the query really work?
8 AI Generation AI-generated test quality Are AI tests meaningful?

When to Apply Each Dimension

Feature Type Required Dimensions
CRUD API 1, 2, 3, 4, 6, 7, 8*
Query/Search 1, 2, 3, 4, 7, 8*
State Machine 1, 3, 4, 5, 6, 8*
Validation Logic 1, 2, 3, 6, 8*
Background Job 1, 3, 5, 8*
External Integration 1, 3, 7, 8*

*Dimension 8 (AI Generation Quality) applies when tests are AI-generated

Test Design Checklist

Use this checklist for each feature:

Feature: ___________________

โ–ก Happy Path
  โ–ก Valid input produces expected success
  โ–ก Correct data is returned/created
  โ–ก Side effects occur as expected

โ–ก Boundary Conditions
  โ–ก Minimum valid value
  โ–ก Maximum valid value
  โ–ก Empty collection
  โ–ก Single item collection
  โ–ก Large collection (if applicable)

โ–ก Error Handling
  โ–ก Invalid input format
  โ–ก Missing required fields
  โ–ก Duplicate/conflict scenarios
  โ–ก Not found scenarios
  โ–ก External service failure (if applicable)

โ–ก Authorization
  โ–ก Each permitted role tested
  โ–ก Each denied role tested
  โ–ก Unauthenticated access tested
  โ–ก Cross-boundary access tested

โ–ก State Changes
  โ–ก Initial state verified
  โ–ก Final state verified
  โ–ก All valid state transitions tested

โ–ก Validation
  โ–ก Format validation (email, phone, etc.)
  โ–ก Business rule validation
  โ–ก Cross-field validation

โ–ก Integration (if UT uses wildcards)
  โ–ก Query predicates verified
  โ–ก Entity relationships verified
  โ–ก Pagination verified
  โ–ก Sorting/filtering verified

โ–ก AI Generation Quality (if AI-generated)
  โ–ก Tests verify meaningful behavior
  โ–ก Assertions are specific (not just "not null")
  โ–ก Tests are independent and self-contained
  โ–ก Mutation score > 80% (if evaluated)

Detailed Guidelines

For complete standards, see:
- Test Completeness Dimensions
- Testing Standards

AI-Optimized Format (Token-Efficient)

For AI assistants, use the YAML format files for reduced token usage:
- Base standard: ai/standards/test-completeness-dimensions.ai.yaml

Examples

1. Happy Path

[Fact]
public async Task CreateUser_WithValidData_ReturnsSuccess()
{
    // Arrange
    var request = new CreateUserRequest
    {
        Username = "newuser",
        Email = "[email protected]"
    };

    // Act
    var result = await _service.CreateUserAsync(request);

    // Assert
    result.Success.Should().BeTrue();
    result.Data.Username.Should().Be("newuser");
}

2. Boundary

[Theory]
[InlineData(0, false)]      // Below minimum
[InlineData(1, true)]       // Minimum valid
[InlineData(100, true)]     // Maximum valid
[InlineData(101, false)]    // Above maximum
public void ValidateQuantity_BoundaryValues_ReturnsExpected(
    int quantity, bool expected)
{
    var result = _validator.IsValidQuantity(quantity);
    result.Should().Be(expected);
}

4. Authorization

[Fact]
public async Task DeleteUser_AsAdmin_Succeeds()
{
    var adminContext = CreateContext(role: "Admin");
    var result = await _service.DeleteUserAsync(userId, adminContext);
    result.Success.Should().BeTrue();
}

[Fact]
public async Task DeleteUser_AsMember_ReturnsForbidden()
{
    var memberContext = CreateContext(role: "Member");
    var result = await _service.DeleteUserAsync(userId, memberContext);
    result.ErrorCode.Should().Be("FORBIDDEN");
}

5. State Changes

[Fact]
public async Task DisableUser_UpdatesStateCorrectly()
{
    // Arrange
    var user = await CreateEnabledUser();
    user.IsEnabled.Should().BeTrue();  // Verify initial state

    // Act
    await _service.DisableUserAsync(user.Id);

    // Assert
    var updatedUser = await _repository.GetByIdAsync(user.Id);
    updatedUser.IsEnabled.Should().BeFalse();  // Verify final state
}

Authorization Matrix Template

Create a matrix for each feature:

Operation Admin Manager Member Guest
Create โœ… โœ… โŒ โŒ
Read All โœ… โš ๏ธ Scoped โŒ โŒ
Update โœ… โš ๏ธ Own dept โŒ โŒ
Delete โœ… โŒ โŒ โŒ

Each cell should have a corresponding test case.

Anti-Patterns to Avoid

  • โŒ Testing only happy path
  • โŒ Missing authorization tests for multi-role systems
  • โŒ Not verifying state changes
  • โŒ Using wildcards in UT without corresponding IT
  • โŒ Same values for ID and business identifier in test data
  • โŒ Testing implementation details instead of behavior
  • โŒ Accepting AI-generated tests without review
  • โŒ Assuming high line coverage means effective tests

Configuration Detection

This skill supports project-specific configuration.

Detection Order

  1. Check CONTRIBUTING.md for "Testing Standards" section
  2. Check for existing test patterns in the codebase
  3. If not found, default to all 8 dimensions (dimension 8 only when tests are AI-generated)

First-Time Setup

If no configuration found:

  1. Suggest: "This project hasn't configured test completeness requirements. Would you like to customize which dimensions are required?"
  2. Suggest documenting in CONTRIBUTING.md:
## Test Completeness

We use the 8 Dimensions framework for test coverage.

### Required Dimensions by Feature Type
- API endpoints: All 8 dimensions (8 only when AI-generated)
- Utility functions: Dimensions 1, 2, 3, 6, 8*
- Background jobs: Dimensions 1, 3, 5, 8*

*Dimension 8 applies when tests are AI-generated


Version History

Version Date Changes
1.1.0 2026-01-25 Updated: 7 dimensions โ†’ 8 dimensions (added AI Generation Quality)
1.0.0 2025-12-30 Initial release

License

This skill is released under CC BY 4.0.

Source: universal-dev-standards

# Supported AI Coding Agents

This skill is compatible with the SKILL.md standard and works with all major AI coding agents:

Learn more about the SKILL.md standard and how to use these skills with your preferred AI coding agent.