write-test

Standardize Kotlin test code creation using Kotest, Mockk, and Spring Boot Test.

Updated Dec 11, 2025
Ready to run
npx skills add https://github.com/GrowWeek/GrowWeek-Backend --skill write-test-growweek
๐Ÿ’ฌ Prompt for ChatGPT / Claude Chatโ–ผ
Please help me install this Agent Skill.
Skill: write-test
Source: https://github.com/GrowWeek/GrowWeek-Backend/tree/main/.claude/skills/test
Command: npx skills add https://github.com/GrowWeek/GrowWeek-Backend --skill write-test-growweek

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

ํ…Œ์ŠคํŠธ ์ฝ”๋“œ ์ž‘์„ฑ ์ •์ฑ…์€ GrowWeek ํ”„๋กœ์ ํŠธ์˜ ํ…Œ์ŠคํŠธ ์ฝ”๋“œ ํ’ˆ์งˆ๊ณผ ์ผ๊ด€์„ฑ์„ ๋ณด์žฅํ•˜๊ธฐ ์œ„ํ•œ ํ‘œ์ค€์„ ์ œ๊ณตํ•ฉ๋‹ˆ๋‹ค. ์ด ์ •์ฑ…์€ ํŒ€์ด ๊ฐ€๋…์„ฑ ๋†’์€ ํ…Œ์ŠคํŠธ๋ฅผ ์ž‘์„ฑํ•˜๊ณ , ๊ณ„์ธต ๊ฐ„ ๊ฒฝ๊ณ„์™€ ํ…Œ์ŠคํŠธ ํ”ผ๋ผ๋ฏธ๋“œ๋ฅผ ์ง€ํ‚ค๋ฉฐ, ์žฌํ˜„ ๊ฐ€๋Šฅํ•œ ํ…Œ์ŠคํŠธ๋ฅผ ์„ค๊ณ„ํ•˜๋„๋ก ๋•์Šต๋‹ˆ๋‹ค.

Core Features & Use Cases

  • Kotest๋ฅผ ์ค‘์‹ฌ์œผ๋กœ ํ•œ Kotlin์šฉ ํ…Œ์ŠคํŠธ ํ”„๋ ˆ์ž„์›Œํฌ ์‚ฌ์šฉ ์ง€์นจ
  • Mockk๋ฅผ ํ™œ์šฉํ•œ ๋ชจํ‚น ์ „๋žต๊ณผ ์™ธ๋ถ€ ์˜์กด์„ฑ ๊ฒฉ๋ฆฌ
  • BehaviorSpec ์Šคํƒ€์ผ์˜ Given/When/Then ๊ตฌ๋ฌธ์„ ํ†ตํ•œ ์˜๋„ ๋ช…์‹œ
  • ๋„๋ฉ”์ธ ๊ณ„์ธต(Unit)๋ถ€ํ„ฐ ์• ํ”Œ๋ฆฌ์ผ€์ด์…˜ ๊ณ„์ธต(UseCase), ์ธํ”„๋ผ ๊ณ„์ธต(๋ฆฌํฌ์ง€ํ† ๋ฆฌ/์™ธ๋ถ€ API)๊นŒ์ง€์˜ ํ…Œ์ŠคํŠธ ์„ค๊ณ„ ์›์น™
  • ๊ฐ€๋…์„ฑ, ๊ฒฉ๋ฆฌ, ๋„ค์ด๋ฐ ๊ทœ์น™ ๋“ฑ ๊ธฐ๋ณธ ์›์น™๊ณผ ๋ ˆ์ด์–ด๋ณ„ ํ…Œ์ŠคํŠธ ์ „๋žต

Quick Start

ํ…Œ์ŠคํŠธ์˜ ์˜ˆ์‹œ๋ฅผ ๋”ฐ๋ผ BehaviorSpec ๊ธฐ๋ฐ˜์˜ ํ…Œ์ŠคํŠธ ํด๋ž˜์Šค๋ฅผ ์ƒ์„ฑํ•˜๊ณ , ๋Œ€์ƒ ๋„๋ฉ”์ธ์— ๋Œ€ํ•œ ๋ช…๋ช… ๊ทœ์น™๊ณผ ๊ณ„์ธต๋ณ„ ๊ฐ€์ด๋“œ๋ฅผ ๋”ฐ๋ผ ์ž‘์„ฑํ•ฉ๋‹ˆ๋‹ค.

Frequently Asked Questions about write-test

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

FAQPage Schema
How do I write Kotlin unit tests using BehaviorSpec and Kotest?โ–ผ

To write Kotlin unit tests with BehaviorSpec and Kotest, structure test classes using Given/When/Then syntax to explicitly state test intent. This approach standardizes test creation across Core, Domain, and Infrastructure layers, ensuring high readability and consistent behavior specification.

What is the best way to mock external dependencies in Kotlin integration tests?โ–ผ

The best way to mock external dependencies in Kotlin integration tests is using Mockk. It provides strategies to isolate external dependencies effectively, allowing you to design reproducible tests across application and infrastructure layers without actual external API calls.

Can I use Spring Boot Test with Kotest for service layer testing?โ–ผ

Yes, you can use Spring Boot Test with Kotest for service layer testing. The framework defines specific testing layers and design principles spanning from domain units to application use cases and infrastructure repositories, ensuring proper boundary isolation.

How does BehaviorSpec Given When Then syntax improve test readability?โ–ผ

BehaviorSpec Given When Then syntax improves test readability by enforcing a strict structure that explicitly declares test intent. This mandatory format ensures team consistency, making complex integration and unit test scenarios easier to understand and maintain.

Do I need specific naming conventions for Kotlin test code layers?โ–ผ

Yes, you need specific naming conventions for Kotlin test code layers. The standard enforces layer-specific naming rules and design principles from domain units to infrastructure repositories, ensuring consistent test pyramid boundaries and maintainable test suites.

What are the CI-friendly guidelines for Kotlin test creation?โ–ผ

CI-friendly guidelines for Kotlin test creation focus on designing reproducible tests that maintain isolation and readability. These guidelines ensure tests run consistently in continuous integration environments by enforcing strict boundaries and reliable mocking strategies.