test_set_scoring_counts_members_and_precision

Tests › tests/test_grader.py

passed Passed in the packaged run.

What this test is for

Why it exists

PRECISION IS A DECISION. An answer that names both correct files AND a spurious one has full recall and loses the precision decision — which is what removes the incentive to dump every path in the repository once grading is known to be mechanical.

Given

  1. mark = Mark( text="every file with a thread-creation site", type="set", weight=2, extract="List them.", members=({"value": "programs/ssl/a.c"}, {"value": "programs/test/b.c"}), )
  2. monkeypatch.setattr( judge, "ask", lambda *_a, **_k: judge.Reply(text="ITEMS:\na.c\nb.c\nlibrary/z.c\nEND") )
  3. monkeypatch.setattr(score, "ask", judge.ask)
→

When

  1. out = score.score_set(mark, "answer", "claude-x-1")
  2. all(d.weight == 2 for d in out)
→

Then

  1. ✓ len(out) equals 3
  2. ✓ [d.hit for d in out] equals [True, True, False]
  3. ✓ out[-1].detail contains "library/z.c"
  4. ✓ all(d.weight == 2 for d in out) holds

tests/test_grader.py:129 · its file's page

What it checks (4)

  1. assert len(out) == 3, "two members plus precision" observes score_set via out
  2. assert [d.hit for d in out] == [True, True, False] observes score_set via out
  3. assert "library/z.c" in out[-1].detail observes score_set via out
  4. assert all(d.weight == 2 for d in out) observes all

Where the product reaches it

  • dossier → _rank_enum_over_mirror → _class_side_is_only_enum_mirrors → all (flow)

Call flow

test_set_scoring_counts_members_and_precision→score_set→all

What it reaches

Each row runs from this test, through the calls it makes, to the code a requirement names. If that code breaks, the test's checks are what should catch it. Reaching is not proving: a check only proves what it observes. No mutation records were given, so these rows say what the test REACHES.

test_set_scoring_counts_members_and_precision · 4 checksallREQ-DDB-WIKI-054 · inferred
Also reaches 1 requirement

Its run touches their code; that is reach, not proof.