Expand description
Assertions coverage: which executed statements a test would catch breaking.
A statement counts as asserted when changing it makes at least one passing
test that executes it fail. The change follows the statement: an if has its
condition inverted (each direction), return x returns undefined, a
declaration’s value becomes undefined, an expression point evaluates to
undefined, and any other statement is skipped. Imports, declarations without
a value, and function, class and type declarations are not assessed.
Supercov does not decide this itself. For each test it renders what the test ran (its code, its helpers, and the source it executed) and asks Jev, one yes/no question per statement, whether the test would fail. This module owns the population, the change rules and the rendering; the CLI owns the requests, the answer cache and the output. What Jev sees for one statement and one test is also the cache key, so an answer is reused only when the question would be asked with exactly the same text.
Structs§
- Assessment
Input - The executed statements of a run and the tests that ran them.
sourcesare the run’s source files, verified against the run. What assessing a run reads from its analysis: the passing view’s tests, and its measured statements and executed decisions with the tests that ran them. Publication stores it, so an assessment does not analyse the run’s evidence again (4.4 s of supergateway’s 7.6 s of planning). - Input
Point - A statement or decision, with the tests that ran it as indexes into
AssessmentInput::tests. - Input
Test - Population
- Statement
- TestRef
Enums§
Constants§
- FIRST_
TESTS - Tests asked about a statement before it may be called unchecked, then the wider set asked before it is (measured: more tests remove false “unchecked” flags, and 25 tests was no better than 15).
- INSTRUCTIONS
- LAST_
TESTS - Asked last, when none of those is judged to fail: the tests most likely written for the statement.
- MAX_
QUESTIONS - MAX_
TESTS - The most tests one statement is asked of.
- MODEL
- MORE_
TESTS - THRESHOLD
- A statement is asserted when some test’s answer is at least this.
Functions§
- assessment_
input - load_
snapshot - Read files written by
save_snapshot. - population
- population_
from - save_
snapshot - Write files’ text, compressed, to
path.