pub enum MutationOperator {
Aor,
Ror,
Lor,
Uoi,
Abs,
Sdl,
Svr,
Bsr,
}Expand description
Mutation operators from the standard catalog
Variants§
Aor
Arithmetic Operator Replacement
a + b → a - b, a * b, a / b, a % b
Ror
Relational Operator Replacement
a < b → a <= b, a > b, a >= b, a == b, a != b
Lor
Logical Operator Replacement
a and b → a or b
Uoi
Unary Operator Insertion
x → -x, not x
Abs
Absolute Value Insertion
x → abs(x)
Sdl
Statement Deletion Delete a statement from the program
Svr
Scalar Variable Replacement
x → y (where y has the same type)
Bsr
Boundary Substitution Replacement
0 → -1, "" → " ", [] → [None]
Implementations§
Source§impl MutationOperator
impl MutationOperator
Sourcepub fn ast_transform_operators() -> Vec<Self>
pub fn ast_transform_operators() -> Vec<Self>
Get operators recommended for ASTTransform bugs (P0 priority)
From spec: ASTTransform bugs are 40-62% of defects
Sourcepub fn ownership_operators() -> Vec<Self>
pub fn ownership_operators() -> Vec<Self>
Get operators recommended for OwnershipBorrow bugs (P1 priority)
From spec: OwnershipBorrow bugs are 15-20% of defects
Sourcepub fn description(&self) -> &'static str
pub fn description(&self) -> &'static str
Get description of the operator
Trait Implementations§
Source§impl Clone for MutationOperator
impl Clone for MutationOperator
Source§fn clone(&self) -> MutationOperator
fn clone(&self) -> MutationOperator
Returns a duplicate of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl Debug for MutationOperator
impl Debug for MutationOperator
Source§impl Display for MutationOperator
impl Display for MutationOperator
Source§impl Hash for MutationOperator
impl Hash for MutationOperator
Source§impl PartialEq for MutationOperator
impl PartialEq for MutationOperator
impl Copy for MutationOperator
impl Eq for MutationOperator
impl StructuralPartialEq for MutationOperator
Auto Trait Implementations§
impl Freeze for MutationOperator
impl RefUnwindSafe for MutationOperator
impl Send for MutationOperator
impl Sync for MutationOperator
impl Unpin for MutationOperator
impl UnsafeUnpin for MutationOperator
impl UnwindSafe for MutationOperator
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more