Launch price: every exam for $29.99 a year, for the first 300 buyers. See the price

CertStreak
Menu

Design and implement a strategy for testing, including unit tests, regression tests, integration tests, and automated evaluations

A worked example

Yes or no

Fabrikam has three Microsoft Foundry agents. Agent A (orchestrator) calls tools exposed by Agent B (style checker). Agent C (ingestion) does not call Agent B. The file agent-dependencies.yml records these relationships.

A pull request updates Agent B to v2.0. The team uses the workflow shown in the exhibit to automate contract validation.

# .github/workflows/validate-compatibility.yml (excerpt)
name: Agent Compatibility Validation
on:
  pull_request:
    paths:
      - 'agents/**'

jobs:
  validate-contracts:
    runs-on: ubuntu-latest
    steps:
      - uses: actions/checkout@v4

      - name: Extract tool schemas from updated agents
        run: |
          python scripts/extract_agent_schemas.py \
            --agent-path agents/ \
            --output contracts/current.json

      - name: Compare against baseline contracts
        run: |
          python scripts/validate_compatibility.py \
            --baseline contracts/baseline.json \
            --current contracts/current.json \
            --dependency-graph agent-dependencies.yml

      - name: Check for breaking changes
        run: |
          if [ -f contracts/breaking-changes.txt ]; then
            echo "Breaking changes detected:"
            cat contracts/breaking-changes.txt
            exit 1
          fi

For each of the following statements, select Yes if the statement is true. Otherwise, select No.

StatementYesNo
The validation script uses agent-dependencies.yml to identify Agent A, rather than Agent C, as the agent whose expected contract must be checked against Agent B v2.0.

The script loads the dependency graph and finds the agents that depend on the modified agent. Only Agent A calls Agent B, so Agent A's expectations are the ones compared with the v2.0 tool schemas.

Correct
The contract tests for Agent B v2.0 should run after it is deployed to production, so that live traffic can confirm compatibility.

Contract tests run in the validation job before any agent change is deployed. A failure then stops the deployment pipeline, so the incompatible version never reaches production.

Correct
If the comparison step writes contracts/breaking-changes.txt, the validate-contracts job succeeds and prints the detected changes.

When that file exists, the last step prints the breaking changes and then runs exit 1. This fails the job, which is how the validation stops an incompatible change.

Correct
Why

Contract validation is an automated gate that runs before deployment, here on pull requests that change agent code. The script reads the dependency graph to find the agents that consume the modified agent and checks those contracts for backward compatibility. Any breaking change fails the job. This stops the pipeline before the incompatible version can reach production.

Practise this topic until it's automatic.

Ten questions a day, every answer explained, and misses that come back until you beat them.

Start free