use-case-testing
Derive test scenarios from use case specifications to validate end-to-end user workflows including main success, alternate, and exception paths. Use for…
by sethdford★ 51 GitHub stars
Install use-case-testing in Claude Code & Claude Desktop
Sign up to install this skill
Create a free account to reveal the install command and save the skill to your library.
- Reveal the one-line install command
- Save skills to your synced library
- Get notified when skills update
About this skill
Use Case Testing
Derive comprehensive test scenarios from use case specifications, ensuring every main success path, alternate flow, and exception path is exercised end-to-end as a real user would experience it.
Context
You are a senior QA engineer designing use case tests for $ARGUMENTS. This technique bridges requirements and testing, validating that the system fulfills its intended purpose from the user's perspective.
Domain Context
- ISTQB Foundation Syllabus (4.2.5): Use case testing is a black-box technique that derives tests from use case descriptions, covering main and alternative scenarios
- Alistair Cockburn's Writing Effective Use Cases: Defines the standard use case template — actor, preconditions, main success scenario, extensions (alternate/exception paths), postconditions, and guarantees
- ISO/IEC 25010: Functional appropriateness measures whether functions facilitate task completion — use case testing directly validates this
- Requirements traceability (IEEE 830): Each test case should trace back to a specific use case step, providing bidirectional coverage evidence
Instructions
- Enumerate use cases: List all use cases for the feature under test. For each, identify the primary actor, preconditions, trigger, and postconditions. If formal use cases don't exist, derive them from user stories, PRDs, or stakeholder interviews
- Map the main success scenario: Walk through the happy path step by step. Each step becomes a test step with a specific assertion. The postcondition is the final assertion
- Extract alternate paths: For each step in the main scenario, identify alternate paths — valid variations that still succeed (e.g., paying with credit card vs. PayPal). Each alternate path needs its own test scenario
- Extract exception paths: For each step, identify what can go wrong — invalid input, timeout, permission denied, resource unavailable, concurrent modification. Each exception needs a test verifying:
- The system displays an appropriate error
- No data corruption occurs
- The user can recover (return to a valid state)
- Compose end-to-end scenarios: Combine paths into realistic user journeys that cross multiple use cases (e.g., register → browse → add to cart → checkout → receive confirmation). These integration-level tests catch handoff defects between features
- Build a use case / test matrix: Create a traceability matrix mapping each use case path (main + alternates + exceptions) to test cases. Identify any paths without test coverage.
Anti-Patterns
- Happy-path-only testing — LLMs generate thorough main success scenarios but produce superficial alternate and exception paths (often just "invalid input returns error"). Guard: Count paths — a well-specified use case typically has 3-8 extension paths per main scenario step. If your test suite has fewer exception tests than happy-path tests, coverage is insufficient.
- Synthetic user behavior — LLMs invent use case flows that look logical but don't match real user behavior (e.g., testing account deletion before testing account creation). Guard: Validate use case priority against analytics data or user research. Test the flows users actually follow, not just the flows that are logically possible.
- Missing actor variations — LLMs default to a single actor type and miss that the same use case behaves differently for admin vs. regular user vs. guest vs. API consumer. Guard: Enumerate all actor types and test each relevant use case with each actor role.
Further Reading
- Alistair Cockburn, Writing Effective Use Cases — Definitive guide to use case structure and levels
- ISTQB Foundation Level Syllabus, Section 4.2.5 — Use case testing as a specification-based technique
- Glenford Myers, The Art of Software Testing — Systematic test derivation from specifications
- Karl Wiegers, Software Requirements, 3rd Edition — Requirements specification and traceability to testing
Allowed tools
Tools this skill is permitted to call.
No restriction — this skill can use any tool.
FAQ
What does the use-case-testing skill do?
Derive test scenarios from use case specifications to validate end-to-end user workflows including main success, alternate, and exception paths. Use for acceptance testing and requirements validation.
How do I install the use-case-testing skill?
Copy the skill folder into ~/.claude/skills (the Claude Code tab above does this in one command), or install it as a plugin.
Does the use-case-testing skill run scripts?
No, this skill is instructions only (SKILL.md) with no executable scripts.
Related skills
mcp-builder
AnthropicGuide for creating high-quality MCP (Model Context Protocol) servers that enable LLMs to interact with external services through well-designed tools. Use when…
claude-api
AnthropicReference for the Claude API / Anthropic SDK — model ids, pricing, params, streaming, tool use, MCP, agents, caching, token counting, model migration. TRIGGER…
algorithmic-art
AnthropicCreating algorithmic art using p5.js with seeded randomness and interactive parameter exploration. Use this when users request creating art using code…
mcp-integration
AnthropicThis skill should be used when the user asks to "add MCP server", "integrate MCP", "configure MCP in plugin", "use .mcp.json", "set up Model Context…