TDD Skill — BitcoinAddressFinder
Description
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
Installation
This entry records only its repository, not the path inside it, so there is no
exact command to give. Open the source below and copy the folder into
~/.claude/skills/, or the file into ~/.claude/agents/.
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
Spec Kit
💫 Toolkit to help you get started with Spec-Driven Development
Testing Webapp Testing
Test local web applications using Playwright for UI verification and debugging
Testing #29
, [#52](https://github.com/affaan-m/everything-claude-code/issues/52), [#103](https://github.com/affaan-m/ever
Testing Fix Issue
by metabase - Addresses GitHub issues by taking issue number as parameter, analyzing context, implementing sol
Testing Pypict Test Design
Design comprehensive test cases using PICT (Pairwise Independent Combinatorial Testing) for optimized test sui
Testing gstack
| 15,000+ | Garry Tan's exact Claude Code setup: 6 opinionated tools that serve as CEO, Eng Manager, Release M
Testing