mudasobwa

mudasobwa

Creator of Cure

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

krisleech

Thanks for open sourcing this, I’m playing with it now. It great to have this in Elixir.

lud

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

mudasobwa

Creator of Cure

Yeah, thanks! I am on it already.

Last Post!

mudasobwa

mudasobwa

Creator of Cure

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

Where Next?

Popular in Announcing Top

Crowdhailer
Experimenting with this code. OK.try do user <- fetch_user(1) cart <- fetch_cart(1) order = checkout(cart, user) save_orde...
New
grych
Hi folks, Few months ago I have announced the proof-of-concept of the library to manipulate the browsers DOM objects directly from Elixi...
639 54260 488
New
tmbb
I’ve published the first version of my Makeup library. It’s a syntax highlighter for Elixir in the spirit of Pygments, Currently it highl...
New
pkrawat1
Hey guyz We at @aviabird are working on a payment library in elixir/phoenix. We are targeting March 2018 to add 56 Gateways to it. Have...
New
aesmail
Hello guys, I have finally made it. I created an admin interface for a framework. It’s been on my todo list for years and with the curre...
New
restlessronin
The repo is at GitHub - cyberchitta/openai_ex: Community maintained Elixir library for OpenAI API · GitHub. Docs are at OpenaiEx User Gu...
152 10796 134
New
martinthenth
Hello everybody :wave: Recently, some of my colleagues talked about database ids and uuids and their problems, and I remembered the pain...
New

Other popular topics Top

vertexbuffer
Hello, can anybody help here..? I have a list of players and I what to delete an element, but every for loop the list is reverting to ori...
New
baxterw3b
Hi guys, i’m new in the Elixir world, and i have to say, that i love it! i’m having some problem to understand anonymous functions with ...
New
Brian
What is the proper way to load a module from a file in to IEX? In the python world, doing something like this pretty standard: from ....
New
dogweather
I wrote this comment on r/haskell, and it’s not popular there. :wink: But I think I’m on to something… Haskell reminds me of Java, and e...
New
romenigld
I am trying to run a deploy with docker and I successfully runned with this command: docker build -t romenigld/blog-prod . but when I t...
New
TunkShif
This post is an instruction guide to help you setup your Neovim for Elixir development from scratch. It includes general information on h...
274 42716 114
New

We're in Beta

About us Mission Statement