Suffolk University • Sawyer Business School

Testing & Evaluating Agents

If you can't measure it, you can't trust it — build test suites, run evaluations, and prove your agent works

Session 11 of 13
150 Minutes
40 Students
Hands-On Learning
01 // LEARNING OBJECTIVES

What You'll Learn Today

By the end of this session, you'll have both conceptual understanding and hands-on experience with the foundations of AI.

01

Build a Test Suite

Create a 20-case test suite with expected outputs, edge cases, and adversarial inputs. Move from 'vibes-based' to systematic evaluation.

02

Implement LLM-as-Judge

Use Claude to evaluate Claude: build an automated judge that scores your agent's outputs on accuracy, helpfulness, and safety.

03

Test for Consistency

Run the same query 3 times and measure output variance. Understand why non-determinism matters for business deployment.

04

Answer 'Does It Work?' with Data

When a VP asks 'does your agent work?', answer with metrics, not feelings. Build dashboards that show accuracy, coverage, and failure rates.

02 // SESSION AGENDA

Today's Journey

A carefully crafted progression from concepts to hands-on building.

5:00 PM - 5:15 PM

Part 1: Vibes vs. Data

15 minutes

You've been evaluating your agent by trying a few queries and seeing if the output 'looks right.' That's not evaluation — that's vibes.

  • The vibes problem: 'It seems to work' is not a deployment-ready answer. A VP will ask for numbers.
  • What systematic evaluation looks like: test suites, automated scoring, consistency checks, failure analysis
  • The eval stack: Test cases → Automated runner → LLM-as-judge → Metrics dashboard
  • Why this matters for your final project: your deliverable includes a test suite (20% of grade)
5:15 PM - 5:40 PM

Part 2: Building Test Suites

25 minutes

How to write test cases for AI agents — it's not like testing normal software.

  • The challenge: Agent outputs aren't deterministic. Same input → different (but hopefully equivalent) outputs.
  • Test case anatomy: Input, expected behavior (not exact output), evaluation criteria, edge case flag
  • Categories: Happy path (10 cases), edge cases (5), adversarial inputs (3), domain-specific risks (2)
  • Demo: Building a 20-case test suite for the research agent from Session 6
5:40 PM - 6:25 PM

Part 3: Hands-On — Build Your Evaluation Pipeline

45 minutes

Build a complete evaluation pipeline for your agent — test suite, automated runner, and LLM-as-judge.

  • Phase 1 (15 min): Write 20 test cases for your agent — inputs, expected behaviors, and evaluation criteria
  • Phase 2 (15 min): Build an automated test runner that runs all 20 cases and an LLM-as-judge that scores each output
  • Phase 3 (15 min): Run the consistency test — same 5 queries, 3 times each. Calculate variance and identify unstable outputs.
6:25 PM - 6:35 PM

Break

10 minutes

You now have a systematic evaluation pipeline. Next: what the metrics tell you.

6:35 PM - 7:05 PM

Part 5: Interpreting Results & Improving

30 minutes

Run your evaluation, analyze results, and systematically improve your agent.

  • Run the full eval: Execute all 20 test cases + consistency tests. See your agent's real performance numbers.
  • Failure analysis: Where does your agent fail? Wrong tool selection? Bad reasoning? Hallucination? Guardrail bypass?
  • Ethics moment: Test for bias — does your agent perform differently for different demographics, names, or scenarios?
  • Improvement loop: Fix the worst failure, re-run eval, compare scores. Systematic improvement, not guesswork.
  • The metrics that matter: Accuracy, relevance, safety score, consistency, cost per query
7:05 PM - 7:20 PM

Part 6: Evaluation for Your Final Project

15 minutes

Your final project requires a test suite. Here's exactly what's expected.

  • Final project test suite requirements: 20 test cases, automated runner, LLM-as-judge, consistency check
  • Grading: Does the test suite cover happy paths AND edge cases? Does the judge provide useful scores? Are results documented?
  • Template: Use today's evaluation pipeline as your starting point. Customize for your domain.
  • Pro tip: Build the test suite BEFORE you finish the agent. Tests drive better agent design.
