Code Monkey home page Code Monkey logo

muterl's Introduction

Muterl Build Status

Mutation testing for erlang. It makes small changes to your source code and checks if tests are passing. If they pass -- mutation is reported. The idea behind this kind of testing is to check tests quality.

Supported mutators:

  • clause remove
  • logic change
  • constant change

Rebar-style configurable. Create muterl.config with erlang terms in your project folder.

Default options are:

{files, "src/*.erl"}.
{mutants, 100}.
{runner, "rebar3 eunit"}.
{report, "muterl.report"}.
{backup_folder, "muterl.backup"}.

To disable remove_clause, logic_inverse or constant_change, please specify {<mutation_name>, disable}. at your config.

To selectively enable or disable mutations for a set of functions please specify {functions, "some?hing.*"} or {functions_skip, ".*test"}. Function names matched with regexp. Both can be used at a time.

To use, run from your project folder, don't forget to backup everything!

Example below starts mutations for jsx:

git clone https://github.com/parsifal-47/muterl
git clone https://github.com/talentdeficit/jsx
cd jsx
../muterl/muterl

If files can't be parsed due to compicated macros or parser bug - they are skipped.

While running, it creates a report for survived mutants, for example:

Mutant survived, affected file: src/jsx_decoder.erl
*** muterl.backup/src/jsx_decoder.erl   2016-12-24 17:18:56.000000000 +0100
--- src/jsx_decoder.erl 2016-12-24 17:30:57.000000000 +0100
***************
*** 1114,1121 ****

  done(<<?space, Rest/binary>>, Handler, [], Config) ->
      done(Rest, Handler, [], Config);
- done(<<?newline, Rest/binary>>, Handler, [], Config) ->
-     done(Rest, Handler, [], Config);
  done(<<?tab, Rest/binary>>, Handler, [], Config) ->
      done(Rest, Handler, [], Config);
  done(<<?cr, Rest/binary>>, Handler, [], Config) ->
--- 1114,1119 ----

Feel free to create tickets and send your feedback!

muterl's People

Contributors

parsifal-47 avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar

Forkers

m-2k earlpitts

muterl's Issues

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.