write-test

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

Updated Dec 11, 2025
One-click install
npx skills add https://github.com/GrowWeek/GrowWeek-Backend --skill write-test-growweek
Or copy as Structured Prompt for Agent
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.