7:20 PM - 7:30 PM

Part 7: Wrap-Up

10 minutes

You can now build agents AND prove they work. Next: put it all together for your final project.

  • Today: You moved from vibes to data. Your agent now has a test suite, automated scoring, and real metrics.
  • The full stack is complete: Build (S4-8) → Apply (S9) → Safeguard (S10) → Evaluate (TODAY)
  • Next session: Final Project Workshop — teams form, scope locks, building begins
  • Homework: Refine your test suite, analyze failures, prepare your final project proposal
03 // INTERACTIVE RESOURCES

Tools & Learning Materials

Everything you need to explore, experiment, and build.

Hands-On

Evaluation Pipeline Notebook

Build a 20-case test suite, automated runner, and LLM-as-judge evaluator. Includes consistency testing and failure analysis.

Open in Colab
Docs ?

Anthropic Evaluation Guide

Official guide to testing and evaluating Claude-based applications. Covers test design, automated scoring, and quality metrics.

Read docs
Guide

LLM-as-Judge Pattern

Using one LLM to evaluate another. The pattern behind automated agent evaluation at scale.

Read guide
04 // HANDS-ON ACTIVITIES

Learning by Doing

Three interactive challenges to build your intuition.

? Activity 1

Build Your Evaluation Pipeline

45 minutes. Create a complete testing and evaluation system for your agent:

1

Write 20 Test Cases (15 min)

10 happy path, 5 edge cases, 3 adversarial, 2 domain-specific risks. Each case: input, expected behavior, evaluation criteria.

2

Build Automated Runner + LLM-as-Judge (15 min)

Automated test runner that executes all cases. LLM-as-judge that scores each output on accuracy (1-5), helpfulness (1-5), and safety (pass/fail).

3

Consistency Test (15 min)

Run 5 queries 3 times each. Calculate output variance. Flag any query where the agent gives meaningfully different answers.

? Activity 2

Failure Analysis & Improvement

Analyze your evaluation results and systematically improve:

1

Identify Failure Patterns

Group failures by type: wrong tool, bad reasoning, hallucination, safety issue. Which type is most common?

2

Fix the Worst Failure

Pick the most impactful failure. Fix it (usually a system prompt or tool improvement). Re-run that test case.

3

Re-Run Full Eval

After the fix, re-run all 20 cases. Did overall scores improve? Did the fix break anything else?

05 // KEY TAKEAWAYS

What to Remember

?

Vibes are not evaluation. 'It seems to work' isn't a deployment-ready answer. Systematic test suites, automated scoring, and consistency checks are what production agents need.

LLM-as-judge scales evaluation. You can't manually review every agent output. Using Claude to evaluate Claude gives you automated, consistent scoring at scale.

?

Answer with data. When someone asks 'does it work?', show them: 85% accuracy on 20 test cases, 92% consistency across 3 runs, 0 safety failures. That's deployable.

Test for bias and fairness. Your agent might perform differently for different inputs. Test across demographics, edge cases, and adversarial scenarios to catch hidden biases.

06 // HOMEWORK

Before Next Session

Complete these tasks before our next class to prepare for prompt engineering.

Refine: Expand your test suite to 30 cases. Add at least 5 bias/fairness test cases specific to your domain. Re-run the full evaluation.
Analyze: Write a 1-page evaluation report: accuracy score, consistency score, top 3 failure modes, and a prioritized list of improvements.
Prepare: Finalize your final project proposal: problem statement, agent architecture, tool list, data sources, and test plan. Bring to Session 12.
Read: Read about LLM evaluation benchmarks (MMLU, HumanEval, etc.). Write a paragraph on how these relate to evaluating your own agent.
Coming Next

Session 12: Final Project Workshop

From notebook to product. From prototype to pitch. Teams form, scope locks, and building begins.

WorkshopFinal ProjectTeam FormationBuilding