test_groups_by_requirement

Tests › tests/guard/test_guard_impact.py

passed Passed in the packaged run.

What this test is for

Why it exists

The test says nothing about why.

Given

  1. config = _make_impact_config(req_file=FIXTURES_DIR / "impact" / "req.csv")
  2. changed = [ ChangedFunction(name="FuncA", file_path="a.c", reqs=["REQ-0252"]), ChangedFunction(name="FuncB", file_path="b.c", reqs=["REQ-0252"]), ChangedFunction(name="FuncC", file_path="c.c", reqs=["REQ-0555"]), ]
→

When

  1. entries = build_impact_report(changed, config)
  2. req252 = next(e for e in entries if e.req_id == "REQ-0252")
→

Then

  1. ✓ len(entries) equals 2
  2. ✓ len(req252.functions) equals 2
  3. ✓ req252.req_name equals "BLE-First Pairing"

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.

`main` (clew/guard/main.py) · 10 of 357 steps

… 53 earlier steps

program launcherprogram launcherprogram launcherprogram launcherclew/guard/main.pyclew/guard/main.pyclew/guard/main.pyclew/guard/main.pyclew/guard/config.pyclew/guard/config.pyclew/guard/config.pyclew/guard/config.pyclew/guard/impact.pyclew/guard/impact.pyclew/guard/impact.pyclew/guard/impact.pyloop (line 391)loopmain54. run_precommit → _validate_files54_validate_files55. _validate_files → load_requirements_full55load_requirements_full56. load_requirements_full → _get_requirements_config56_get_requirements_config57. _get_requirements_config → get_requirements57get_requirements58. _get_requirements_config → resolve_contained_path58resolve_contained_path59. load_requirements_full → _validate_requirements59_validate_requirements60. _validate_requirements → get_validate60get_validate61. _validate_requirements → _summarise_id61_summarise_id62. _validate_files → load_external_requirements62load_external_requirements63. load_external_requirements → get_requirements63get_requirements

… 207 steps between

program launcherprogram launcherprogram launcherprogram launcherclew/guard/main.pyclew/guard/main.pyclew/guard/main.pyclew/guard/main.pyclew/guard/config.pyclew/guard/config.pyclew/guard/config.pyclew/guard/config.pyclew/guard/impact.pyclew/guard/impact.pyclew/guard/impact.pyclew/guard/impact.pyother filesother filesother filesother filesloop (line 583)loopopt (line 587)optopt (line 482)optmain271. find_index → registered_index271registered_index272. impact_report → build_report272build_report273. build_report → load_requirements273load_requirements▶ test enters274–275. load_requirements → _get_requirements_config274_get_requirements_config +1 more276. build_report → _place_untagged276_place_untagged277. build_report → _reviewers277_reviewers278. run_precommit → _write_report278_write_report279. _write_report → validate_output_path279validate_output_path

… 78 later steps

tests/guard/test_guard_impact.py:273 · its file's page

What it checks (3)

  1. assert len(entries) == 2 observes build_impact_report via entries
  2. assert len(req252.functions) == 2 not attributed
  3. assert req252.req_name == "BLE-First Pairing" not attributed

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_groups_by_requirement→_make_impact_config→build_impact_report

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_groups_by_requirement · 3 checksbuild_impact_reportbuild_reportload_requirementsREQ-DDB-GUARD-009 · measuredbuild_impact_reportREQ-DDB-GUARD-010 · measuredbuild_impact_reportbuild_reportload_requirements_get_requirements_configREQ-DDB-GUARD-011 · measuredbuild_impact_report… 3 calls …resolve_contained_pathREQ-DDB-GUARD-016 · measured
Also reaches 4 requirements

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