Repository navigation
Say that tests check a heuristic's routes, not its thresholds, unless a route fails past one - #915
Merged
Merged
Conversation
… a route fails past one Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Motivation
The testing standard says not to pin implementation choices, but the review rules count "claimed behavior that no test verifies" as a significant finding. The two collide for a heuristic whose routes each give a correct result, such as
method="auto"in #913, which picks among exact distance-search methods: its guide documents its thresholds, so reviews asked for a test of each. About 260 of the 1,144 test lines that a draft of #913 added checked the heuristic's arithmetic at its exact boundaries, such as probing at a work budget minus one but not at the budget, although an off-by-one there changes only which correct method runs.Changes
standards/testing.rst: tests of such a heuristic check that each route gives correct results, and that cases far from its thresholds take the intended route. Its thresholds are implementation choices, even where documented. The exception is a threshold past which a route would fail or give a wrong result even with unlimited time and memory, whose nearest cases on each side are still tested. This keeps tests such as the one of the fault search's cap of2**31pairs, past which its 32-bit slot numbers overflow, where a case far from the cap would miss a slip such as2**32.reviewing.rst: "claimed behavior that no test verifies" now excepts an implementation choice that the testing standard says not to pin, so that reviewers of every angle read the two rules alike.The change adds about 90 words to the roughly 9,600 words of the rules, and replaces no rule.