Skip to content

Commit

Permalink
Change to efficiency reporting
Browse files Browse the repository at this point in the history
  • Loading branch information
mbj committed Feb 1, 2024
1 parent a46ff1c commit db621b6
Show file tree
Hide file tree
Showing 7 changed files with 13 additions and 28 deletions.
5 changes: 5 additions & 0 deletions Changelog.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,8 @@
# v0.11.28

* Change to report efficiency instead of overhead.
Efficiency is defined by `killtime / runtime`.

# v0.11.27 2023-12-01

* [#1414](https://github.com/mbj/mutant/pull/1414)
Expand Down
7 changes: 3 additions & 4 deletions lib/mutant/reporter/cli/printer/env_progress.rb
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,6 @@ class EnvProgress < self
:coverage,
:env,
:killtime,
:overhead,
:runtime
)

Expand All @@ -25,7 +24,7 @@ class EnvProgress < self
[:info, 'Timeouts: %s', :amount_timeouts ],
[:info, 'Runtime: %0.2fs', :runtime ],
[:info, 'Killtime: %0.2fs', :killtime ],
[:info, 'Overhead: %0.2f%%', :overhead_percent ],
[:info, 'Efficiency: %0.2f%%', :efficiency_percent ],
[:info, 'Mutations/s: %0.2f', :mutations_per_second ],
[:status, 'Coverage: %0.2f%%', :coverage_percent ]
].each(&:freeze)
Expand All @@ -50,8 +49,8 @@ def coverage_percent
coverage * 100
end

def overhead_percent
(overhead / killtime) * 100
def efficiency_percent
(killtime / runtime) * 100
end
end # EnvProgress
end # Printer
Expand Down
11 changes: 0 additions & 11 deletions lib/mutant/result.rb
Original file line number Diff line number Diff line change
Expand Up @@ -50,17 +50,6 @@ def delegate(name, target)

private_constant(*constants(false))

# Mutant overhead running mutatet tests
#
# This is NOT the overhead of mutation testing, just an engine specific
# measurement for the efficiency of the parallelization engine, kill
# isolation etc.
#
# @return [Float]
def overhead
runtime - killtime
end

# Hook called when module gets included
#
# @param [Class, Module] host
Expand Down
6 changes: 3 additions & 3 deletions spec/unit/mutant/reporter/cli/printer/env_progress_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@
Timeouts: 0
Runtime: 4.00s
Killtime: 0.00s
Overhead: Inf%
Efficiency: 0.00%
Mutations/s: 0.00
Coverage: 100.00%
STR
Expand All @@ -56,7 +56,7 @@
Timeouts: 0
Runtime: 4.00s
Killtime: 2.00s
Overhead: 100.00%
Efficiency: 50.00%
Mutations/s: 0.50
Coverage: 100.00%
STR
Expand Down Expand Up @@ -85,7 +85,7 @@
Timeouts: 0
Runtime: 4.00s
Killtime: 2.00s
Overhead: 100.00%
Efficiency: 50.00%
Mutations/s: 0.50
Coverage: 50.00%
STR
Expand Down
2 changes: 1 addition & 1 deletion spec/unit/mutant/reporter/cli/printer/env_result_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@
Timeouts: 0
Runtime: 4.00s
Killtime: 2.00s
Overhead: 100.00%
Efficiency: 50.00%
Mutations/s: 0.50
Coverage: 50.00%
STR
Expand Down
2 changes: 1 addition & 1 deletion spec/unit/mutant/reporter/cli_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -99,7 +99,7 @@ def self.it_reports(expected_content)
Timeouts: 0
Runtime: 4.00s
Killtime: 2.00s
Overhead: 100.00%
Efficiency: 50.00%
Mutations/s: 0.50
Coverage: 100.00%
REPORT
Expand Down
8 changes: 0 additions & 8 deletions spec/unit/mutant/result_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -22,12 +22,4 @@ def collection
expect(object.length).to be(1)
end
end

describe '#overhead' do
subject { object.overhead }

it 'returns difference between runtime and killtime' do
should eql(2.0)
end
end
end

0 comments on commit db621b6

Please sign in to comment.