test_test_code_is_a_lens_not_a_box¶
Tests › tests/test_wiki_map.py
What this test is for
Why it exists
`exclude_tests` drops test-only components from the layout and counts the calls test code makes into each remaining component as `tested_calls`.
Verifies REQ-DDB-WIKI-021 REQ-DDB-WIKI-023
Given
- —
When
graph = build_graph(db, _EVIDENCE, None, exclude_tests=True)comps = {c["id"]: c for c in graph["components"]}all(p["file"].startswith("pkg/") for p in graph["symbols"])
Then
- ✓ set(comps) equals {"pkg/api", "pkg/core"}
- ✓ comps["pkg/core"]["tested_calls"] equals 1
- ✓ comps["pkg/api"]["tested_calls"] equals 0
- ✓ all(p["file"].startswith("pkg/") for p in graph["symbols"]) holds
- ✓ comps["pkg/api"]["y"] equals 0
- ✓ comps["pkg/core"]["y"] is greater than 0
What it exercises
The parts of the system's flows this test ran, measured by per-test coverage: lit steps ran in this test, dimmed ones did not, and ▶ marks where the test called in. Each title opens the whole flow with these steps lit.
Build this wiki from the index · 20 of 400 steps
… 140 earlier steps
… 234 later steps
tests/test_wiki_map.py:70 · its file's page
What it checks (4)
assert set(comps) == {"pkg/api", "pkg/core"}not attributedassert comps["pkg/core"]["tested_calls"] == 1 and comps["pkg/api"]["tested_calls"] == 0not attributedassert all(p["file"].startswith("pkg/") for p in graph["symbols"])observesallassert comps["pkg/api"]["y"] == 0 and comps["pkg/core"]["y"] > 0not attributed
Where the product reaches it
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.
Requirements it verifies (2)
| requirement | linked by | implementers exercised |
|---|---|---|
| REQ-DDB-WIKI-021 | catalog | unknown |
| REQ-DDB-WIKI-023 | catalog | unknown |
Also reaches 4 requirements
Its run touches their code; that is reach, not proof.
- REQ-DDB-QUERY-001 measured
- REQ-DDB-QUERY-003 measured
- REQ-DDB-WIKI-019 measured
- REQ-DDB-WIKI-054 inferred