unit-test

Enforce table-driven tests, boundary checks, and killer cases in Go codebases.

29|5|Updated Mar 13, 2026
One-click install
npx skills add https://github.com/johnqtcg/awesome-skills --skill unit-test-johnqtcg
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: unit-test
Source: https://github.com/johnqtcg/awesome-skills/tree/main/skills/unit-test
Command: npx skills add https://github.com/johnqtcg/awesome-skills --skill unit-test-johnqtcg

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill requires python3, and includes scripts (resource) and references (resource) components.

What problem does it solve?

This Skill standardizes Go unit testing by emphasizing table-driven tests, deterministic boundaries, and killer-case coverage to surface defects early.

Core Features & Use Cases

  • Table-driven test scaffolding for exported functions and interfaces.
  • Mutation-resistant assertions that verify concrete fields, not just nil or error values.
  • Boundary-focused checks including nil, empty, single-element, and last-element scenarios; ensures correct handling of error propagation.
  • Killer Case design to guarantee detection of common defects and prove test robustness.

Quick Start

Run the unit-test skill by implementing a small table-driven test for a simple function and include a boundary killer-case to demonstrate defect detection.

Frequently Asked Questions about unit-test

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

FAQPage Schema
How do I write table-driven tests in Go that catch boundary errors?

Table-driven tests in Go catch boundary errors by structuring test cases to cover nil, empty, single-element, and last-element scenarios. This approach surfaces off-by-one errors and mapping losses early through deterministic boundary checks and mutation-resistant assertions.

What is a killer case in Go unit testing?

A killer case in Go unit testing is a specific test scenario designed to guarantee defect detection and prove test robustness. It targets common failures like race conditions and context cancellation handling to ensure your assertions are mutation-resistant.

How do I enforce coverage gates for a Go codebase using standard tooling?

You enforce coverage gates for a Go codebase by utilizing standard Go tooling and conventions to measure test coverage. This skill ensures coverage gates are met by focusing on table-driven tests, boundary checks, and killer cases across exported functions.

Does this Go unit testing approach handle race conditions and context cancellation?

Yes, this Go unit testing approach handles race conditions and context cancellation by specifically targeting them in killer case design. It enforces deterministic boundaries and clear, mutation-resistant assertions to verify correct propagation and concurrency handling.

Can I use this skill to test exported functions and interfaces in Go?

Yes, you can use this skill to test exported functions and interfaces in Go. It provides table-driven test scaffolding specifically for these components, ensuring mutation-resistant assertions verify concrete fields rather than just nil or error values.

How do I prevent mutation testing from passing my Go unit tests?

You prevent mutation testing from passing your Go unit tests by writing mutation-resistant assertions that verify concrete fields. This skill focuses on boundary checks and killer case design to guarantee detection of common defects and prove robustness.