test_set_scoring_counts_members_and_precision¶
Tests › tests/test_grader.py
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
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"}), )monkeypatch.setattr( judge, "ask", lambda *_a, **_k: judge.Reply(text="ITEMS:\na.c\nb.c\nlibrary/z.c\nEND") )monkeypatch.setattr(score, "ask", judge.ask)
When
out = score.score_set(mark, "answer", "claude-x-1")all(d.weight == 2 for d in out)
Then
- ✓ len(out) equals 3
- ✓ [d.hit for d in out] equals [True, True, False]
- ✓ out[-1].detail contains "library/z.c"
- ✓ all(d.weight == 2 for d in out) holds
tests/test_grader.py:129 · its file's page
What it checks (4)
assert len(out) == 3, "two members plus precision"observesscore_setviaoutassert [d.hit for d in out] == [True, True, False]observesscore_setviaoutassert "library/z.c" in out[-1].detailobservesscore_setviaoutassert all(d.weight == 2 for d in out)observesall
Where the product reaches it
dossier→_rank_enum_over_mirror→_class_side_is_only_enum_mirrors→all(flow)
Call flow
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.
Also reaches 1 requirement
Its run touches their code; that is reach, not proof.
- REQ-DDB-WIKI-054 inferred