Skip to main content

Quiz: Tools and Loops

Why This Matters

Tools give TestPilot reach. These questions check whether you can keep that reach under control. They are written by Learn Automated Testing, not taken from the real exam.

Quiz

1. TestPilot keeps calling get_issue with made-up ids when it should call search_issues. What do you change first?

  • A. Add “use search_issues” to the system prompt
  • B. Remove get_issue
  • C. Rewrite both descriptions so each says what it returns and when to use it, or merge them into one tool
  • D. Use a larger model
Show answer
C. The model chooses tools from their descriptions; overlapping, vague descriptions cause wrong choices. Sharpen the boundaries or merge the tools. A patches the symptom in the wrong place, B may remove something you need, D hopes the problem away.
Quiz

2. read_log cannot find the log because CI deleted it after 7 days. What should the tool return?

  • A. A structured error saying the log was not found and why, marked as not worth retrying, with a suggestion to continue without it
  • B. An empty string
  • C. The raw exception with its stack trace
  • D. Nothing; let the loop time out
Show answer
A. An error the model can act on: what happened, whether to retry, what to do instead. B looks like “no log content” and misleads; C leaks internals and does not help; D wastes the whole step budget.
Quiz

3. In a test of your agent loop, the model must call a tool, get an error and then give a verdict. How do you test this reliably?

  • A. Run the real model until it takes that path
  • B. Lower the temperature and run it once
  • C. Test only the final verdict against the golden set
  • D. Script the model’s responses with a fake client and assert on what your code sends back
Show answer
D. A scripted model makes the path deterministic, fast and free, and lets you assert that the error result was sent correctly. The golden set (C) measures the model’s judgement, not your loop.
Quiz

4. TestPilot may file bugs in the issue tracker. Which control is the strongest?

  • A. A tool description that says “only file real bugs”
  • B. A rule in the system prompt
  • C. A token that can only create issues in the QA project, plus a confirmation step in code before create_issue runs
  • D. A weekly review of last week’s tickets
Show answer
C. Credentials limit what can happen at all, and the confirmation step puts a human before every write. A and B are requests to the model; D only finds problems after the damage.
Quiz

5. The same get_test_history capability is needed by the nightly TestPilot job and by developers using Claude Code. What is the best design?

  • A. Serve it from one MCP server, configured in .mcp.json, with credentials held by the server
  • B. Copy the tool code into both applications
  • C. Paste the history into the prompt by hand when needed
  • D. Give Claude Code direct database access
Show answer
A. One server, two clients: one implementation, one place for the credentials, one place to review access. B duplicates code and secrets, C does not scale, D gives far more access than needed.