PropertyDamage.Mutation.Report (PropertyDamage v0.2.0)
View SourceReport structure for mutation testing results.
The report aggregates results from running mutations and provides statistics about test effectiveness.
Fields
mutation_score- Ratio of killed to total mutations (0.0 to 1.0)killed- Number of mutations that were caught by testssurvived- Number of mutations that tests failed to catchtimeout- Number of mutations that timed outtotal- Total number of mutations testedby_command- Breakdown by command typeby_operator- Breakdown by mutation operatorsurvived_mutations- Details of mutations that survivedkilled_mutations- Details of mutations that were killedduration_ms- Total time takenstarted_at- When testing startedcompleted_at- When testing completed
Summary
Functions
Finalizes the report with timing information.
Creates a new empty report.
Checks if the report passes the target score.
Records a mutation result in the report.
Returns commands sorted by kill rate (weakest first).
Returns operators sorted by kill rate (weakest first).
Types
@type command_stats() :: %{ killed: non_neg_integer(), survived: non_neg_integer(), timeout: non_neg_integer(), total: non_neg_integer(), score: float() }
@type mutation_result() :: %{ mutation: map(), command: module(), operator: atom(), result: :killed | :survived | :timeout, failure_message: String.t() | nil, duration_ms: non_neg_integer() }
@type t() :: %PropertyDamage.Mutation.Report{ adapter: module() | nil, by_command: %{required(module()) => command_stats()}, by_operator: %{required(atom()) => command_stats()}, completed_at: DateTime.t() | nil, duration_ms: non_neg_integer(), killed: non_neg_integer(), killed_mutations: [mutation_result()], model: module() | nil, mutation_score: float(), started_at: DateTime.t() | nil, survived: non_neg_integer(), survived_mutations: [mutation_result()], target_score: float(), timeout: non_neg_integer(), total: non_neg_integer() }
Functions
@spec finalize(t(), DateTime.t(), DateTime.t()) :: t()
Finalizes the report with timing information.
Creates a new empty report.
Checks if the report passes the target score.
@spec record_result(t(), mutation_result()) :: t()
Records a mutation result in the report.
@spec weakest_commands(t()) :: [{module(), command_stats()}]
Returns commands sorted by kill rate (weakest first).
@spec weakest_operators(t()) :: [{atom(), command_stats()}]
Returns operators sorted by kill rate (weakest first).