Assertions that check the type of a return value rather than its content cannot detect boolean literal mutations. A TRUE → FALSE swap changes the value the function returns but not its type. Replacing type assertions with value assertions kills the mutant.
is_valid returns FALSE for NULL and TRUE for everything else. all_valid returns TRUE only if every element in a list passes is_valid. Both functions contain boolean literals (TRUE, FALSE) that boolean literal mutators will flip.
The tests only verify that the return value is a logical (is.logical(...)). A flipped boolean is still a logical — the type check passes for both the original and the mutant.
FALSE → TRUE survives. When is_valid(NULL) returns TRUE instead of FALSE, is.logical(TRUE) is still TRUE. The test cannot tell the difference.
Replace type assertions with value assertions using expect_true and expect_false. These check the actual boolean value returned, not just its type.
When a boolean literal mutant survives, replace
is.logical()type checks withexpect_true()/expect_false()value checks.
Any scripts or data that you put into this service are public.
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.