Description
Mutant is a mutation testing tool for Ruby.
The idea is that if code can be changed and your tests do not notice, either that code isn't being covered
or it does not have a speced side effect.
Mutant supports ruby >= 2.1, while support for JRuby is planned.
It should also work under any Ruby engine that supports POSIX-fork(2) semantics.
Mutant uses a pure Ruby parser and an unparser
to do its magic.
Mutant does not have really good "getting started" documentation currently so please refer to presentations and blog posts below.
mutant alternatives and similar gems
Based on the "Extra" category.
Alternatively, view mutant alternatives based on common mentions on social networks and blogs.
-
vcr
Record your test suite's HTTP interactions and replay them during future test runs for fast, deterministic, accurate tests. -
timecop
A gem providing "time travel", "time freezing", and "time acceleration" capabilities, making it simple to test time-dependent code. It provides a unified method to mock Time.now, Date.today, and DateTime.now in a single call. -
Knapsack
Knapsack splits tests evenly across parallel CI nodes to run fast CI build and save you time. -
Wrong
Wrong provides a general assert method that takes a predicate block. Assertion failure messages are rich in detail.
SaaSHub - Software Alternatives and Reviews
* Code Quality Rankings and insights are calculated and provided by Lumnify.
They vary from L1 to L5 with "L5" being the highest.
Do you think we are missing an alternative of mutant or a related project?
Popular Comparisons
README
mutant
What is Mutant?
An automated code review tool, with a side effect of producing semantic code coverage metrics.
Think of mutant as an expert developer that simplifies your code while making sure that all tests pass.
That developer never has a bad day and is always ready to jump on your PR.
Each reported simplification signifies either:
A) A piece of code that does more than the tests ask for. You can probably use the simplified version of the code. OR:
B) If you have a reason to not take the simplified version as it violates a requirement: There was no test that proves the extra requirement. Likely you are missing an important test for that requirement.
On extensive mutant use A) happens more often than B), which leads to overall less code enter your repository at higher confidence for both the author and the reviewer.
BTW: Mutant is a mutation testing tool, which is a form of code coverage. But each reported uncovered mutation is actually a call to action, just like a flag in a code review would be.
Getting started:
- Start with reading the nomenclature. No way around that one, sorry.
- Then select and setup your integration, also make sure you can reproduce the examples in the integration specific documentation.
- Use mutant during code reviews and on CI in incremental mode.
- Do not merge code with new alive mutations. If you really must bypass: Add the subjects with open problems to the ignored subjects.
Operating Systems
Mutant is supported and tested under Linux and Mac OS X.
Ruby Versions
Mutant supports multiple ruby versions at different levels:
- Runtime, indicates mutant can execute on a specific Ruby Version / implementation.
- Syntax, depends on Runtime support, and indicates syntax new to that Ruby version can be used.
- Mutations, depends on Syntax support, and indicates syntax new to that Ruby version is being analysed.
Supported indicates if a specific Ruby version / Implementation is actively supported. Which means:
- New releases will only be done if all tests pass on supported Ruby versions / implementations.
- New features will be available.
Implementation | Version | Runtime | Syntax | Mutations | Supported |
---|---|---|---|---|---|
cRUBY/MRI | 2.7 | :heavy_check_mark: | :heavy_check_mark: | :heavy_check_mark: | :heavy_check_mark: |
cRUBY/MRI | 3.0 | :heavy_check_mark: | :heavy_check_mark: | :heavy_check_mark: | :heavy_check_mark: |
cRUBY/MRI | 3.1 | :heavy_check_mark: | :heavy_check_mark: | :heavy_check_mark: | :heavy_check_mark: |
jruby | TBD | :email: | :email: | :email: | :email: |
mruby | TBD | :email: | :email: | :email: | :email: |
cRUBY/MRI | < 2.7 | :no_entry: | :no_entry: | :no_entry: | :no_entry: |
Labels:
- :heavy_check_mark: Supported.
- :warning: Experimental Support.
- :soon: Active work in progress.
- :email: Planned, please contact me on interest.
- :no_entry: Not being planned, or considered, still contact me on interest.
Licensing
Mutant is commercial software, with a free usage plan for opensource projects.
Commercial projects have to acquire a license per developer, with unlimited repositories per developer. CI usage for licensed developers is included.
Opensource projects have to acquire their free license per repository. That license will work for any contributor implicitly. Typically the project maintainer gets the license.
The license distribution happens through the mutant-license
gem. Mutant installs without
that dependency, but will not be very cooperative unless mutant-license
is also available.
The license gem is dynamically generated per licensee and comes with a unique license gem source URL.
After signup for a license the following has to be added to your Gemfile
replacing ${key}
with the license key and ${plan}
with com
for commercial or oss
for opensource usage.
source 'https://${plan}:${key}@gem.mutant.dev' do
gem 'mutant-license'
end
The mutant license gem contains metadata that allows mutant to verify licensed use.
For commercial licenses mutant checks the git commit author or the configured git email to be in the set of licensed developers.
For opensource licenses mutant checks the git remotes against the licensed git repositories. This allows the project maintainer to sign up and not bother collaborators with the details.
There are, apart from initial license gem installation, no remote interaction for license validation.
Getting an Opensource license
As stated above: Opensource projects of any kind are free to use mutant.
Just mail me: Please include:
- Just the git remote URL of your repository. Repository can be anywhere, must not be on Github, just has to be public.
I do not need any more details.
Pricing
Mutant is free for opensource use!
For commercial use mutants pricing is subscription based.
Currency | Duration | Cost | Payment Methods |
---|---|---|---|
USD | 1 month | 90$ | Credit Card |
USD | 1 year | 900$ | Credit Card, ACH transfer |
EUR | 1 month | 90€ | Credit Card, SEPA Direct Debit |
EUR | 1 year | 900€ | Credit Card, SEPA Direct Debit, SEPA Transfer |
Costs are per developer using mutant on any number of repositories.
Volume licenses with custom plans are available on request.
Should you want to procure a commercial mutant subscription please mail me.
Please include the following information:
- Your business invoice address.
- A payment email address, if different from your email address.
- Only for the EU: A valid VAT-ID is required, no sales to private customers to avoid the horrors cross border VAT / MOSS. VAT for customers outside of Malta will use reverse charging.
- Per developer the git author email address as returned by
git config user.email
Also feel free to ask any other question I forgot to proactively answer here.
Also checkout the commercial FAQ.
Topics
- Commercial use / private repositories
- Nomenclature
- Reading Reports
- Limitations
- Concurrency
- Rspec Integration
- Minitest Integration
- Configuration
- Sorbet
Communication
Try the following:
- Discord Channel reach for
@mbj
. - Github Issues
- Release Announcement Mailing List
Sponsoring
Mutant, as published in the opensource version, would not exist without the help of contributors spending lots of their private time.
Additionally, the following features where sponsored by organizations:
- The
mutant-minitest
integration was sponsored by Arkency - Mutant's initial concurrency support was sponsored by an undisclosed company that does currently not wish to be listed here.
Legal
Contents of this repository are maintained by:
Schirp DSO LTD
Director: Markus Schirp
Email: [email protected]
Vat-ID: MT24186727
Registration: C80467
Office address:
2, Carob Lane,
Sir Harry Luke Street
Naxxar NXR 2209,
Malta
Registred Address
Phoenix Business Centre,
The Penthouse,
Old Railway Track,
Santa Venera SVR9022,
Malta
*Note that all licence references and agreements mentioned in the mutant README section above
are relevant to that project's source code only.