Class: Rigor::CLI::FileEffectiveness

Inherits:
Data
  • Object
show all
Defined in:
lib/rigor/cli/mutation_protection_report.rb

Overview

ADR-63 Tier 2 — aggregates per-file Protection::MutationScanner results into a project-level effectiveness report: the kill ratio (when a type-visible bug was introduced, how often Rigor caught it), the per-file breakdown, and a ranked "add a type here" list keyed by the method whose breakage Rigor most often missed — the sites where a receiver annotation would buy real catching power.

The framing is load-bearing (ADR-63 Criterion A / ADR-62 Criterion A): the number is effectiveness, the survivors are missed breakages / where to add a type, never "your code is broken". harness_errors (#264) — mutants where the harness itself raised (a rescued failure), distinguished from a parse-invalid mutant. Defaults to 0 so existing call sites keep constructing a FileEffectiveness without the new keyword.

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(path:, killed:, survived:, ratio:, harness_errors: 0) ⇒ FileEffectiveness

Returns a new instance of FileEffectiveness.



16
17
18
# File 'lib/rigor/cli/mutation_protection_report.rb', line 16

def initialize(path:, killed:, survived:, ratio:, harness_errors: 0)
  super
end

Instance Attribute Details

#harness_errorsObject (readonly)

Returns the value of attribute harness_errors

Returns:

  • (Object)

    the current value of harness_errors



15
16
17
# File 'lib/rigor/cli/mutation_protection_report.rb', line 15

def harness_errors
  @harness_errors
end

#killedObject (readonly)

Returns the value of attribute killed

Returns:

  • (Object)

    the current value of killed



15
16
17
# File 'lib/rigor/cli/mutation_protection_report.rb', line 15

def killed
  @killed
end

#pathObject (readonly)

Returns the value of attribute path

Returns:

  • (Object)

    the current value of path



15
16
17
# File 'lib/rigor/cli/mutation_protection_report.rb', line 15

def path
  @path
end

#ratioObject (readonly)

Returns the value of attribute ratio

Returns:

  • (Object)

    the current value of ratio



15
16
17
# File 'lib/rigor/cli/mutation_protection_report.rb', line 15

def ratio
  @ratio
end

#survivedObject (readonly)

Returns the value of attribute survived

Returns:

  • (Object)

    the current value of survived



15
16
17
# File 'lib/rigor/cli/mutation_protection_report.rb', line 15

def survived
  @survived
end