mc-imperial / dredd

A mutation testing tool designed to work with large C++ (and C) codebases.
Apache License 2.0
13 stars 3 forks source link

Unify expression mutation #106

Closed afd closed 2 years ago

afd commented 2 years ago

This change simplifies expression mutation so that VisitExpr intercepts all expressions and wraps relevant ones in function calls that handle constant replacement and unary operator insertion, and then checks whether the expression is a unary or binary operator to invoke more specialised mutations when this is the case.

This makes the code simpler, and will make various enhancements simpler (e.g., related to when the whole expression evaluates to 0, which otherwise would have to be handled separately for each of the unary, binary and general expression cases).