Muex. Tce
(Muex v0.8.0)
View Source
Trivial Compiler Equivalence (TCE) for mutants.
Two pieces of source are compiler-equivalent when they compile to the same BEAM code. Such a mutant can never be killed — no test can distinguish it from the original — so it is an equivalent mutant and should be dropped.
This catches cases the AST-pattern rules in Muex.Equivalence cannot, e.g.
deleting a @moduledoc/@doc or any change that the compiler erases, where
the resulting function bytecode is byte-for-byte identical.
The comparison is sound: both modules are compiled under the same throwaway name, disassembled, their line annotations stripped, and the remaining instruction streams compared. Equivalence is reported only on an exact match; anything that fails to compile is treated as not provably equivalent so a real mutant is never hidden.
Summary
Functions
Returns true when the two quoted modules compile to identical BEAM code.
Like equivalent?/2, but the mutant is supplied as source text (as produced
by the compiler when applying a mutation). Returns false if it does not parse.
Functions
Returns true when the two quoted modules compile to identical BEAM code.
Returns false if they differ or if either fails to compile.
Like equivalent?/2, but the mutant is supplied as source text (as produced
by the compiler when applying a mutation). Returns false if it does not parse.