Urgent.News

What's breaking now, across thousands of outlets.

Tech

Testing Google ADK TypeScript Agents Without Chasing Sentences

The fastest way to make an AI-agent test flaky is to assert the final sentence. You expect: I'll help you find hotels in Paris. The agent returns: Sure — I can look for hotel options in Paris. The behavior is correct, but the test is red. Google's Agent Development Kit (ADK) brings agents closer to conventional software engineering: agents, tools, orchestration, sessions, events, evaluation, and…

To create reliable AI-agent tests, avoid asserting final sentences. Google's Agent Development Kit (ADK) enables agents to be built using code and runtime primitives, similar to conventional software engineering. However, this does not make the model deterministic. Testing should focus on the agent's decisions and boundaries rather than its personality.

A testing pyramid for agents consists of four layers: small human-reviewed evaluations, end-to-end trajectory scenarios, runtime contracts (policy, state, schema), and deterministic unit tests for tools and adapters. Most tests should be deterministic unit tests for tools and adapters, which are fast, cheap, and deterministic. Live-model evaluations should be used sparingly, not for every assertion.

1. Test tools separately from the model. ADK TypeScript tools can be expressed using FunctionTool with a Zod parameter schema. The underlying business function should be tested as ordinary TypeScript code.

2. Assert the trajectory, not the prose. During integration tests, run the ADK agent, collect its events, and convert framework events into a small application-owned summary to avoid coupling tests to internal event details.

Written by urgent.news from Dev.to's reporting — not their text. Machine-written — may contain errors; check the original before relying on it.

Read the original at dev.to →

More in Tech

More from Monday 31 August →