clew
  • Requirements
  • Flows
  • Tests
  • Change impact
  • Map
  • Architecture
  • Docs
  • SBOM

test_per_test_coverage_contexts_link_tests_by_measurement¶

Tests › tests/test_wiki_imports.py

passed Passed in the packaged run.

What this test is for

Why it exists

MEASURED, NOT INFERRED: coverage.py run with `--cov-context=test` records which test ran each line; a test that ran a line inside an implementer's body is linked to its requirement.

Verifies REQ-DDB-WIKI-009

Given

  1. report = tmp_path / "coverage.json"
  2. report.write_text( json.dumps( { "files": { "src/a.c": { "contexts": { "11": ["tests/unit/test_c.py::test_cov[1]|run", ""], "40": ["tests/unit/test_c.py::test_elsewhere|run"], } } } } ) )
  3. inputs = EvidenceInputs(contexts="coverage.json", infer_depth=0)
→

When

  1. rows = { r.req_id: r for r in requirement_evidence(traced, junit=[], inputs=inputs, repo_root=tmp_path) }
→

Then

  1. ✓ rows["R-A"].measured_tests equals ("test_cov",)
  2. ✓ {t for t, _s in rows["R-A"].tests} does not contain "test_elsewhere"

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 · 6 of 400 steps

… 131 earlier steps

callercallercallercallerclew/wiki/build.pyclew/wiki/build.pyclew/wiki/build.pyclew/wiki/build.pyclew/query/_common.pyclew/query/_common.pyclew/query/_common.pyclew/query/_common.pyother filesother filesother filesother filesopt (line 200)optloop (line 259)loopelif (line 264)elifopt (line 202)optloop (line 204)loopbuild_wiki132–133. parse_contexts → _contexts_from_lcov132_contexts_from_lcov +1 more134. _text → check_report_size134check_report_size135. _contexts_from_lcov → _relative135_relative136–138. parse_contexts → _contexts_from_data_file136_contexts_from_data_file +2 more139. parse_contexts → _text139_text▶ test enters140–141. parse_contexts → _relative140_relative +1 more142. _build_site → build_graph142build_graph143. build_graph → connect143connect

… 201 steps between

callercallercallercallerclew/wiki/build.pyclew/wiki/build.pyclew/wiki/build.pyclew/wiki/build.pyother filesother filesother filesother filesbuild_wiki345. slice_svg → _hidden345_hidden346. _build_site → parse_junit346parse_junit347. parse_junit → fold_cases347fold_cases▶ test enters348. fold_cases → _folded348_folded349–350. parse_junit → _case_name349_case_name +1 more

… 50 later steps

tests/test_wiki_imports.py:451 · its file's page

What it checks (2)

  1. assert rows["R-A"].measured_tests == ("test_cov",) observes requirement_evidence via rows
  2. assert "test_elsewhere" not in {t for t, _s in rows["R-A"].tests} observes requirement_evidence via rows

Where the product reaches it

No product flow reaches this code: no product entry point's flow calls any of the functions this test calls.

Call flow

test_per_test_coverage_contexts_link_tests_by_measurement→requirement_evidence

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_per_test_coverage_contexts_link_tests_by_measurement · 2 checksrequirement_evidenceconnectREQ-DDB-QUERY-001 · measuredrequirement_evidence_implementer_spanstable_existsREQ-DDB-QUERY-003 · measuredrequirement_evidenceREQ-DDB-WIKI-002 · measuredrequirement_evidence_tierallREQ-DDB-WIKI-054 · inferred

Requirements it verifies (1)

requirementlinked byimplementers exercised
REQ-DDB-WIKI-009catalogunknown
Also reaches 11 requirements

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

  • REQ-DDB-CONFIG-001 measured
  • REQ-DDB-QUERY-001 measured
  • REQ-DDB-QUERY-003 measured
  • REQ-DDB-SCHEMA-006 measured
  • REQ-DDB-WIKI-002 measured
  • REQ-DDB-WIKI-010 measured
  • REQ-DDB-WIKI-015 measured
  • REQ-DDB-WIKI-016 measured
  • REQ-DDB-WIKI-017 measured
  • REQ-DDB-WIKI-041 measured
  • REQ-DDB-WIKI-054 inferred
clew Generated by clew wiki from the repository's index