Files
claude-howto/ja/01-slash-commands/unit-test-expand.md
JiangCheng 1d1df9235b feat(i18n): Add Japanese (ja/) translation (#105)
- Translate all 101 markdown files: P1 core, all 10 modules, examples,
  auxiliary docs (CONTRIBUTING, CODE_OF_CONDUCT, SECURITY, CLAUDE.md, etc.),
  peripheral docs (.github/, docs/, resources/, scripts/)
- Translate comments and user-facing messages in 06-hooks/*.sh examples
- Copy 05-mcp/*.json examples (standard JSON, no comments)
- Update root README.md language switcher to include 日本語
- Add ja/TRANSLATION_NOTES.md (glossary + style guide)

All translations pass pre-commit quality gates (markdown-lint,
cross-references, mermaid-syntax, link-check, build-epub).
2026-04-30 00:16:46 +02:00

33 lines
1.4 KiB
Markdown
Raw Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
<!-- i18n-source: 01-slash-commands/unit-test-expand.md -->
<!-- i18n-source-sha: 7f2e773 -->
<!-- i18n-date: 2026-04-27 -->
---
name: Expand Unit Tests
description: 未テストの分岐やエッジケースを狙ってテストカバレッジを高める
tags: testing, coverage, unit-tests
---
# ユニットテストの拡充
プロジェクトのテストフレームワークに合わせて、既存のユニットテストを拡充する:
1. **カバレッジを分析**: カバレッジレポートを実行し、未テストの分岐、エッジケース、低カバレッジ領域を特定する
2. **ギャップを特定**: コードを見直し、論理分岐、エラー経路、境界条件、null空入力を確認する
3. **プロジェクトのフレームワークでテストを書く**:
- JestVitestMochaJavaScriptTypeScript
- pytestunittestPython
- Go testingtestifyGo
- Rust のテストフレームワークRust
4. **特定のシナリオを狙う**:
- エラーハンドリングと例外
- 境界値最小最大、空、null
- エッジケース・コーナーケース
- 状態遷移と副作用
5. **改善を確認**: 再度カバレッジを計測し、計測可能な向上を確認する
新しく追加したテストコードのみを提示する。既存のテストパターンと命名規則に従う。
---
**Last Updated**: April 9, 2026