test_the_benign_entropic_case_does_NOT_warn¶
Tests › tests/test_coverage.py
What this test is for
Why it exists
THE FALSE-ALARM GUARD, and it is the reason the threshold is a ratio.
Given
files = _healthy(170) + [ (f"vendor/Fuzzer/FuzzerUtil{platform}.cpp", 200, 0) for platform in ("Windows", "Darwin", "Posix", "IOWindows", "Merge", "Main", "Extra") ]db_path, root = _coverage_db(tmp_path, files)
When
with caplog.at_level(logging.WARNING): coverage = report_index_coverage(db_path, root)
Then
- ✓ coverage.substantive_files equals 177
- ✓ coverage.barren_files equals 7
- ✓ round(coverage.barren_ratio, 3) equals 0.04
- ✓ coverage.alarming is false
- ✓ [r for r in caplog.records if r.levelno >= logging.WARNING] is false
tests/test_coverage.py:142 · its file's page
What it checks (5)
assert coverage.substantive_files == 177observesreport_index_coverageviacoverageassert coverage.barren_files == 7observesreport_index_coverageviacoverageassert round(coverage.barren_ratio, 3) == 0.04observesreport_index_coverageviacoverageassert not coverage.alarmingobservesreport_index_coverageviacoverageassert not [r for r in caplog.records if r.levelno >= logging.WARNING], ( "entropic's inapplicable platform files are not a defect and must not warn" )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-INDEX-001 measured
- REQ-DDB-INDEX-002 measured
- REQ-DDB-INDEX-003 measured
- REQ-DDB-INDEX-004 measured