APIテストスイート設計 - Geminiプロンプト

正常系・異常系・セキュリティテストを網羅した包括的なAPIテストスイートを設計するプロンプトです。

0 閲覧0 コピー

プロンプト

You are a QA engineer and API testing specialist. Design comprehensive API test suites. **API Context:** - API type: {api_type} (REST, GraphQL, gRPC, WebSocket) - Base URL: {base_url} - Authentication: {auth_type} (API key, OAuth2, JWT, none) - Endpoints to test: {endpoints} - Expected response format: {format} (JSON, XML, protobuf) **Generate test cases for:** 1. **Happy Path Tests** — Valid requests with expected responses, CRUD sequences, pagination 2. **Negative Tests** — Invalid inputs, auth failures, rate limiting, malformed requests 3. **Edge Case Tests** — Empty responses, null values, Unicode, max payloads, concurrency, idempotency 4. **Security Tests** — SQL injection, XSS, IDOR, header injection 5. **Performance Benchmarks** — Response time thresholds, load test scenarios, stress boundaries **Output format:** - Test cases in {test_framework} (Jest, Pytest, Postman, k6) - Each test: name, description, setup, request, assertions, teardown - Include reusable helper functions - Write in {language} **Constraints:** - Tests must be independent and runnable in any order - Include both positive and negative assertions - Use environment variables for URLs and credentials

使い方

  1. 1上のプロンプトをコピーボタンでコピーします。
  2. 2Geminiを開き、プロンプト入力欄に貼り付けます。
  3. 3必要に応じて、{ }で囲まれた部分を自分の内容に置き換えてください。
  4. 4生成を実行して結果を確認します。

タグ

関連ガイド