liveBook · Manning

AI agent

As explained in Software Testing with Generative AI

An AI agent is a software system that uses artificial intelligence to pursue goals by interpreting information and taking actions.

An AI agent is a software system that receives a goal, gathers or interprets information, takes actions through external systems, and adapts its behavior to pursue the goal. In testing, it extends LLM assistance into focused tasks such as reading and creating test data. section 9.0 section 9.1.1

A useful agent is characterized by four behaviors:

  • Goal-driven: accepts a specific or abstract objective that provides a basis for evaluating progress. section 9.1.1
  • Perceptive: extracts information or interacts with external systems through APIs, automation, or other tools. section 9.1.1
  • Autonomous: chooses which tasks to perform and in what order instead of following only a fixed algorithmic path. section 9.1.1
  • Adaptive: reacts to retrieved information or failure rather than blindly repeating an unsuccessful action. section 9.1.1

LLM-based agents commonly use function calling: prompts and callable code are grouped into tools, allowing the model to select methods, pass extracted parameters, and reuse returned data. LangChain4J can connect LLM platforms with such tools through @Tool and @P annotations. section 9.4 section 9.2

Test data assistant

Give an agent instructions to read and create test data. The agent can invoke tools, feed returned data into later calls, and produce a response for the testing task. This demonstrates a focused extension of prompt engineering rather than a general-purpose autonomous tester. section 9.2 section 9.3

Figure 9.2 An AI agent connected to multiple data sources

A multi-source agent can select relevant documentation, project information, monitoring data, or analytics data before improving an LLM response. section 9.3.1

Agents remain difficult to trust because LLM decisions are opaque and indeterministic: tools may run unexpectedly, outputs may vary, and failures can be hard to diagnose. Guard rails, validation, extensive testing, and human judgment remain necessary. section 9.3.2 section 9.4

How Software Testing with Generative AI covers it

How deep it goes
Defines four behavioral traits and demonstrates function-calling construction, while deferring advanced agent design.
Examples
Uses a test data assistant, multi-source analysis assistant, automation assistant, and exploratory testing assistant.
What it assumes
Assumes familiarity with LLMs and prompt techniques, while defining agent behavior before introducing implementation.
What you can do after
Build it from scratch as a focused LLM assistant that invokes tools, exchanges data, and supports a defined testing task.
How it connects
Connects AI agents with large language models, function calling, prompt engineering, tools, test automation, and exploratory testing.

Also explained in

Compare how 33 books explain AI agent →

Related concepts

This explainer was generated by Manning's knowledge graph from the text of Software Testing with Generative AI. The section links point to the parts of the book it draws on.