Skip to content
Back to skills

Testing Quality

ASecurity

Designs and improves reliable .NET unit, integration, contract, and end-to-end tests for observable behavior, failure paths, and regressions. Use for test creation or quality/flakiness diagnosis; do not use as a substitute for application implementation or full review.

  • 7 stars
  • 0 votes
  • 0 copies
  • 0 views
  • Added December 4, 2026
ai-agentssqltestingcode-reviewapidatabasesecurityperformance

Works with

  • api

Security analysis

A100/100

Pro scans all 2 files and shows the line behind each finding

Scanned December 4, 2026

npx -y skills add k4ndev/claude-code-dotnet --skill testing-quality --agent claude-code

Installs into .claude/skills of the current project.

Are you the author of Testing Quality?

Add the live security badge to your README. It updates with every re-scan.

Security grade badge for Testing Quality
[![Security: A — Skills Directory](https://www.skillsdirectory.com/api/skills/k4ndev-testing-quality/badge)](https://www.skillsdirectory.com/skills/k4ndev-testing-quality)

More formats (shields.io, HTML) on the badges page. Keep it an A: scan every change in CI with Pro.

Download with Pro
SKILL.md
---
name: testing-quality
description: Designs and improves reliable .NET unit, integration, contract, and end-to-end tests for observable behavior, failure paths, and regressions. Use for test creation or quality/flakiness diagnosis; do not use as a substitute for application implementation or full review.
---

# Testing Quality

## Purpose
Choose the lowest-cost test boundary that proves the behavior and risk the change actually affects.

## Scope
xUnit/NUnit/MSTest patterns, unit/integration/contract tests, fixtures, deterministic time, flakiness, and test diagnostics.

## When to use
- User asks to add tests, improve coverage, diagnose flaky tests, or validate behavior.
- A behavior change requires regression coverage.

## Do not use for
- Implementing the feature itself: use its domain skill.
- Evaluating a patch against all review guidelines: use `dotnet-code-review`.
- Runtime service diagnostic tooling: use `dotnet-diagnostics`.

## Required context
Identify observable contract, test framework/version, existing fixtures, database/provider and external dependencies, clock/randomness, test command, and CI constraints.

## Workflow
1. Name the behavior and failure risk; select unit tests for isolated logic and integration tests for wiring/framework/persistence semantics.
2. Follow the repository's test framework, naming, assertions, fixtures, and existing infrastructure.
3. Cover representative success, invalid input, authorization/boundaries, and relevant failure/cancellation paths.
4. Use integration tests for DI, middleware, auth, serialization, database translation, and provider-specific behavior.
5. Use relational provider/container when relational semantics matter; EF InMemory is not a relational substitute.
6. Control time via injected `TimeProvider` where supported, random seeds, deterministic synchronization gates, and stable fake boundaries.
7. Assert observable results/state, not only mocks; mock external boundaries rather than every collaborator.
8. Run targeted test then related suite; report exact commands and passed/failed/skipped/not-run distinctly.

## Decision rules
- Avoid sleeps, live network dependencies, order-dependent shared mutable fixtures, and broad mocks that encode implementation details.
- Do not weaken existing assertions to make a regression pass.
- Prefer a regression test that fails for the defect and passes for the intended behavior.

## Expected output format
List scenarios and test level, show representative test code, explain fixture/provider requirements, and report exact execution results without implying unrun checks passed.

## Common mistakes
- Testing private implementation details, relying on EF InMemory for SQL behavior, using real time/sleeps, or asserting only a collaborator call when user-visible state matters.

## Edge cases
- Async tests must await the task and assert cancellation/failure semantics.
- Integration fixtures may share expensive containers, but reset state deterministically and avoid cross-test leakage.
- Time-zone/clock behavior should test DST/offset boundaries when relevant.

## Examples
See [testing examples](examples.md) for a deterministic xUnit test and a flaky sleep-based alternative.

## Test scenarios
- Positive: “Add an integration regression test proving unauthenticated requests cannot reach this endpoint.”
- Negative: “Which EF projection is faster?” routes to `performance-review` / `efcore-patterns`.
- Boundary: “Test changed JSON compatibility” selects this skill and `api-contract-review` when compatibility is the concern.

## Related skills
`dotnet-code-review`, `api-contract-review`, `efcore-patterns`, `security-audit`, `async-concurrency`.

Files in this skill

  • SKILL.md3.6 KB
  • examples.md801 B

Attribution

Is this your skill, or is something wrong with this listing? Request removal or report an issue. Author removals are honored within 72 hours.

View all in ai-agents →

Comments

Loading comments…

Newsletter

Get the weekly list of safe new skills, and the ones we pulled.