LLM evaluation

Test with empty and whitespace input

Easy30 pts~12 min
  • Input validation
  • Edge cases
Practice app · Acme Support Assistant

A deterministic LLM-style support assistant with retrieval (RAG), JSON mode, safety policies and tool calls, exposed via UI and API.

BASE_URL
/api/practice
Console app
/lab/ai-testing-test-with-empty-and-whitespace-input

Your starter code already declares BASE_URL — call the API relative to it.

Objective

Verify the API rejects empty and whitespace-only prompts with a clear 400 error.

Your task

  1. 1POST BASE_URL + "/ai/chat" with messages [{ "role": "user", "content": "" }] → assert 400 and error.code "EMPTY_PROMPT".
  2. 2Repeat with content " \n\t " → assert 400 EMPTY_PROMPT.
  3. 3Send a normal question and assert 200 so the test proves the boundary.

Acceptance criteria

  • POST /ai/chat returns 400 for empty input
  • POST /ai/chat returns 200 for a real prompt
  • At least 3 assertions pass

LLM evaluation · AI Testing · Prompt & input testing