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
- Diverse test cases: Include various question types and topics
- Clear expectations: Write unambiguous expected responses
- Edge cases: Include boundary conditions and unusual inputs
- Regular updates: Add new test cases as you discover issues
- Version control: Track dataset changes alongside code
Related Topics
- From RAG - Generate tests from knowledge bases
- From Prompt - Generate tests dynamically
- Heuristic Evaluators