kotlin-tdd
CommunityShip reliable Kotlin tests with fakes and TTTD
System Documentation
What problem does it solve?
It solves the problem of brittle, flaky Kotlin tests by guiding you to set up state predictably with fakes and to drive scenarios through domain behavior instead of direct data manipulation.
Core Features & Use Cases
- Frictionless, readable test setup: Use extension functions on companion objects (Object Mother style) and
.copy()to create consistent domain state quickly. - Fakes instead of mocks: Prefer HashMap-based fakes that behave like real implementations, enabling state-based assertions without mocking frameworks.
- Testing Through The Domain (TTTD): Populate and verify system state via domain operations (e.g., register/approve flows) so tests survive domain evolution.
- Controlled time: Use a
TestClockto deterministically test time-based behavior like expiration and scheduling. - SystemTestContext dependency injection: Inject a central test context with fakes for repositories and clients to keep test wiring simple and repeatable.
Real-world use cases include writing stable TDD-style test scaffolding for service workflows, verifying end-to-end-ish outcomes across domain operations with in-memory fakes, and testing time-dependent rules without waiting in real time.
Quick Start
Ask Claude to help you write a Kotlin test using SystemTestContext with fakes, create domain input with valid() Object Mothers, control time with TestClock if needed, and verify outcomes via domain operations (TTTD) instead of repository state setup.
Dependency Matrix
Required Modules
None requiredComponents
Standard package💻 Claude Code Installation
Recommended: Let Claude install automatically. Simply copy and paste the text below to Claude Code.
Please help me install this Skill: Name: kotlin-tdd Download link: https://github.com/anderssv/the-example/archive/main.zip#kotlin-tdd Please download this .zip file, extract it, and install it in the .claude/skills/ directory.
Agent Skills Search Helper
Install a tiny helper to your Agent, search and equip skill from 471,000+ vetted skills library on demand.