unit-test-boundary-conditions

Installation
Summary

Systematic JUnit 5 patterns for testing numeric limits, null/empty cases, and edge conditions.

  • Covers numeric boundaries (Integer.MIN_VALUE, MAX_VALUE, zero), string edge cases (null, empty, whitespace), and collection sizes (empty, single, many)
  • Includes parameterized test examples using @ParameterizedTest and @ValueSource for efficient multi-case coverage
  • Demonstrates floating-point precision testing with tolerance-based assertions, overflow/underflow detection, and special values (NaN, Infinity)
  • Provides date/time boundary patterns (leap years, month boundaries, midnight), array index testing, and concurrent access scenarios
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

Installs
1.2K
GitHub Stars
246
First Seen
Feb 3, 2026