Juggernaut (Juggernaut v0.4.0)

Copy Markdown View Source

Fast mutation testing for Elixir.

Most people run it through mix juggernaut and its sibling tasks. The same runs are available as functions: run/1 runs mutation testing and returns the finished Juggernaut.Run; check/2 runs named mutants of the latest scored run again. Both take the request Juggernaut.Engine.run/1 documents (the project :root, its loaded :config, and so on) and return {:error, Juggernaut.Error.t()} instead of a verdict when the run cannot happen.

Module docs cite sections of the design notes as "design notes §N": they are docs/DESIGN.md in the repository.

Summary

Functions

Runs the mutants named by ids again now (Juggernaut.Engine.check/1).

The identity of Juggernaut's code: SHA-256 over the MD5 of each of its modules. It changes with any change to Juggernaut's code, where version/0 changes only with a release, so what is keyed on it (the result cache, through the config fingerprint) is never reused across a fix that kept the version. A run computes it once, when it loads its config.

Runs mutation testing (Juggernaut.Engine.run/1).

The version of Juggernaut, as a string.

Functions

check(ids, request)

@spec check([String.t()], Juggernaut.Engine.request()) ::
  {:ok, %{mutants: [Juggernaut.Mutant.t()], results: map()}}
  | {:error, Juggernaut.Error.t()}

Runs the mutants named by ids again now (Juggernaut.Engine.check/1).

code_id()

@spec code_id() :: String.t()

The identity of Juggernaut's code: SHA-256 over the MD5 of each of its modules. It changes with any change to Juggernaut's code, where version/0 changes only with a release, so what is keyed on it (the result cache, through the config fingerprint) is never reused across a fix that kept the version. A run computes it once, when it loads its config.

run(request)

@spec run(Juggernaut.Engine.request()) ::
  {:ok, Juggernaut.Run.t()} | {:error, Juggernaut.Error.t()}

Runs mutation testing (Juggernaut.Engine.run/1).

version()

@spec version() :: String.t()

The version of Juggernaut, as a string.