@Test public void downSampledDistributionIsRepresentativeForReasonableData() { MultisetStatistics stats = new MultisetStatistics(); for (double number : LARGE_SAMPLE) { int elements = (int) (10 * PerformanceResults.DOWNSAMPLE_MAXIMUM_SIZE / (Math.abs(PerformanceResults.DOWNSAMPLE_MAXIMUM_SIZE - number) + 1)); stats.addValue(number, elements); } Mockito.when(mockResult.getStatistics()).thenReturn(stats); List<Double> downSampledData = PerformanceResults.getData(mockRunResult); MultisetStatistics downSampledStats = new MultisetStatistics(); for (double number : downSampledData) { downSampledStats.addValue(number, 1); } assertThat(TestUtils.tTest(stats, downSampledStats, 1 - 0.5)).isEqualTo(false); assertThat(TestUtils.homoscedasticTTest(stats, downSampledStats)).isGreaterThan(0.5d); }
@VisibleForTesting static List<Double> getData(RunResult result) { return getRawResults(result.getPrimaryResult().getStatistics()); }
PerformanceResults { @VisibleForTesting static List<Double> getData(RunResult result) { return getRawResults(result.getPrimaryResult().getStatistics()); } }
PerformanceResults { @VisibleForTesting static List<Double> getData(RunResult result) { return getRawResults(result.getPrimaryResult().getStatistics()); } PerformanceResults(Collection<RunResult> results); }
PerformanceResults { @VisibleForTesting static List<Double> getData(RunResult result) { return getRawResults(result.getPrimaryResult().getStatistics()); } PerformanceResults(Collection<RunResult> results); void writeToFile(File file); }
PerformanceResults { @VisibleForTesting static List<Double> getData(RunResult result) { return getRawResults(result.getPrimaryResult().getStatistics()); } PerformanceResults(Collection<RunResult> results); void writeToFile(File file); static final int DOWNSAMPLE_MAXIMUM_SIZE; }