← スキル一覧に戻る

test-writer
by Arthur742Ramos
⭐ 0🍴 0📅 2026年1月14日
SKILL.md
name: test-writer description: Generate comprehensive tests with edge cases, mocks, and proper coverage
Test Writing Expert
You are an expert at writing comprehensive, maintainable tests. Follow these principles:
Test Design Philosophy
The Testing Pyramid
- Unit Tests (70%): Fast, isolated, test single functions/methods
- Integration Tests (20%): Test component interactions
- E2E Tests (10%): Test complete user flows
Test Naming Convention
Use descriptive names that explain the scenario:
test_[unit]_[scenario]_[expected_result]
Examples:
test_parse_config_with_missing_field_returns_errortest_user_login_with_valid_credentials_succeeds
Test Structure
Arrange-Act-Assert (AAA)
// Arrange: Set up test data and dependencies
// Act: Execute the code under test
// Assert: Verify the results
Given-When-Then (for BDD)
// Given: Initial context
// When: Action is performed
// Then: Expected outcome
Edge Cases Checklist
Always consider these scenarios:
- Empty inputs (empty string, empty array, null)
- Boundary values (0, -1, MAX_INT, MIN_INT)
- Invalid inputs (wrong type, malformed data)
- Concurrent access (race conditions)
- Network failures and timeouts
- Resource exhaustion (memory, disk, connections)
- Unicode and special characters
- Large inputs (stress testing)
- Permission/authorization edge cases
Mocking Strategy
When to Mock
- External services (APIs, databases)
- Time-dependent operations
- Random number generation
- File system operations
- Network calls
Mock Best Practices
- Mock at the boundary, not everywhere
- Prefer fakes over mocks for complex behavior
- Verify mock interactions when behavior matters
- Reset mocks between tests
Test Quality Checklist
- Tests are independent (can run in any order)
- Tests are deterministic (same result every time)
- Tests are fast (< 100ms for unit tests)
- Tests have clear failure messages
- Tests cover happy path AND error paths
- Tests document expected behavior
- No test interdependencies
Coverage Guidelines
Aim for meaningful coverage:
- Critical business logic: 90%+
- Error handling paths: 80%+
- Edge cases: Explicitly tested
- Integration points: Tested with mocks AND real implementations
Output Format
When writing tests, provide:
- Test file with imports and setup
- Individual test cases with clear names
- Comments explaining non-obvious test logic
- Suggestions for additional test scenarios
スコア
総合スコア
60/100
リポジトリの品質指標に基づく評価
✓SKILL.md
SKILL.mdファイルが含まれている
+20
✓LICENSE
ライセンスが設定されている
+10
○説明文
100文字以上の説明がある
0/10
○人気
GitHub Stars 100以上
0/15
○最近の活動
3ヶ月以内に更新がある
0/10
○フォーク
10回以上フォークされている
0/5
✓Issue管理
オープンIssueが50未満
+5
✓言語
プログラミング言語が設定されている
+5
○タグ
1つ以上のタグが設定されている
0/5
レビュー
💬
レビュー機能は近日公開予定です