Deviant is built on top of Auxon's Modality database and uses many of the same concepts. These are described in detail in the Modality documentation (opens new window).
A mutation is a concrete attempt to change something about the system under test. Mutations come with zero or more parameters that define the exact changes to the system that should be made.
For example, if you wanted to see how your system performs under certain environmental conditions, you could have a mutation which changes the value reported by a temperature sensor. That mutation's parameters could be set to reflect the exact Fahrenheit/Celsius degree value you are interested in.
Mutations are created by users via Deviant, which then pushes the mutation to the appropriate mutator via its mutation-plane protocol.
The main way to create mutations is via Deviant's CLI:
$ deviant mutation create --params 'temp=42' --params 'bar="extra"' \ --mutator-id='ed109c30-a5e8-488e-868d-ae2800b4d628'
While mutations can be any interesting change to the system under test, it may be useful to think of them as equivalent to "faults" from a traditional fault-injection testing perspective.
Each mutation is defined in terms of a single, specific, mutator.
A mutator is a well-described mutation actuator. It is responsible for enacting mutations and making them real. Each mutator declares the bounds of mutations that it is capable of injecting.
Every mutator is defined by its metadata attributes, much like modality events (opens new window). These attributes are key-value pairs responsible for describing what kind of change to the system the mutator can cause, as well as where the mutator resides relative to the rest of the system under test.
Attribute keys are strings. Keys have a hierarchical namespace where each
segment is separated by the
. character. Attribute values can be of a number
of types: strings, numbers, etc.
Some example mutator attribute keys and values might be:
mutator.name= "message bus delayer"
mutator.description= "Introduce delivery delay to some messages passing through the bus"
If a mutator has any parameters available for its mutations, the mutator's attributes also describe the expected parameters and their data types.
mutator.params.delay.description= "the amount of time to delay messages"
mutator.params.route.description= "which bus route to target"
See the tutorials for examples of how to use a premade mutators or host your own custom mutator.
# Mutator Server
Deviant applies mutations by way of requests sent to a mutation server; a long-running process which provides an implementation of the Mutator HTTP API for describing and operating one or more mutators.
Mutator servers can either be directly integrated into your system, for cases where internal system access is required to perform the mutation; or exist standalone, for cases where internal system access is not needed, such as when mutations are performed via external facing API calls.
This API is then used by Auxon's
modality-reflector (opens new window)
relay process to connect deviant, by way of
modalityd, to a given mutator
Mutator servers that are integrated within a system can be used by configuring
modality-reflector instance with the mutator server's HTTP API URL, which
will query the server for mutators and make them available within Deviant.
Alternatively, mutator servers that are able to operate from outside a system
may be structured to operate as a
modality-reflector plugin for convenience.
Plugins are hosted by the reflector, running as a subprocess and provided
with structured configuration.
An experiment is an organizing mechanism for grouping and guiding mutations. Every experiment has a unique name, and may optionally have extra metadata that controls the sorts of mutations suggested within that experiment.
Most experiments will specify a "mutator filter," a logical expression that specifies which mutators shall be used for this experiment. This filter is described using the SpeQTr event predicate (opens new window) syntax:
$ deviant experiment create my-chaos-experiment \ --mutator-filter '_.group = "foo" AND _.mycorp.safe_for_prod = true'
Having created an experiment, you can ask Deviant to suggest or directly create mutations for it.
$ deviant mutation create --params 'set_to_value=42' \ --experiment my-chaos-experiment
After your experimentation, you can ask about the experiment's effects on the system under test using Deviant's CLI and characterization JupyterLab notebooks.