Test Data and Fixture
テストデータとフィクスチャ
テストデータとフィクスチャは既知の入力とセットアップ手順です。それにより各テストでシステムが同じ状態になります。
もう一つの例
請求書フィクスチャは、1人の顧客、2つのアイテム、固定時計、1つの税ルールを作成します。自身のレコードのみを削除します。
主な部分
- 01Code or behavior under test
- 02Observable evidence
- 03Coverage, failure, and recovery
以下の場合に使用します
重要な状態が明確で再現可能であるように、小さなビルダーや分離されたフィクスチャを使用してください。
以下の場合は使用しないでください
巨大な共有備品、コピーされた個人データ、シードなしのランダム値、無関係な記録を削除するクリーンアップは避けてください。
コードで使用する名前
factory + deterministic clock + isolated cleanup 出荷前に
Check the environment and prepared test data (fixture). Define a result you can observe, failure and edge cases, isolation, stable inputs, useful error details, and cleanup. Set a time budget, owner, and flaky-test rule.
Outcome:Complete the task with テストデータとフィクスチャ (Test Data and Fixture)。 User context:請求書フィクスチャは、1人の顧客、2つのアイテム、固定時計、1つの税ルールを作成します。自身のレコードのみを削除します。 Validation approach:テストデータとフィクスチャ (Test Data and Fixture)。 Why it fits:重要な状態が明確で再現可能であるように、小さなビルダーや分離されたフィクスチャを使用してください。 Do not use it when:巨大な共有備品、コピーされた個人データ、シードなしのランダム値、無関係な記録を削除するクリーンアップは避けてください。 Test requirements: Name the system and test environment. Define prepared test data, other inputs, and the result you can observe. Include failure and edge cases, allowed error, isolation, and cleanup. Test operations: Make failures easy to diagnose. Control random or changing inputs. Name an owner. Keep the test fast and simple enough for its release gate. Acceptance criteria: The test fails for the known bug and passes after the fix. It repeats in the target environment, gives useful evidence, and does not expose or change unrelated data. Evidence and limits (evidence boundary):単一の公式標準が全体の用語を管理するわけではありません。その意味はチーム、プラットフォーム、またはフレームワークによって変わる可能性があります。 Unknowns to confirm: Release gate, environment, prepared test data, allowed error, time budget, owner, and flaky-test rule.
このリクエストを確認する
Review how テストデータとフィクスチャ (Test Data and Fixture) is used now. Definition: テストデータとフィクスチャは既知の入力とセットアップ手順です。それにより各テストでシステムが同じ状態になります。 Release checks: Check the environment and prepared test data (fixture). Define a result you can observe, failure and edge cases, isolation, stable inputs, useful error details, and cleanup. Set a time budget, owner, and flaky-test rule. Before changing code, list the evidence, gaps, severity, and the smallest safe fix.