test_groups_by_requirement¶
Tests › tests/guard/test_guard_impact.py
What this test is for
Why it exists
The test says nothing about why.
Given
config = _make_impact_config(req_file=FIXTURES_DIR / "impact" / "req.csv")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
entries = build_impact_report(changed, config)req252 = next(e for e in entries if e.req_id == "REQ-0252")
Then
- ✓ len(entries) equals 2
- ✓ len(req252.functions) equals 2
- ✓ 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
… 207 steps between
… 78 later steps
tests/guard/test_guard_impact.py:273 · its file's page
What it checks (3)
assert len(entries) == 2observesbuild_impact_reportviaentriesassert len(req252.functions) == 2not attributedassert 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
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 4 requirements
Its run touches their code; that is reach, not proof.
- REQ-DDB-GUARD-009 measured
- REQ-DDB-GUARD-010 measured
- REQ-DDB-GUARD-011 measured
- REQ-DDB-GUARD-016 measured