
Kotlin Testing Patterns
Write Kotlin tests with Kotest, MockK, coroutine testing, property tests and Kover coverage
- Repository
- affaan-m/ECC
- Stars
- 295,127
- Licence
- MIT
- Files
- 1 file
What it does
When installed, the agent follows structured Kotlin testing practices: it picks a Kotest spec style, mocks dependencies with MockK, works test-first (write a failing test, make it pass, then refactor), and checks coverage with Kover. The file is mostly reference examples of how these tests are written, so the agent produces more idiomatic Kotlin tests than it would by default.
Great for
- Kotlin developers who want tests written in Kotest and MockK style
- Teams practising test-driven development on Kotlin or Ktor projects
- Developers setting up Kover code coverage with Gradle
Skip it if
- Projects that use JUnit-only or Java testing stacks, since the patterns assume Kotest and MockK (the examples would need adapting)
- Non-developers, because the output is Kotlin code and Gradle commands that require a working build setup
Try asking
- “Write Kotest tests for this EmailValidator function, starting with failing tests first”
- “Add MockK-based unit tests for my UserService with coroutine suspend functions”
- “Set up Kover and tell me how to get my module above 80% coverage”
- “Convert my existing JUnit tests for OrderService into a BehaviorSpec”
Install in 3 steps
- 1
Download the skill
The ZIP contains the 1 original files, the MIT licence and an attribution note.
kotlin-testing.zip - 2
Add it to your agent
Claude Code (all projects)
mkdir -p ~/.claude/skills && unzip kotlin-testing.zip -d ~/.claude/skills/Claude Code / Agent SDK (this project only)
mkdir -p .claude/skills && unzip kotlin-testing.zip -d .claude/skills/Claude apps (web/desktop): Settings → Capabilities → Skills → Upload skill, and choose the ZIP.
- 3
Ask for the task
No special command needed — the agent reads the skill's description and loads it when your request matches. Try one of the prompts above.
Get better results
- Name your target class or function when asking, so the agent can follow the RED-GREEN-REFACTOR steps against real code.
- Make sure the Gradle build already compiles and Kotest/MockK are dependencies before asking for tests, otherwise the agent will spend time on setup.
- Review generated tests yourself; the skill sets an 80%+ coverage target that may not suit every project.
What's inside
- SKILL.md
Redistributed unmodified from affaan-m/ECC under the MIT licence. The assessment was drafted with AI from the skill's files on 2026-10-29. Skills can instruct your agent to run code — read SKILL.md and any scripts before installing.