unit-test-boundary-conditions
This skill provides systematic testing patterns for Java boundary conditions and corner cases using JUnit 5 and AssertJ. It covers numeric limits, string edge states, collection boundaries, floating-point precision, date/time edges, and array indexing scenarios. Use parameterized tests and tolerance-based assertions to validate that your code handles limits, special inputs, and overflow/underflow correctly.
Unit Test Boundary Conditions helps you write comprehensive edge case and limit tests for Java code using JUnit 5 and AssertJ.
AI-generated summary based on this skill's SKILL.md
Install
giuseppe-trisciuoglio/developer-kit/unit-test-boundary-conditions · repository language: Python
git clone https://github.com/giuseppe-trisciuoglio/developer-kit
cp -r developer-kit/plugins/developer-kit-java/skills/unit-test-boundary-conditions ~/.claude/skills/unit-test-boundary-conditionsnpx skillfed install giuseppe-trisciuoglio/developer-kit/unit-test-boundary-conditionsFrequently asked questions
AI-generated answers based on this skill's SKILL.md and metadata
What does unit-test-boundary-conditions help me test in Java?
unit-test-boundary-conditions provides systematic testing patterns for Java boundary conditions and corner cases using JUnit 5 and AssertJ. It covers numeric limits, string edge states, collection boundaries, floating-point precision, date/time edges, and array indexing scenarios so your code handles limits, special inputs, and overflow/underflow correctly.
How do I test integer overflow and underflow in Java?
unit-test-boundary-conditions guides you to test numeric overflow and underflow by validating behavior at Integer.MIN_VALUE, Integer.MAX_VALUE, and Long boundary values. Use parameterized tests with AssertJ assertions to verify that operations either wrap correctly, throw exceptions, or produce expected results at these numeric limits.
What patterns does unit-test-boundary-conditions recommend for junit 5 edge case testing?
unit-test-boundary-conditions emphasizes parameterized tests in JUnit 5 to systematically cover edge cases. Combine @ParameterizedTest with value sources for boundary values, use @ValueSource or @CsvSource to test multiple scenarios (null, empty, whitespace, min/max), and apply tolerance-based AssertJ assertions for floating-point precision validation.
How should I validate null, empty, and whitespace input handling?
unit-test-boundary-conditions recommends testing null references, empty strings, empty collections, and whitespace-only strings as distinct edge cases. Use parameterized tests to pass these inputs systematically, then assert expected behavior—whether your code rejects them, treats them as valid, or handles them gracefully with clear error messages.
What array index and collection boundary tests does the skill cover?
unit-test-boundary-conditions covers off-by-one errors, index out of bounds scenarios, and collection size boundaries. Test accessing index 0, the last valid index (size - 1), and invalid indices like -1 or size. Use parameterized tests to validate that your code either throws IndexOutOfBoundsException or handles these cases as intended.
How does unit-test-boundary-conditions address floating-point and special value edge cases?
unit-test-boundary-conditions guides testing NaN, positive/negative infinity, and precision issues using AssertJ's floating-point assertions with configurable tolerance. For date/time, test leap years, daylight saving transitions, and boundary dates. Parameterized tests with @CsvSource let you validate multiple special values in a single test method.
SKILL.md
rendered from the published skill — quoted content, verbatim
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
- Identify boundaries: List numeric limits (MIN_VALUE, MAX_VALUE, zero), string states (null, empty, whitespace), collection sizes (0, 1, many)
- Apply parameterized tests: Use
@ParameterizedTestwith
(truncated - see the full file via the links below)
Read as markdown · JSON record · Browse the source repository
File tree — 3 files
plugins/developer-kit-java/skills/unit-test-boundary-conditions/SKILL.md
plugins/developer-kit-java/skills/unit-test-boundary-conditions/references/concurrent-testing.md
plugins/developer-kit-java/skills/unit-test-boundary-conditions/references/parameterized-patterns.md