Thanks to Brian @bglusman who provided a very valuable PR to this library, I am to introduce the mutation-testing library for BEAM languages named Muex.
Why another one, when we already have Darwin and Exavier? Well, because I like to write code (more formal comparison can be found here.)
This library is also a part of the Language Agnostic Code Audit SaaS effort, MIT-license. Here is the repo:
Example outcome:
❯ mix muex --files "examples/cart/lib/cart/*.ex" --verbose
Loading files from examples/cart/lib/cart/*.ex...
Found 2 file(s)
Analyzing files for mutation testing suitability...
✓ examples/cart/lib/cart/product.ex (score: 100)
✓ examples/cart/lib/cart/shopping_cart.ex (score: 100)
Selected 2 file(s), skipped 0 file(s)
Generating mutations...
Applying mutation optimization...
Original mutations: 1541
Optimized mutations: 31
Reduction: 1510 (-98.0%)
Average impact score: 6.9
Testing 31 mutation(s)
Analyzing test dependencies...
Running tests...
×××·×××××·×××
---×××·×××××××××××
Mutation Testing Results
==================================================
Total mutants: 31
Killed: 3 (caught by tests)
Survived: 25 (not caught by tests)
Invalid: 3 (compilation errors)
Timeout: 0
==================================================
Mutation Score: 9.68%
Survived Mutations:
--------------------------------------------------
examples/cart/lib/cart/product.ex:144
Boolean: and to or
…
** (Mix) Mutation score 9.68% is below threshold 100%






















