mcpField
A
Acceptance Criteria

Acceptance Criteria

github.com/danhvbテスト・品質93 回インストール
リポジトリ

Acceptance Criteria について

プロダクト、要件定義、QAの担当者が明確でテスト可能な受け入れ基準を作成するためのスキルです。Given-When-Then、チェックリスト、シナリオ形式と、網羅性・テスト可能性の確認方法を扱います。

主な機能

  1. 01Given-When-Then形式の基準
  2. 02チェックリストとシナリオ形式
  3. 03分野別の例
  4. 04テスト可能性と網羅性の確認
  5. 05境界条件とエラーケースの指針

活用シーン

  1. 01スプリントのユーザーストーリーの基準作成
  2. 02FRSでの要件定義
  3. 03UATテストケースの準備

インストール

コマンドをコピーしてターミナルで実行します。

$npx skills add https://github.com/danhvb/my-ba-skills --skill acceptance-criteria

インストール後、Claude Code で/acceptance-criteriaを入力して読み込まれたか確認します。

詳細

受け入れ基準スキル

目的

要件またはユーザーストーリーがいつ完了し、正しく動作していると見なされるのかを正確に定める、明確でテスト可能な受け入れ基準を定義します。

使用する場面

  • アジャイルスプリントのユーザーストーリーを作成するとき
  • FRS で要件を定義するとき
  • UAT テストケースを計画するとき
  • 機能の完了の定義を作成するとき

受け入れ基準の形式

1. Given-When-Then(Gherkin)

構造:

Given [precondition/context]
When [action/event]
Then [expected outcome]
And [additional outcome]

例 - ログイン:

Scenario: Successful login with valid credentials
Given I am on the login page
And I am a registered user with email "[email protected]"
When I enter "[email protected]" as email
And I enter "ValidPassword123" as password
And I click the "Sign In" button
Then I should be redirected to the dashboard
And I should see a welcome message "Welcome, John"
And my last login time should be updated

Scenario: Failed login with invalid password
Given I am on the login page
And I am a registered user
When I enter valid email
And I enter incorrect password
And I click the "Sign In" button
Then I should see error message "Invalid email or password"
And I should remain on the login page
And account lockout counter should increment

Scenario: Account lockout after 5 failed attempts
Given I am on the login page
And I have failed login 4 times
When I fail login a 5th time
Then my account should be locked for 30 minutes
And I should see message "Account locked. Try again in 30 minutes"
And I should receive a security alert email
2. チェックリスト形式

例 - チェックアウト:

## User Story: Guest Checkout

### Acceptance Criteria
- [ ] Guest can proceed to checkout without creating account
- [ ] Email field is required and validated
- [ ] Shipping address form includes: name, address, city, state, zip, country, phone
- [ ] All required fields show validation errors if empty on submit
- [ ] Address validation API is called and suggests corrections
- [ ] Shipping options are displayed with real-time prices
- [ ] Order summary shows all items, quantities, and prices
- [ ] Payment form accepts credit card information
- [ ] Order is created upon successful payment
- [ ] Confirmation page shows order number and details
- [ ] Confirmation email is sent within 1 minute
- [ ] Guest is offered option to create account after order
3. シナリオベース

例 - ショッピングカート:

## User Story: Add to Cart

### Happy Path
- User selects product variant (size, color)
- User clicks "Add to Cart"
- Product is added to cart with correct quantity
- Cart icon updates with item count
- Mini cart shows added product confirmation
- User can continue shopping or go to cart

### Edge Cases
- Out of stock: "Add to Cart" button disabled, shows "Out of Stock"
- Limited stock: Shows "Only 3 left" warning
- Maximum quantity: "Only 5 per customer" message
- Already in cart: Updates quantity instead of adding duplicate
- Variant not selected: Prompts to select variant first

### Error Scenarios
- Network error: Shows "Unable to add. Please try again"
- Inventory changed: Shows "Sorry, this item is no longer available"
- Session expired: Redirects to login, preserves cart on return

分野別の例

Eコマース:決済処理
Scenario: Successful credit card payment
Given I have items in my cart totaling $99.99
And I am on the payment page
When I enter valid card number "4242 4242 4242 4242"
And I enter expiration "12/27" and CVV "123"
And I click "Pay Now"
Then the payment should be processed successfully
And I should see order confirmation page
And I should receive confirmation email
And order status should be "Processing"

Scenario: Payment declined
Given I am on the payment page
When I enter a card that will be declined
And I click "Pay Now"
Then I should see "Payment declined. Please try another card"
And I should remain on payment page
And no order should be created
And no charge should be made

