unit-test

Generates and repairs unit tests covering logic branches, boundaries, and exception paths.

1|Updated Sep 11, 2026
One-click install
npx skills add https://github.com/lldwb/lldwb-claude-skills --skill unit-test-lldwb
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: unit-test
Source: https://github.com/lldwb/lldwb-claude-skills/tree/main/skills/unit-test
Command: npx skills add https://github.com/lldwb/lldwb-claude-skills --skill unit-test-lldwb

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill includes references (resource) components.

What problem does it solve? Writing unit tests that genuinely cover branches and edge cases is tedious, and fixing failing tests without weakening assertions or deleting cases requires discipline. This Skill provides a structured workflow for both generating new unit tests and repairing failing ones while preserving test integrity. ## Core Features & Use Cases - Dual-Mode Operation: Generation mode writes tests covering normal flows, boundaries (null, extremes, thresholds), and exception branches, then executes them until they pass; repair mode diagnoses failure attribution (test code vs. production code) and applies minimal fixes, handing verification back to the user by default. - Failure Attribution Discipline: Distinguishes test-code problems (wrong expectations, missing mocks, order-dependent cases) from production defects, escalating cross-module issues to a bug-fix workflow instead of masking them. - Integrity Guardrails: Never weakens assertions, deletes cases, or changes correct expected values just to make tests green; isolates tests from real networks, clocks, randomness, and execution order using mocks and test doubles. - Use Case: A developer pastes a failing Maven test output and asks to make the tests pass. The Skill classifies each failure, fixes only the responsible code, reports the changes and production impact, and lets the user run the verification. ## Quick Start Ask the AI to generate unit tests for a specified class covering branches and edge cases, or paste failing test output and ask it to make those unit tests pass.

Frequently Asked Questions about unit-test

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

FAQPage Schema
How do I generate unit tests that cover edge cases and branches?

Provide the target class or method and request unit test generation. The workflow designs cases for normal flows, boundaries (null, extremes, thresholds), and exception branches using equivalence partitioning, then executes them until they pass.

How to fix failing unit tests without changing production code?

Paste the failing test output and request a fix. The workflow first attributes each failure to test code (wrong expectations, missing mocks) or production defects, then fixes only the responsible side with minimal changes and reports the impact.

Does this work with Maven, Jest, and pytest projects?

Yes, test commands follow the repository's build documentation, with defaults like mvn test for Maven modules, npm test or npx jest for JavaScript, and pytest for Python. It adapts to the project's existing test conventions and frameworks.

Why should failing tests not be fixed by weakening assertions?

Assertions encode business semantics, so weakening them hides real defects. The workflow treats changing correct expected values or deleting cases as a hard red line, and only modifies expectations when they are provably wrong against requirements.

When should I use a bug-fix workflow instead of unit test repair?

Use bug-fix when the failure's root cause spans modules, requires contract changes, or needs database migrations. The unit test workflow escalates such cases rather than forcing a local fix beyond test scope.