Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Change to efficiency reporting #1415

Merged
merged 1 commit into from
Feb 1, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 7 additions & 0 deletions Changelog.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,10 @@
# v0.11.28

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

[#1415](https://github.com/mbj/mutant/pull/1415)

# v0.11.27 2023-12-01

* [#1414](https://github.com/mbj/mutant/pull/1414)
Expand Down
4 changes: 2 additions & 2 deletions docs/mutant-minitest.md
Original file line number Diff line number Diff line change
Expand Up @@ -77,7 +77,7 @@ Kills: 1003
Alive: 0
Runtime: 9.68s
Killtime: 3.80s
Overhead: 154.30%
Efficiency: 39.25%
Mutations/s: 103.67
Coverage: 100.00%
```
Expand Down Expand Up @@ -140,7 +140,7 @@ Kills: 1008
Alive: 1
Runtime: 9.38s
Killtime: 3.47s
Overhead: 170.06%
Efficiency: 39.25%
Mutations/s: 107.60
Coverage: 99.90%
```
Expand Down
4 changes: 2 additions & 2 deletions docs/mutant-rspec.md
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ Kills: 1003
Alive: 0
Runtime: 51.52s
Killtime: 200.13s
Overhead: -74.26%
Efficiency: 388.45%
Mutations/s: 19.47
Coverage: 100.00%
```
Expand Down Expand Up @@ -101,7 +101,7 @@ Kills: 1008
Alive: 1
Runtime: 50.93s
Killtime: 190.09s
Overhead: -73.21%
Efficiency: 388.45%
Mutations/s: 19.81
Coverage: 99.90%
```
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
1 change: 0 additions & 1 deletion lib/mutant/reporter/cli/printer/status_progressive.rb
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,6 @@ class StatusProgressive < self
:amount_mutations_alive,
:amount_mutations_killed,
:killtime,
:overhead,
:runtime
)

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
Loading