home / skills / shotaiuchi / dotclaude / test-edge

test-edge skill

/dotclaude/skills/test-edge

This skill helps create comprehensive edge case tests for boundary, null, overflow, and malformed inputs to improve robustness.

npx playbooks add skill shotaiuchi/dotclaude --skill test-edge

Review the files below or copy the command above to add this skill to your agents.

Files (1)
SKILL.md
1.9 KB
---
name: test-edge
description: >-
  Edge case test creation. Apply when identifying and testing boundary
  conditions, null inputs, empty collections, overflow scenarios, unicode
  handling, and error path coverage.
user-invocable: false
---

# Edge Case Tests

Identify and write tests for boundary conditions and unusual input scenarios.

## Test Creation Checklist

### Boundary Conditions
- Test minimum and maximum allowed values (0, 1, MAX_INT, etc.)
- Verify off-by-one behavior at array/collection boundaries
- Check date/time edge cases (leap years, timezone transitions, epoch)
- Test string length limits (empty, single char, maximum length)
- Validate range boundaries for numeric parameters

### Null & Empty Handling
- Test null inputs for all nullable parameters
- Verify behavior with empty strings, collections, and maps
- Check optional/missing fields in structured data
- Test default value fallback when inputs are absent
- Validate graceful handling of uninitialized state

### Overflow & Limits
- Test integer overflow and underflow conditions
- Verify behavior at file size and memory allocation limits
- Check stack depth for recursive operations
- Test rate limiting and throttling thresholds
- Validate behavior when storage or quota is exhausted

### Malformed Input
- Test with invalid encoding (broken UTF-8, mixed encodings)
- Verify handling of special characters and unicode edge cases
- Check behavior with unexpected data types or formats
- Test truncated, corrupted, or partial input data
- Validate rejection of injection payloads in all input channels

## Output Format

Report test plan with priority ratings:

| Priority | Description |
|----------|-------------|
| Must | Boundary tests that prevent crashes and data corruption |
| Should | Edge cases likely encountered in production usage |
| Could | Unusual scenarios with low probability but high impact |
| Won't | Theoretical edge cases with negligible real-world risk |

Overview

This skill helps you design and prioritize edge case tests for software and scripts. It focuses on boundary conditions, null/empty inputs, overflow limits, malformed data, and error-path coverage. The output is a prioritized test plan suitable for implementation in shell-based test suites.

How this skill works

Provide a target function, API, command-line utility, or data schema and the skill inspects likely failure modes. It generates a checklist of concrete test cases grouped by priority (Must/Should/Could/Won't) and maps each case to verification steps and expected outcomes. The plan emphasizes minimal reproducible steps and clear triggers for automated shell tests.

When to use it

  • Designing unit or integration tests for new features
  • Auditing existing test coverage for robustness gaps
  • Preparing regression suites before releases
  • Hardening CLIs, scripts, or services against malformed inputs
  • Validating limits before performance or load tests

Best practices

  • Start with Must-priority tests that prevent crashes and data corruption
  • Include explicit expected outputs and exit codes for each case
  • Automate reproducible cases in shell scripts with input fixtures and cleanup
  • Cover both valid boundary values and immediate off-by-one neighbors
  • Document assumptions (max sizes, default fallbacks, encoding) alongside tests

Example use cases

  • Generate tests for numeric ranges: min, max, off-by-one, overflow wraparound
  • Create null/empty input scenarios for configuration parsers and environment variables
  • Test file and memory limits by creating large fixtures and observing failures
  • Produce malformed-encoding and unicode tests for text-processing utilities
  • Define rate-limit and quota-exhaustion scenarios for APIs and job queues

FAQ

How are priorities assigned?

Priorities map to risk and likelihood: Must prevents crashes/data loss, Should are common production cases, Could are rare high-impact scenarios, Won't are theoretical low-risk cases.

Can outputs be used directly in shell test scripts?

Yes. Test steps include concrete input forms, expected exit codes, and verification commands suitable for automation in shell-based CI.