use of de.dagere.peass.measurement.statistics.data.TestcaseStatistic in project peass by DaGeRe.
the class LevelCauseSearcherTest method testCauseSearching.
@Test
public void testCauseSearching() throws InterruptedException, IOException, IllegalStateException, XmlPullParserException, AnalysisConfigurationException, ViewNotFoundException, JAXBException {
buildRoots();
searchChanges(TestConstants.SIMPLE_CAUSE_CONFIG);
StrategyTestUtil.checkChanges(changes);
final TestcaseStatistic nodeStatistic = data.getNodes().getStatistic();
final double expectedT = new TTest().t(nodeStatistic.getStatisticsOld(), nodeStatistic.getStatisticsCurrent());
Assert.assertEquals(expectedT, nodeStatistic.getTvalue(), 0.01);
}
use of de.dagere.peass.measurement.statistics.data.TestcaseStatistic in project peass by DaGeRe.
the class LevelCauseSearcherTest method testWarmup.
@Test
public void testWarmup() throws InterruptedException, IOException, IllegalStateException, XmlPullParserException, AnalysisConfigurationException, ViewNotFoundException, JAXBException {
measurementConfig = new MeasurementConfig(5, TestConstants.V2, TestConstants.V1);
measurementConfig.setWarmup(500);
measurementConfig.setIterations(5);
builderPredecessor = new TreeBuilder(measurementConfig);
buildRoots();
searchChanges(TestConstants.SIMPLE_CAUSE_CONFIG);
StrategyTestUtil.checkChanges(changes);
final TestcaseStatistic nodeStatistic = data.getNodes().getStatistic();
final double expectedT = new TTest().t(nodeStatistic.getStatisticsOld(), nodeStatistic.getStatisticsCurrent());
System.out.println(nodeStatistic.getMeanCurrent());
System.out.println(expectedT + " " + nodeStatistic.getTvalue());
// Assert.assertEquals(nodeStatistic.getMeanCurrent());
Assert.assertEquals(expectedT, nodeStatistic.getTvalue(), 0.01);
Assert.assertEquals(95, nodeStatistic.getMeanCurrent(), 0.01);
Assert.assertEquals(105, nodeStatistic.getMeanOld(), 0.01);
}
use of de.dagere.peass.measurement.statistics.data.TestcaseStatistic in project peass by DaGeRe.
the class TestNodePreparatorTreeStructure method init.
@BeforeEach
public void init() {
csd.setConfig(new MeasurementConfig(15));
rootNode.setStatistic(new TestcaseStatistic(5.0, 6.0, 0.01, 0.01, 15, -3, true, 10, 10));
csd.setNodes(rootNode);
}
use of de.dagere.peass.measurement.statistics.data.TestcaseStatistic in project peass by DaGeRe.
the class TestNodePreparatorTreeStructure method testColorSettingAdded.
@Test
public void testColorSettingAdded() {
final MeasuredNode childNode = new MeasuredNode("Call#myMethod", "public void Call.myMethod()", null);
childNode.setStatistic(new TestcaseStatistic(Double.NaN, 6.0, Double.NaN, 0.01, 15, -3, true, 0, 10));
rootNode.getChildren().add(childNode);
csd.setNodes(rootNode);
NodePreparator preparator = new NodePreparator(csd);
preparator.prepare();
GraphNode root = preparator.getRootNode();
Assert.assertEquals(NodePreparator.COLOR_SLOWER, root.getColor());
Assert.assertEquals(NodePreparator.COLOR_FASTER, root.getChildren().get(0).getColor());
}
use of de.dagere.peass.measurement.statistics.data.TestcaseStatistic in project peass by DaGeRe.
the class CallTreeNode method getPartialTestcaseStatistic.
@JsonIgnore
public TestcaseStatistic getPartialTestcaseStatistic() {
final CallTreeStatistics currentVersionStatistics = data.get(config.getExecutionConfig().getVersion());
final SummaryStatistics current = currentVersionStatistics.getStatistics();
final CallTreeStatistics previousVersionStatistics = data.get(config.getExecutionConfig().getVersionOld());
final SummaryStatistics previous = previousVersionStatistics.getStatistics();
if (firstHasValues(current, previous)) {
final TestcaseStatistic testcaseStatistic = new TestcaseStatistic(previous, current, 0, currentVersionStatistics.getCalls());
testcaseStatistic.setChange(true);
return testcaseStatistic;
} else if (firstHasValues(previous, current)) {
final TestcaseStatistic testcaseStatistic = new TestcaseStatistic(previous, current, previousVersionStatistics.getCalls(), 0);
testcaseStatistic.setChange(true);
return testcaseStatistic;
} else if ((current == null || current.getN() == 0) && (previous == null || previous.getN() == 0)) {
LOG.error("Could not measure {}", this);
final TestcaseStatistic testcaseStatistic = new TestcaseStatistic(previous, current, 0, 0);
testcaseStatistic.setChange(true);
return testcaseStatistic;
} else {
throw new RuntimeException("Partial statistics should exactly be created if one node is unmeasurable");
}
}
Aggregations