use of de.dagere.peass.measurement.statistics.bimodal.CompareData in project peass by DaGeRe.
the class ChangeReader method getIsChange.
public void getIsChange(final String fileName, final Kopemedata data, final ProjectChanges changeKnowledge, final ProjectStatistics info, final String[] versions, final DescribedChunk describedChunk) {
LOG.debug(data.getTestcases().getClazz());
final TestcaseStatistic statistic = describedChunk.getStatistic(config);
statistic.setPredecessor(versions[0]);
// if (! (statistic.getTvalue() == Double.NaN)){
CompareData cd = new CompareData(describedChunk.getPrevious(), describedChunk.getCurrent());
final Relation confidenceResult = ConfidenceIntervalInterpretion.compare(cd);
final TestCase testcase = getTestcase(data, versions, describedChunk);
final double diff = describedChunk.getDiff();
final boolean isBigEnoughDiff = Math.abs(diff) > minChange;
allData.addStatistic(versions[1], testcase, fileName, statistic, statistic.isChange() && isBigEnoughDiff, !confidenceResult.equals(Relation.EQUAL));
if (statistic.isChange() && isBigEnoughDiff) {
changeKnowledge.addChange(testcase, versions[1], confidenceResult, statistic.isChange() ? Relation.GREATER_THAN : Relation.EQUAL, describedChunk.getDescPrevious().getMean(), diff, statistic.getTvalue(), statistic.getVMs());
writeRunCommands(versions, describedChunk, testcase);
}
info.addMeasurement(versions[1], testcase, statistic);
}
use of de.dagere.peass.measurement.statistics.bimodal.CompareData in project peass by DaGeRe.
the class TestBimodalChange method testIsUnimodalChange.
@Test
public void testIsUnimodalChange() {
List<Result> before = BimodalTestUtil.buildValues(50, 50);
List<Result> after = BimodalTestUtil.buildValues(51, 51.5);
CompareData data = new CompareData(before, after);
final BimodalityTester tester = new BimodalityTester(data);
Assert.assertFalse(tester.isBimodal());
Assert.assertTrue(tester.isTChange(0.001));
}
use of de.dagere.peass.measurement.statistics.bimodal.CompareData in project peass by DaGeRe.
the class TestBimodalChange method testIsUnimodalEqual.
@Test
public void testIsUnimodalEqual() {
List<Result> before = BimodalTestUtil.buildValues(50, 50);
List<Result> after = BimodalTestUtil.buildValues(50, 50.001);
CompareData data = new CompareData(before, after);
final BimodalityTester tester = new BimodalityTester(data);
Assert.assertFalse(tester.isBimodal());
Assert.assertFalse(tester.isTChange(0.001));
}
use of de.dagere.peass.measurement.statistics.bimodal.CompareData in project peass by DaGeRe.
the class NodePreparator method setColorFullStatistics.
private void setColorFullStatistics(final MeasuredNode measuredNode, final GraphNode graphNode, final StatisticalSummary statisticsOld, final StatisticalSummary statisticsCurrent) {
if (measuredNode.getStatistic().getMeanCurrent() > 0.001 && measuredNode.getStatistic().getMeanOld() > 0.001) {
CompareData cd = new CompareData(measuredNode.getValuesPredecessor().getValuesArray(), measuredNode.getValues().getValuesArray());
MeasurementConfig measurementConfig = new MeasurementConfig(-1);
boolean isChange = StatisticUtil.isDifferent(cd, measurementConfig.getStatisticsConfig()) != Relation.EQUAL;
// final boolean isChange = StatisticUtil.isChange(statisticsOld, statisticsCurrent, data.getMeasurementConfig()) == Relation.UNEQUAL;
if (isChange) {
if (measuredNode.getStatistic().getTvalue() < 0) {
graphNode.setSlower();
} else {
graphNode.setFaster();
}
}
} else if (Double.isNaN(statisticsOld.getMean()) && !Double.isNaN(statisticsCurrent.getMean())) {
graphNode.setSlower();
} else if (!Double.isNaN(statisticsOld.getMean()) && Double.isNaN(statisticsCurrent.getMean())) {
graphNode.setFaster();
} else {
graphNode.setColor("#FFFFFF");
graphNode.getStatistic().setChange(false);
}
}
use of de.dagere.peass.measurement.statistics.bimodal.CompareData in project peass by DaGeRe.
the class TestBimodalChange method testIsBimodalEqual.
@Test
public void testIsBimodalEqual() {
List<Result> before = BimodalTestUtil.buildValues(50, 100);
List<Result> after = BimodalTestUtil.buildValues(50, 100.5);
CompareData data = new CompareData(before, after);
final BimodalityTester tester = new BimodalityTester(data);
Assert.assertTrue(tester.isBimodal());
Assert.assertFalse(tester.isTChange(0.001));
}
Aggregations