Skip to main content

AI Test Generation

Writing test cases from scratch is time-consuming. ProvaLab.io AI can generate comprehensive test cases for you in seconds -- from requirements documents, user stories, or even a short description of what you want to test. You review and refine the results, then add them straight to your project.

Two Ways to Generate Test Cases

Method 1: Generate from Requirements

If you have a user story, acceptance criteria, or requirements text, ProvaLab.io AI can turn it into a full set of test cases.

  1. Navigate to AI Assistant in the sidebar (or press Ctrl+K / Cmd+K).

  2. Select Generate Test Cases from the quick actions menu.

  3. Paste or type your requirement. For example:

    "As a user, I want to reset my password via email so that I can regain access if I forget my password."

  4. Choose a target module (e.g., Authentication) and set the priority (e.g., High).

  5. Click Generate.

  6. ProvaLab.io AI analyzes the requirement and creates a set of test cases covering the feature.

Method 2: Generate from a Description

You do not need a formal requirement. Just describe what you want to test in your own words.

  1. Open the AI Assistant chat panel.

  2. Type something like:

    "Generate test cases for the shopping cart checkout flow, including adding items, updating quantities, applying coupons, and completing payment."

  3. The AI generates a full set of test cases based on your description.

  4. Review the results in the chat panel.

tip

The more detail you provide in your description, the better the generated test cases will be. Mention specific features, edge cases, and user roles if relevant.

Method 3: Generate from a Document

If your requirements live in a document, you can upload it directly.

  1. Go to AI Assistant and select Generate from Document.
  2. Upload your file (PDF, DOCX, or TXT).
  3. Select the document type:
    • Requirements Document
    • User Story
    • API Specification
  4. Click Analyze & Generate.
  5. The AI extracts requirements from the document and generates corresponding test cases.
  6. Review the results and save the ones you want.

Reviewing AI-Generated Test Cases

After generation, each test case is presented with:

  • Title -- A clear, descriptive name (e.g., "Verify user can reset password with valid email")
  • Steps -- Numbered actions with expected results for each step
  • Priority -- Suggested priority level (Critical, High, Medium, Low)
  • Type -- Suggested test type (Functional, Regression, Smoke, etc.)
  • Preconditions -- Any setup required before the test can run
  • Tags -- Suggested tags for easy filtering

You can:

  • Accept as-is -- Click "Add to Project" to save the test case without changes.
  • Edit before saving -- Click "Edit" to modify the title, steps, priority, or any other field before adding it.
  • Discard -- Click "Remove" to skip a test case you do not need.
  • Accept all -- Use the "Add All to Project" button to save the entire batch at once.

Types of Test Cases AI Can Generate

When you generate test cases, ProvaLab.io AI produces a well-rounded mix of test types:

Positive Tests (Happy Path)

Tests that verify the feature works correctly under normal conditions.

Example: "Verify that a user with a valid email receives a password reset link within 2 minutes."

Negative Tests

Tests that verify the system handles invalid input and error conditions gracefully.

Example: "Verify that entering an unregistered email address displays an appropriate error message."

Edge Cases

Tests for boundary conditions and uncommon scenarios.

Example: "Verify that a password reset link expires after 24 hours and cannot be reused."

Security Tests

Tests that check for common security vulnerabilities related to the feature.

Example: "Verify that the password reset token cannot be brute-forced by rate-limiting requests."

tip

You can guide the AI to focus on specific test types. For example: "Generate only negative and edge case tests for the file upload feature." This is especially useful when you already have good happy-path coverage and want to strengthen other areas.

Example: Full Generation Workflow

Here is a complete example of generating test cases from a requirement:

Your Requirement:

"As a user, I want to log in with my Google account so that I don't have to remember another password."

AI-Generated Test Cases:

#TitleTypePriority
1Verify user can log in with a valid Google accountPositiveHigh
2Verify "Sign in with Google" button is visible on the login pageUIMedium
3Verify user is redirected to Google OAuth consent screenFunctionalHigh
4Verify user account is created on first Google loginPositiveHigh
5Verify existing user can link Google account to their profilePositiveMedium
6Verify login fails gracefully when Google OAuth is unavailableNegativeHigh
7Verify user can cancel Google login and return to the login pageNegativeMedium
8Verify Google login works across Chrome, Firefox, and SafariCompatibilityMedium
9Verify Google login token cannot be intercepted or replayedSecurityHigh
10Verify session is created with correct permissions after Google loginSecurityHigh

Each test case includes full step-by-step instructions and expected results that you can view by expanding the row.

Best Practices

  1. Start with a clear requirement. A well-written user story produces better test cases than a vague description.
  2. Review every generated test case. AI is a starting point, not a final answer. Adjust steps and expected results to match your application's actual behavior.
  3. Generate in batches by feature. Rather than generating test cases for an entire project at once, work feature by feature for better results.
  4. Combine with manual test cases. AI-generated tests complement your manually written ones. Use AI for breadth, then add your domain expertise for depth.
  5. Regenerate when requirements change. If a feature's requirements evolve, generate a fresh set of test cases and compare them with your existing ones to find gaps.