From 076cb2ac1a34bbd53f706e28cf7d28df700050e6 Mon Sep 17 00:00:00 2001 From: Markus Schirp Date: Thu, 1 Feb 2024 02:15:35 +0000 Subject: [PATCH] Change to efficiency reporting --- Changelog.md | 7 +++++++ docs/mutant-minitest.md | 4 ++-- docs/mutant-rspec.md | 4 ++-- lib/mutant/reporter/cli/printer/env_progress.rb | 7 +++---- lib/mutant/reporter/cli/printer/status_progressive.rb | 1 - lib/mutant/result.rb | 11 ----------- .../mutant/reporter/cli/printer/env_progress_spec.rb | 6 +++--- .../mutant/reporter/cli/printer/env_result_spec.rb | 2 +- spec/unit/mutant/reporter/cli_spec.rb | 2 +- spec/unit/mutant/result_spec.rb | 8 -------- 10 files changed, 19 insertions(+), 33 deletions(-) diff --git a/Changelog.md b/Changelog.md index efd9869fb..0f84f68d1 100644 --- a/Changelog.md +++ b/Changelog.md @@ -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) diff --git a/docs/mutant-minitest.md b/docs/mutant-minitest.md index 98dd0619b..c3bf24b39 100644 --- a/docs/mutant-minitest.md +++ b/docs/mutant-minitest.md @@ -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% ``` @@ -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% ``` diff --git a/docs/mutant-rspec.md b/docs/mutant-rspec.md index f9ee669c0..24191f1ac 100644 --- a/docs/mutant-rspec.md +++ b/docs/mutant-rspec.md @@ -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% ``` @@ -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% ``` diff --git a/lib/mutant/reporter/cli/printer/env_progress.rb b/lib/mutant/reporter/cli/printer/env_progress.rb index a3e8bf804..d4e3d9cdc 100644 --- a/lib/mutant/reporter/cli/printer/env_progress.rb +++ b/lib/mutant/reporter/cli/printer/env_progress.rb @@ -14,7 +14,6 @@ class EnvProgress < self :coverage, :env, :killtime, - :overhead, :runtime ) @@ -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) @@ -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 diff --git a/lib/mutant/reporter/cli/printer/status_progressive.rb b/lib/mutant/reporter/cli/printer/status_progressive.rb index 862d4a7e5..465f34931 100644 --- a/lib/mutant/reporter/cli/printer/status_progressive.rb +++ b/lib/mutant/reporter/cli/printer/status_progressive.rb @@ -14,7 +14,6 @@ class StatusProgressive < self :amount_mutations_alive, :amount_mutations_killed, :killtime, - :overhead, :runtime ) diff --git a/lib/mutant/result.rb b/lib/mutant/result.rb index f701210fa..b6dd11dd9 100644 --- a/lib/mutant/result.rb +++ b/lib/mutant/result.rb @@ -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 diff --git a/spec/unit/mutant/reporter/cli/printer/env_progress_spec.rb b/spec/unit/mutant/reporter/cli/printer/env_progress_spec.rb index 449b89544..a66a26b0a 100644 --- a/spec/unit/mutant/reporter/cli/printer/env_progress_spec.rb +++ b/spec/unit/mutant/reporter/cli/printer/env_progress_spec.rb @@ -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 @@ -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 @@ -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 diff --git a/spec/unit/mutant/reporter/cli/printer/env_result_spec.rb b/spec/unit/mutant/reporter/cli/printer/env_result_spec.rb index 4ae5cb73e..28ca9e72a 100644 --- a/spec/unit/mutant/reporter/cli/printer/env_result_spec.rb +++ b/spec/unit/mutant/reporter/cli/printer/env_result_spec.rb @@ -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 diff --git a/spec/unit/mutant/reporter/cli_spec.rb b/spec/unit/mutant/reporter/cli_spec.rb index 0714456a5..e34a6d493 100644 --- a/spec/unit/mutant/reporter/cli_spec.rb +++ b/spec/unit/mutant/reporter/cli_spec.rb @@ -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 diff --git a/spec/unit/mutant/result_spec.rb b/spec/unit/mutant/result_spec.rb index 4039711f3..a1b6f8eab 100644 --- a/spec/unit/mutant/result_spec.rb +++ b/spec/unit/mutant/result_spec.rb @@ -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