mudasobwa
Muex - the library for mutation testing
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:
https://github.com/Oeditus/muex
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%
Most Liked
krisleech
lud
Very interesting project! Thank you. I left an issue on Github because it seems to have problem compiling my project that uses macros.
mudasobwa
Last Post!
mudasobwa
Copying the source code is not the trick, the trick is to avoid recompilations whenever possible.
Unlike ruby or python, where you just change the code and run the mutation, recompiling elixir module might result in recompilation of the whole project. So we group tests by mutations in code, we avoid mutating the whole bunch of file kinds like behaviours etc, Mutation Optimization — Muex v0.8.1
Popular in Announcing
Other popular topics
Categories:
Sub Categories:
Forums
Popular Tags
- #ecto
- #liveview
- #troubleshooting
- #learning-elixir
- #deployment
- #library
- #erlang
- #testing
- #genserver
- #mix
- #absinthe
- #remote-other
- #otp
- #plug
- #how-to-question
- #macros
- #postgres
- #channels
- #elixirconf
- #exunit
- #discussion
- #code-sync
- #javascript
- #podcasts
- #onsite
- #dialyzer
- #docker
- #authentication
- #umbrella
- #full-time-contract
- #podcasts-by-brainlid
- #ecto-query
- #elixir-ls
- #phoenix_html
- #iex
- #blog-post
- #graphql
- #genstage
- #ai
- #websockets
- #supervisor
- #elixirconf-us
- #advent-of-code
- #distillery
- #processes
- #api
- #forms
- #metaprogramming
- #security
- #hex









