Skip to main content
Use existing datasets to create functional tests for your AI model. This approach is ideal when you have curated Q&A pairs, golden datasets, or historical test cases.

Overview

Dataset-based functional testing allows you to:
  • Use curated test cases: Leverage carefully crafted Q&A pairs
  • Ensure reproducibility: Same tests across runs
  • Import existing datasets: Use your organization’s test data
  • Track regressions: Compare results over time

Supported Formats


Dataset Structure

Basic Structure

Each test case consists of:
  • question: The input to send to the model
  • context: Expected response or evaluation criteria

With Evaluation Criteria


Code Example

Loading from YAML

Loading from JSON

Loading from Parquet


Creating Datasets Programmatically


Combining Multiple Datasets


Evaluation Options

Exact Match

Semantic Similarity

BLEU Score


Best Practices

  1. Diverse test cases: Include various question types and topics
  2. Clear expectations: Write unambiguous expected responses
  3. Edge cases: Include boundary conditions and unusual inputs
  4. Regular updates: Add new test cases as you discover issues
  5. Version control: Track dataset changes alongside code