Scenario: 3D Secure authentication required
Given I am paying with a card requiring 3DS
When I submit payment
Then I should see 3D Secure popup
When I complete verification
Then payment should process normally
CRM:リードのコンバージョン
Scenario: Convert qualified lead to opportunity
Given I am viewing a lead with score >= 75
And lead status is "Qualified"
When I click "Convert to Opportunity"
Then I should see conversion dialog
And I should be able to create or select account
And new contact should be created
And new opportunity should be created with lead data
And original lead should be marked "Converted"
And conversion history should be logged

Scenario: Cannot convert unqualified lead
Given I am viewing a lead with score < 60
When I click "Convert to Opportunity"
Then I should see message "Lead must be qualified before conversion"
And conversion dialog should not open
ERP:発注書の承認
Scenario: PO auto-approved under $1000
Given I create a purchase order for $500
When I submit the PO
Then PO status should be "Approved"
And I should see message "Auto-approved under $1,000 threshold"
And no approval notification should be sent

Scenario: PO routes to manager for approval
Given I create a purchase order for $5,000
When I submit the PO
Then PO status should be "Pending Approval"
And my manager should receive approval notification
And I should see message "Sent to manager for approval"

Scenario: Manager approves PO
Given I am a manager
And I have a pending PO for approval
When I click "Approve"
And I enter approval comments
Then PO status should change to "Approved"
And requestor should be notified
And PO should be sent to vendor
モバイル/Web:オフライン機能
Scenario: View cached data offline
Given I have previously viewed my order history
And I am now offline
When I open the app
And I navigate to Order History
Then I should see cached orders
And I should see "Offline - Last updated: [timestamp]"
And I should not see loading spinner

Scenario: Attempt action that requires connectivity
Given I am offline
When I try to place a new order
Then I should see "You're offline. Connect to place order"
And I should have option to save cart for later
And action should not proceed

Scenario: Auto-sync when back online
Given I made changes while offline
When I regain internet connection
Then app should automatically sync changes
And I should see brief "Syncing..." indicator
And I should see "Up to date" when complete

ベストプラクティス

適切な受け入れ基準の作成

✅ 推奨事項:

  • 具体的で測定可能な内容にする
  • 正常系とエッジケースの両方を網羅する
  • エラーが発生するシナリオを含める
  • 各基準を個別にテストできるようにする
  • 一貫した表現を使用する
  • ユーザーの視点を考慮する
  • データの検証ルールを含める
  • 時間に関する要件(該当する場合)を明記する

❌ 避けるべきこと:

  • 曖昧な表現にする(「システムは高速であること」など)
  • エラー処理を省略する
  • 暗黙の知識を前提とする
  • 基準を細かくしすぎる(テストケースのレベルにする)
  • エッジケースを忘れる
  • 1つの基準に複数の機能を混在させる
テスト可能性チェックリスト
  • QA はこの内容からテストケースを作成できますか?
  • 期待される結果は明確ですか?
  • 合格/不合格を客観的に判断できますか?
  • 値が明記されていますか(「有効な入力」などではなく)?
  • 時間に関する要件が明記されていますか?
完全性チェックリスト
  • 正常系を網羅していますか?
  • エラーケースを網羅していますか?
  • エッジケースを網羅していますか?
  • 空/null の状態を網羅していますか?
  • 権限/アクセスのシナリオを網羅していますか?
  • モバイル/レスポンシブのシナリオを網羅していますか?

よくあるパターン

フォームの検証
Given field X is empty
When user submits form
Then error "X is required" is shown below field X
And field X is highlighted in red
And form is not submitted
リスト/検索
Given there are N items matching criteria
When user searches for [criteria]
Then N results are displayed
And results are sorted by [default sort]
And each result shows [fields]
CRUD 操作
Create: Input validation, success message, list updates
Read: Display correct data, handle empty state
Update: Validate changes, show success, reflect changes
Delete: Confirm prompt, success message, item removed

ツール

  • Lark/Notion:ユーザーストーリーとともに基準を記録
  • Jira:ストーリーの受け入れ基準フィールド
  • Gherkin:自動化に使う形式的な BDD 構文
  • Cucumber/SpecFlow:Gherkin を使った自動テスト

次のステップ

受け入れ基準を作成した後:

  1. プロダクトオーナーとレビューする
  2. テスト可能性について QA とレビューする
  3. 準備完了の定義に含める
  4. UAT テストケースの作成に使用する

参考資料

  • ビヘイビア駆動開発(BDD)
  • Gherkin 構文リファレンス
  • ユーザーストーリーマッピング(Jeff Patton)

コメント