Mutation Operators Supported by mutator
operators.RdThis help page lists the mutation operators that the mutator package supports for mutation testing in R.
Details
The following mutation operators can be applied to R code:
Arithmetic operators:
+<->-, and*<->/Comparison operators:
==<->!=,<<->>, and<=<->>=Logical operators:
\&<->|,&&<->||, removes!, and negatesif/whileconditionsAssignment and call values: replaces assignment right-hand sides and ordinary function calls with
42Scalar constants: replaces numeric zero with
42, numeric non-zero values with0, constants with a typedNA, and constants withNULLReturns: replaces non-constant direct
return()values withNULL, for examplereturn(x)->return(NULL)Deletions: removes statements inside
{ ... }blocks and, as a fallback, valid source lines
Direct literal return values are not rewritten by the return-to-NULL mutation; for example, return(1) is left alone by that mutation.