unit-test-boundary-conditions

Installation
SKILL.md

Unit Testing Boundary Conditions and Edge Cases

Overview

Systematic patterns for testing boundary conditions, corner cases, and limit values in Java using JUnit 5. Covers numeric boundaries, string edge cases, collection states, floating-point precision, date/time limits, and off-by-one scenarios.

When to Use

  • Numeric min/max limits, null/empty/whitespace inputs
  • Overflow/underflow validation, collection boundaries
  • Off-by-one errors, floating-point precision

Instructions

  1. Identify boundaries: List numeric limits (MIN_VALUE, MAX_VALUE, zero), string states (null, empty, whitespace), collection sizes (0, 1, many)
  2. Apply parameterized tests: Use @ParameterizedTest with @ValueSource or @CsvSource for multiple boundary values
  3. Test both sides of boundaries: Cover values just below, at, and just above each boundary
  4. Run tests after adding each boundary category to catch issues early
  5. Verify floating-point precision: Use isCloseTo(expected, within(tolerance)) with AssertJ
Related skills

More from giuseppe-trisciuoglio/developer-kit-claude-code

Installs
24
GitHub Stars
246
First Seen
Feb 21, 2026