TDD Skill — BitcoinAddressFinder — Testing skill for Claude Code
This skill documents test-driven development practices and refactoring patterns used in the BitcoinAddressFinder project.
How to install TDD Skill — BitcoinAddressFinder
This entry records only its repository, not the path inside it, so there is no
exact command to give. Open bernardladenthin/BitcoinAddressFinder and copy the folder into
~/.claude/skills/, or the file into ~/.claude/agents/.
What TDD Skill — BitcoinAddressFinder does
This skill documents **test-driven development practices and refactoring patterns** used in the BitcoinAddressFinder project. Apply these rules alongside `TEST_WRITING_GUIDE.md`, `CODE_WRITING_GUIDE.m
Alternatives in Testing
- Cc Sdd — Spec-driven development (SDD) for your team's workflow 3.1k ★
- AI Contribution Skills (Engram) — branch-pr: clean branch and PR workflow 2.5k ★
- Spec Kitty — Spec-Driven Development for serious software developers 1.6k ★
README
TDD Skill — BitcoinAddressFinder
This skill documents **test-driven development practices and refactoring patterns** used in the BitcoinAddressFinder project. Apply these rules alongside `TEST_WRITING_GUIDE.md`, `CODE_WRITING_GUIDE.md`, and `CLAUDE.md`.
1. Extract Static Methods Into a Non-Static Helper Class
Motivation
Static utility methods embedded in a domain class (e.g. `AddressTxtLine`) are hard to unit-test in isolation and cannot be mocked or injected. Extracting them into a dedicated, non-static helper class (e.g. `Bech32Helper`) allows:
- Direct, focused unit tests for each method without going through the owning class.
- Easier mocking when a consumer needs to stub the helper in its own tests.
- A single, named home for related utilities — consistent with the
BitHelperpattern already established in the project.
Pattern
**Before:** static method buried in a larger class
// AddressTxtLine.java — hard to test in isolation
private static byte[] decodeBech32CharsetToValues(String base32String) { ... }
**After:** non-static method on a dedicated helper class
// Bech32Helper.java — small, focused, testable
public class Bech32Helper {
public byte[] decodeBech32CharsetToValues(String base32String) { ... }
}
The owning class holds an instance field and delegates:
// AddressTxtLine.java
Bech32Helper bech32Helper = new Bech32Helper();
// ...
byte[] payload = bech32Helper.extractPKHFromBitcoinCashAddress(address);
Naming Conventions
- Helper class names end with
Helper(e.g.BitHelper,Bech32Helper). - The corresponding test class ends with
HelperTest(e.g.BitHelperTest,Bech32HelperTest). - Public constants on the helper follow
public static finalwith a Javadoc comment as required byCODE_WRITING_GUIDE.md.
When to Apply
Apply this extraction when:
- A class contains ≥ 2 closely related static (or effectively-static) methods that operate on the same concept.
- Those methods are not yet tested directly — their test coverage is indirect, piggybacking on a higher-level test class.
- The methods are stable enough that the refactoring does not break any public API contract.
Do **not** apply this extraction for one-off utility methods that logically belong to their host class and have no reuse outside it.
Accompanying Test Migration
When the extracted methods already have tests in the original test class (e.g. `AddressTxtLineTest`), **move** those tests to the new test class:
- Copy the test methods verbatim into
Test.java. - Delete them from the original test class.
- Clean up any imports in the original test class that are no longer needed after the removal.
- Add new tests for any methods that were not yet directly covered (see
TEST_WRITING_GUIDE.mdfor the required test structure).
2. Test Class for a Helper — Required Coverage
Every hel
Related Skills
Test Driven Development.SKILL
Enforces TDD discipline with RED-GREEN-REFACTOR cycle. Use when writing new features, fixing bugs, or refactor
TDD Workflow
Test-Driven Development workflow and patterns. Use when following TDD methodology or writing tests before impl
TDD Implement
by jerseycheese - Implements Test-Driven Development by analyzing feature requirements, creating tests first (
Neolab TDD
Test-driven development with NeoLab patterns
Property Testing Rules
Always-on property-testing standards from the Hypothesis documentation. Apply when writing tests for functions
Claude Codepro
by Max Ritter - Professional development environment for Claude Code with spec-driven workflow, TDD enforcemen
Related Agents
Kraken
You are a specialized implementation agent. Your job is to implement features and refactoring using a strict t
TDD Coach
Test-driven development guidance, test writing, coverage improvement
Tester TDD
Test-Driven Development and quality assurance expert. London School TDD approach. Use for writing tests, cover