Skip to content
CodeKruPro

Test the test: false alarms and misses

16/99

Module · A deterministic harness

beginner

about 40 min

What this lesson teaches

The idea

A test harness can be wrong too. It can pass a bad reply (a miss) or fail a good one (a false alarm).

Why a tester cares

Comparing the harness with human labels shows how much to trust its pass rate, and exposes the worst bug: a check that cannot run but counts as a pass.

Words you will meet

False alarm:
a test that fails a good reply.
Miss:
a test that passes a bad reply.
Confusion matrix:
a 2 by 2 table counting hits, misses, false alarms and correct passes.
Fail closed:
when a check cannot run, count it as a failure, never a pass.

What you will do

  1. 1Run the harness
  2. 2Count hits, misses and false alarms
  3. 3Fix the harness
  4. 4Submit
Jump to practice

Your harness is itself a classifier. For every reply it says pass or fail, and it can be wrong in two ways: a miss (a bad reply it passes) and a false alarm (a good reply it fails). A harness nobody has checked is a source of confident wrong numbers.

replies.jsonl holds 20 recorded replies. Each row has the case's checks and a human label: good or bad. A teammate's harness.py decides pass or fail, and run_eval.py prints the IDs it flags as failing.

Your task

  1. Click Run to see which rows the harness flags. Compare them with the human labels and count the four outcomes below.
  2. Find the bug that lets some bad replies pass. Fix harness.py so it fails closed: a check that cannot run must never count as a pass.

Treat "flagged as failing" as the harness's positive answer, and "bad" as the true positive class.

Sign in to practise

The lesson is free to read. A free account lets you talk to the practice bots, run your code and save your score. You will come back to this lesson.

1

Your code

on the 20 recorded replies

How this is checked: When you submit, your script runs on 2 sets of data, 1 of them hidden, and the server compares what it prints with the right values. Run tries it on the data you can see.

2

Your answer

How this is checked: Your number must match the right value.

3

Your answer

How this is checked: Your number must match the right value.

4

Your answer

How this is checked: Your number must match the right value.

5

Your answer

How this is checked: Your number must match the right value.

Core checks earn 50 points and the harder checks the other 50. You can submit as many times as you like.

About this lesson

False positives and false negatives in LLM evals: testing the harness itself

AI Testing for QA EngineersBeginnerA deterministic harness

How it works

A harness is a classifier: for each reply it says pass or fail, and it can be wrong both ways. A miss passes a bad reply; a false alarm fails a good one. Without checking it against human labels, its pass rate is a confident number of unknown quality.

The four outcomes of a confusion matrix make the errors countable, and they reveal the most dangerous harness bug: a check that cannot run, perhaps because a field is missing, quietly counting as a pass. A harness should fail closed.

About the assignment

Run a teammate's harness on twenty labelled replies, count its hits, misses, false alarms and correct passes, then fix the bug that lets some bad replies through.

What you will do

  1. Treat "flagged as failing" as the positive answer and "bad" as the true positive class.
  2. Compare the flagged IDs with the human labels row by row.
  3. Find where a check returns success without checking, and make it fail instead.

Common mistakes

  • Swapping misses and false alarms

    A miss is a bad reply the harness passed. Decide the positive class first, then count.

  • Fixing the data instead of the code

    The replies file is evidence. The bug is in how the harness treats a check it cannot run.

In a real test suite

The same discipline applies to LLM judges in Module 10 and to scanners in Module 13: any automatic grader needs its own error rates measured before its numbers drive a release.