Writing Tests

Guide unit and integration test writing with outcome-focused naming and edge-case checklists.

Updated Dec 6, 2025
One-click install
npx skills add https://github.com/audunstrand/status-app --skill writing-tests-audunstrand
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: Writing Tests
Source: https://github.com/audunstrand/status-app/tree/main/.github/skills/writing-tests
Command: npx skills add https://github.com/audunstrand/status-app --skill writing-tests-audunstrand

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

Writing clear and maintainable tests reduces bugs, documents expected behavior, and speeds up future changes by clarifying intent.

Core Features & Use Cases

  • Outcome-focused naming: Craft test titles that express the expected result rather than actions.
  • Precise assertions: Use concrete value checks to detect real regressions.
  • Systematic edge-case coverage: Create checklists for numbers, strings, collections, dates, null/undefined, and domain-specific inputs.
  • Guided practice: Integrate test-writing guidance into code reviews and TDD workflows.

Quick Start

Use this skill to structure new tests: name tests for outcomes, assert exact results, and enumerate edge cases, starting from a small function or module.

Frequently Asked Questions about Writing Tests

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

FAQPage Schema
How do I write maintainable unit tests that actually catch bugs?

To write maintainable unit tests that catch bugs, use outcome-focused test names, explicit value assertions, and single-concept tests. This ensures tests document expected behavior and clarify intent for future code changes.

What is the best way to name unit tests for expected outcomes?

The best way to name unit tests is to craft titles that express the expected result rather than the actions performed. This outcome-focused naming pattern makes tests readable and clarifies what the code is supposed to achieve.

How do I systematically cover edge cases in my test suite?

To systematically cover edge cases, create comprehensive checklists for numbers, strings, collections, dates, null, undefined, and domain-specific inputs. This ensures your tests detect real regressions across various boundary conditions.

Can I integrate test-writing guidance into TDD workflows and code reviews?

Yes, you can integrate test-writing guidance into Test-Driven Development workflows and code reviews. It helps structure new tests by naming outcomes, asserting exact results, and enumerating edge cases starting from a small module.

Why should I use explicit value assertions instead of general checks in testing?

You should use explicit value assertions because concrete checks detect real regressions. Precise assertions verify exact results, making your unit tests more reliable and maintainable across software projects like libraries and services.