Skip to main content

Test Toolkit

WSO2 Agent Builder provides a full testing toolkit built into the editor. You do not need any external testing tool. Interactive verification, agent evaluation, automated test authoring, and coverage reporting are all available without leaving your development environment.

Testing approaches​

ApproachWhat it doesWhen to use
Try-It toolSends live requests to a running integration and shows the response instantly. No test code required. Supports chat agents, HTTP services, and MCP servers.While building. Verify behavior after every change before writing formal tests.
Agent evaluationsCapture agent session traces into evalsets, then score agent responses against expected behavior with LLM-as-judge and regression checks.When testing AI agents. Validate response quality and tool use, and catch regressions over time.
Test ExplorerRuns automated test cases written with the Ballerina test framework. Provides a visual view of pass/fail results, lets you re-run failures, and generates HTML and coverage reports.When a feature is stable. Write repeatable tests that run in CI and catch regressions.
Generate integration testsWSO2 Agent Builder Copilot writes Ballerina tests for your integration, such as tests for an agent's tools, and runs them with the built-in test runner.When you want test coverage fast. Generate a first draft, then review and extend.

Choosing the right approach​

Start with the Try-It tool during active development to verify behavior after every change. For AI agents, use Agent evaluations to score response quality and catch regressions as you iterate. Use Test Explorer to run Ballerina unit tests, check coverage, and integrate with your CI pipeline. To bootstrap a suite quickly, let WSO2 Agent Builder Copilot generate integration tests and run them with the built-in test runner, then review and extend.

The approaches complement each other. Most projects use several of them at different points in the development lifecycle.

What automated tests cover​

The Ballerina test framework supports the full range of test patterns you need for integration code:

  • Unit tests: Write test functions with assertions to verify logic in isolation.
  • Test lifecycle: Run setup and teardown logic at the suite, group, or per-test level.
  • Data-driven tests: Run one test function across many input combinations using data providers.
  • Test groups: Tag tests with labels and run or skip subsets from the command line.
  • Mocking: Replace HTTP clients, external services, and module functions with lightweight stubs.
  • Service and client tests: Start a real service in the test process and send requests against it.
  • Code coverage and reports: Measure line coverage, enforce thresholds, and export JaCoCo XML for CI dashboards.

What's next​

Was this page helpful?