DEV Community

Cover image for AI Features Need a Different Kind of Test Suite
Simon Gerber
Simon Gerber

Posted on

AI Features Need a Different Kind of Test Suite

A lot of teams are adding AI to existing products the way SaaS companies added chat widgets ten years ago.

There’s the normal application.

Then there’s the AI box.

You type something into it.

Magic happens.

Ship it.

The problem is that the AI box rarely stays isolated.

Soon it can fill forms.

Suggest values.

Change application state.

Create records.

Recommend actions.

Trigger workflows.

Hand something off to a human.

Now you don’t merely have an LLM feature.

You have an unpredictable participant inside your application.

And that changes what “testing the UI” means.

The dangerous failure is often a believable UI

Traditional UI testing is good at binary failures.

The button is missing.

The API returned 500.

The page didn’t load.

AI introduces something nastier:

the interface works perfectly while showing the wrong thing.

Imagine an AI assistant generating an insurance quote.

The page renders.

Every element is present.

The interaction succeeds.

But the model inferred the wrong coverage level and the frontend confidently displays it.

From the perspective of a classic browser test, everything worked.

From the perspective of the business, you may have a serious problem.

This is why I find the emerging category of tools for detecting hallucinated UI states in LLM-powered applications interesting.

AI testing has to care about the semantic relationship between what the model produced and what the application ultimately did.

Form assistants are a good example

AI-powered forms look deceptively easy to test.

Enter a prompt.

Watch fields populate.

Assert that the fields contain values.

But what happens if:

  • the model fills a disabled field?
  • it overwrites data the user manually entered?
  • server-side validation rejects its suggestion?
  • the AI changes a dependent dropdown but not the value below it?
  • the user corrects one field and the assistant “helpfully” changes it back?
  • the submission fails and the AI retries incorrectly?

Now you have three sources of truth:

  1. the user,
  2. the model,
  3. the application.

That’s why testing form assistants requires considerably more than testing whether generated text appeared.

There’s a practical breakdown in how to test AI form assistants before they corrupt validation, autofill, or submission state.

And if you’re evaluating an automation platform specifically for these workflows, this guide to testing AI-generated form assistants and recovery paths with Endtest looks at the tooling side.

The interesting test cases live at the boundary between AI output and deterministic application rules.

That boundary deserves disproportionate attention.

Streaming responses break traditional waits

Chat interfaces introduce another common failure mode.

A normal browser test might wait for:

div.response
Enter fullscreen mode Exit fullscreen mode

That works beautifully until responses stream token by token.

The element exists almost immediately.

The answer does not.

So the test reads half a sentence and proceeds.

You can increase the timeout, but now a fast response waits unnecessarily.

You can wait for network silence, except modern apps often have analytics, telemetry, or background requests that mean “network silence” never really happens.

You need an application-level definition of completion.

Maybe the Stop button disappears.

Maybe a status changes.

Maybe a streaming flag becomes false.

Whatever it is, it should correspond to something the user would recognize as “the answer is finished.”

There’s a good treatment of this problem in testing streaming AI responses without flaky timing assertions.

Again, the theme is the same:

waiting longer is not the same as waiting intelligently.

Handoffs are where AI becomes a workflow

The most interesting AI applications aren’t fully autonomous.

They hand control back and forth between humans and software.

AI prepares something.

A human approves it.

AI continues.

Someone escalates.

The workflow gets reassigned.

An audit event is recorded.

That creates a much richer test surface than a chat response.

You have to validate both the model behavior and the surrounding product workflow.

This review of testing AI agent handoff flows, approvals, and escalation UI with Endtest is a useful example of the kinds of scenarios worth exercising.

The key word there is workflow.

AI products still need boring deterministic software around the AI.

Permissions need to work.

Buttons need to work.

Approvals need to work.

Audit logs need to work.

The model doesn't get to excuse those failures.

“97% accurate” tells you almost nothing

AI vendors love accuracy numbers.

97.2%.

98.7%.

99%.

The problem is that a single percentage can hide almost everything that matters.

Accurate at what?

On whose dataset?

Under which prompt?

Which languages?

What happens on ambiguous inputs?

Was the evaluation performed once six months ago?

Are failures clustered around one particularly important use case?

Before treating an AI testing tool's accuracy score as a meaningful comparison, read something like what to check before trusting reported AI testing accuracy scores.

Averages are especially dangerous when the cost of individual errors is asymmetric.

Being wrong about the color of a generated icon is not equivalent to being wrong about whether a financial transaction succeeded.

AI testing needs observability

When a deterministic test fails, you usually ask:

What happened?

With AI systems, you also need:

Why did the system reach that result?

That may require:

  • prompt versions,
  • model versions,
  • retrieved context,
  • tool calls,
  • token streams,
  • traces,
  • screenshots,
  • browser state,
  • retries.

That’s why AI test observability is becoming its own category.

There’s a useful overview of evaluating AI test observability platforms for prompt replays, traces, and failure triage.

Without this context, reproducing an AI failure becomes forensic archaeology.

And eventually somebody asks about the data

Once you're saving prompts and replaying conversations, another question arrives:

What exactly are we storing?

AI test data can contain:

  • customer information,
  • internal documents,
  • production prompts,
  • retrieved content,
  • personal data,
  • secrets inadvertently entered by users.

At that point, synthetic data and masking stop being enterprise checkboxes and start becoming part of your testing architecture.

This market map of AI test data governance tools provides a good overview of that side of the ecosystem.

AI doesn’t eliminate deterministic testing

There’s a weird idea floating around that AI will eventually make normal test automation obsolete.

I suspect the opposite happens.

As applications become less deterministic, teams will want more deterministic evidence around them.

Did the correct field change?

Was the approval actually persisted?

Was the right user notified?

Did the application prevent an invalid submission?

Can we reproduce what happened?

AI can generate wildly different language while the product still has very specific rules.

Those rules are where your test suite earns its keep.

Top comments (0)