Merge pull request #772 from mbj/add/nomenclature-readme

Add nomenclature section to readme
This commit is contained in:
Martin Gamsjaeger 2018-11-20 15:57:09 +01:00 committed by GitHub
commit ddbbf05f86
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -17,15 +17,88 @@ Mutant supports ruby >= 2.5, MRI only.
Mutant uses a pure Ruby [parser](https://github.com/whitequark/parser) and an [unparser](https://github.com/mbj/unparser) Mutant uses a pure Ruby [parser](https://github.com/whitequark/parser) and an [unparser](https://github.com/mbj/unparser)
to do its magic. to do its magic.
Installation Nomenclature
------------ ------------
As mutant right now only supports rspec, install the gem `mutant-rspec` via your preferred method. The following explains several nouns you may experience in mutant's documentation.
It'll pull the `mutant` gem (in the correct version), that contains the main engine. It's a good idea to familiarize yourself before moving on.
```ruby ### AST
gem install mutant-rspec
``` Acronym for [Abstract Syntax Tree](https://en.wikipedia.org/wiki/Abstract_syntax_tree)
and the level of abstraction mutant operates on.
### Subject
An addressable piece of code to be targeted for mutation testing.
Mutant currently supports the following subjects:
* Instance methods
* Singleton (class) methods
Other subjects (constants, class bodies for DSLs, ...) are possible but aren't
implemented in the OSS version.
### Mutation operator
A transformation applied to the AST of a subject. Mutant knows the following high level operator
classes:
* Semantic Reduction
* Orthogonal Replacement
* [Noop](#neutral-noop-tests)
An exhaustive list can be found in the [mutant-meta](https://github.com/mbj/mutant/tree/master/meta)
subdirectory of the source.
### Mutation
The result of applying a mutation operator to the AST of a subject. A mutation represents a
hypothesis that ideally gets falsified by the tests.
### Insertion
The process of inserting a mutation into the runtime environment.
Mutant currently supports insertion via dynamically created monkeypatches.
Other insertion strategies (such as "boot time") are possible but aren't implemented
in the OSS version.
### Isolation
The attempt to isolate the (side) effects of killing a mutation via an integration
to prevent a mutation leaking into adjacent concurrent, or future mutations.
Examples of sources for leaks are
* Global variable writes
* Thread local writes
* DB State
* File system
Natively, mutant offers fork isolation. This works for any state within the executing
Ruby process. For all state reachable via IO, it's the test author's responsibility to
provide proper isolation.
### Integration
The method used to determine if a specific inserted mutation is covered by tests.
Currently mutant supports integrations for:
* rspec (https://rubygems.org/gems/mutant-rspec)
* minitest (https://rubygems.org/gems/mutant-minitest)
### Report
Mutant currently provides two different reporters:
* Progress (printed during mutation testing).
* Summary (printed at the end of a finished analysis run)
A reporter producing a machine readable report does not exist in the OSS version
at the time of writing this documentation.
Examples Examples
-------- --------