mutationtesting

Type members

Classlikes

final case class BrandingInformation(homepageUrl: String, imageUrl: Option[String])

Extra branding information about the framework used.

Extra branding information about the framework used.

Value parameters:
homepageUrl

URL to the homepage of the framework.

imageUrl

URL to an image for the framework, can be a data URL.

final case class CpuInformation(logicalCores: Int, baseClock: Option[Long], model: Option[String])
Value parameters:
baseClock

Clock speed in MHz

sealed trait DirOps extends MetricsResult
sealed trait FileOps extends MetricsResult
final case class FileResult(source: String, mutants: Seq[MutantResult], language: String)

Mutated file

Mutated file

Value parameters:
language

Programming language that is used. Used for code highlighting, see https://prismjs.com/#examples.

mutants

All mutants in this file.

source

Full source code of the mutated file, this is used for highlighting.

final case class FrameworkInformation(name: String, version: Option[String], branding: Option[BrandingInformation], dependencies: Option[Dependencies])

Extra information about the framework used

Extra information about the framework used

Value parameters:
branding

Extra branding information about the framework used.

dependencies

Dependencies used by the framework. Key-value pair of dependencies and their versions.

name

Name of the framework used.

version

Version of the framework used.

final case class Location(start: Position, end: Position)

A location with start and end. Start is inclusive, end is exclusive.

A location with start and end. Start is inclusive, end is exclusive.

Value parameters:
end

End location (exclusive).

start

Starting location (inclusive).

final case class MetricMutant(status: MutantStatus)
object Metrics
final case class MetricsDirectory(dirName: String, files: Iterable[MetricsResult]) extends MetricsResult with DirOps
final case class MetricsFile(fileName: String, mutants: Iterable[MetricMutant]) extends MetricsResult with FileOps
sealed trait MetricsResult
final case class MetricsResultRoot(files: Iterable[MetricsResult]) extends MetricsResult with DirOps
final case class MutantResult(id: String, mutatorName: String, replacement: String, location: Location, status: MutantStatus, statusReason: Option[String], description: Option[String], coveredBy: Option[Seq[String]], killedBy: Option[Seq[String]], testsCompleted: Option[Int], static: Option[Boolean])

Single mutation.

Single mutation.

Value parameters:
coveredBy

The test ids that covered this mutant. If a mutation testing framework doesn't measure this information, it can simply be left out.

description

Description of the applied mutation.

id

Unique id, can be used to correlate this mutant with other reports.

killedBy

The test ids that killed this mutant. It is a best practice to "bail" on first failing test, in which case you can fill this array with that one test.

location

A location with start and end. Start is inclusive, end is exclusive.

mutatorName

Category of the mutation.

replacement

Actual mutation that has been applied.

static

A static mutant means that it was loaded once at during initialization, this makes it slow or even impossible to test, depending on the mutation testing framework.

status

Result of the mutation.

statusReason

The reason that this mutant has this status. In the case of a killed mutant, this should be filled with the failure message(s) of the failing tests. In case of an error mutant, this should be filled with the error message.

testsCompleted

The number of tests actually completed in order to test this mutant. Can differ from coveredBy because of bailing a mutant test run after first failing test.

sealed trait MutantStatus extends Product with Serializable

Result of the mutation.

Result of the mutation.

Companion:
object
Companion:
class
final case class MutationTestResult[+C]($schema: Option[String], schemaVersion: String, thresholds: Thresholds, projectRoot: Option[String], files: FileResultDictionary, testFiles: Option[TestFileDefinitionDictionary], performance: Option[PerformanceStatistics], framework: Option[FrameworkInformation], system: Option[SystemInformation], config: Option[C])

Schema for a mutation testing report

Schema for a mutation testing report

Type parameters:
C

type of the config object

Value parameters:
$schema

URL to the JSON schema.

config

Free-format object that represents the configuration used to run mutation testing.

files

All mutated files.

framework

Extra information about the framework used.

performance

The performance statistics per phase. Total time should be roughly equal to the sum of all these.

projectRoot

The optional location of the project root.

schemaVersion

Major version of this report. Used for compatibility.

system

Information about the system that performed mutation testing.

testFiles

Test file definitions by file path OR class name.

thresholds

Thresholds for the status of the reported application.

final case class OSInformation(platform: String, description: Option[String], version: Option[String])
Value parameters:
description

Human-readable description of the OS

platform

Platform identifier

version

Version of the OS or distribution

final case class OpenEndLocation(start: Position, end: Option[Position])

A mutationtesting.Location where end is not required. Start is inclusive, end is exclusive.

A mutationtesting.Location where end is not required. Start is inclusive, end is exclusive.

Value parameters:
end

End location (exclusive).

start

Starting location (inclusive).

final case class PerformanceStatistics(setup: Long, initialRun: Long, mutation: Long)

The performance statistics per phase. Total time should be roughly equal to the sum of all these.

The performance statistics per phase. Total time should be roughly equal to the sum of all these.

Value parameters:
initialRun

Time it took to run the initial test phase (dry-run) in milliseconds.

mutation

Time it took to run the mutation test phase in milliseconds.

setup

Time it took to run the setup phase in milliseconds.

final case class Position(line: Int, column: Int)

Position of a mutation. Both line and column start at one.

Position of a mutation. Both line and column start at one.

final case class RamInformation(total: Long)
Value parameters:
total

The total RAM of the system that performed mutation testing in MB. On the JVM, this can be the amount of memory available to the JVM instead of the system memory.

final case class SystemInformation(ci: Boolean, os: Option[OSInformation], cpu: Option[CpuInformation], ram: Option[RamInformation])

Information about the system that performed mutation testing

Information about the system that performed mutation testing

Value parameters:
ci

Did mutation testing run in a Continuous Integration environment (pipeline)? Note that there is no way of knowing this for sure. It's done on a best-effort basis.

final case class TestDefinition(id: String, name: String, location: Option[OpenEndLocation])

A test in your test file.

A test in your test file.

Value parameters:
id

Unique id of the test, used to correlate what test killed a mutant.

location

A mutationtesting.Location where end is not required

name

Name of the test, used to display the test.

final case class TestFile(tests: Seq[TestDefinition], source: Option[String])

A file containing one or more tests

A file containing one or more tests

Value parameters:
source

Full source code of the test file. This can be used to display in the report.

tests

The tests contained in this test file.

final case class Thresholds(high: Int, low: Int)

Thresholds for the status of the reported application.

Thresholds for the status of the reported application.

Suggested method for creating a Thresholds object is by the 'smart' create constructor in the companion object

Value parameters:
high

Higher bound threshold.

low

Lower bound threshold.

Companion:
object
object Thresholds
Companion:
class

Types

type Dependencies = Map[String, String]

Dependencies used by the framework. Key-value pair of dependencies and their versions.

Dependencies used by the framework. Key-value pair of dependencies and their versions.

type FileResultDictionary = Map[String, FileResult]

All mutated files, with the relative path of the file as the key

All mutated files, with the relative path of the file as the key

Test file definitions by file path OR class name.

Test file definitions by file path OR class name.