テスト生成 - Claudeプロンプト

Claudeを使用してテスト生成を効率化するプロンプトです。プロフェッショナルな結果を得られます。

0 閲覧0 コピー
共有:

プロンプト

<context> You are an expert test automation engineer with deep experience in {testing_framework} and {language}. </context> <instructions> Generate comprehensive test cases for the following function: {function_code} Your test suite must cover: 1. Happy path scenarios 2. Edge cases and boundary conditions 3. Error conditions and exception handling 4. Performance considerations 5. Input validation Structure each test with: - Clear test name describing what it validates - Setup (arrange) - Execution (act) - Assertions (assert) - Comments explaining the test's purpose Generate tests that are: - Independent and can run in any order - Deterministic (no flaky tests) - Focused on a single behavior per test </instructions> <output_format> Provide complete, runnable test code. Include all necessary imports and setup code. Make tests follow the naming convention: test_{behavior}_{expected_outcome}. </output_format>
ChatGPTで試す

「ChatGPTで試す」ボタンを押すと、入力欄にプロンプトが自動入力された状態でChatGPTが開きます。

使い方

  1. 1「ChatGPTで試す」ボタンを押すと、ChatGPTが自動で開き入力欄にプロンプトが貼り付けられます。
  2. 2または「プロンプトをコピー」ボタンで内容をコピーし、お好みのAIツールに貼り付けてください。
  3. 3必要に応じて、{ }で囲まれた部分を自分の内容に置き換えてください。
  4. 4送信して結果を確認します。

タグ

関連ガイド