Search in sources :

Example 1 with CompareData

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);
}
Also used : TestcaseStatistic(de.dagere.peass.measurement.statistics.data.TestcaseStatistic) CompareData(de.dagere.peass.measurement.statistics.bimodal.CompareData) Relation(de.dagere.peass.measurement.statistics.Relation) TestCase(de.dagere.peass.dependency.analysis.data.TestCase)

Example 2 with CompareData

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));
}
Also used : CompareData(de.dagere.peass.measurement.statistics.bimodal.CompareData) Result(de.dagere.kopeme.generated.Result) BimodalityTester(de.dagere.peass.measurement.statistics.bimodal.BimodalityTester) Test(org.junit.Test)

Example 3 with CompareData

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));
}
Also used : CompareData(de.dagere.peass.measurement.statistics.bimodal.CompareData) Result(de.dagere.kopeme.generated.Result) BimodalityTester(de.dagere.peass.measurement.statistics.bimodal.BimodalityTester) Test(org.junit.Test)

Example 4 with CompareData

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);
    }
}
Also used : MeasurementConfig(de.dagere.peass.config.MeasurementConfig) CompareData(de.dagere.peass.measurement.statistics.bimodal.CompareData)

Example 5 with CompareData

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));
}
Also used : CompareData(de.dagere.peass.measurement.statistics.bimodal.CompareData) Result(de.dagere.kopeme.generated.Result) BimodalityTester(de.dagere.peass.measurement.statistics.bimodal.BimodalityTester) Test(org.junit.Test)

Aggregations

CompareData (de.dagere.peass.measurement.statistics.bimodal.CompareData)11 BimodalityTester (de.dagere.peass.measurement.statistics.bimodal.BimodalityTester)5 Result (de.dagere.kopeme.generated.Result)4 Test (org.junit.Test)4 Relation (de.dagere.peass.measurement.statistics.Relation)2 MeasurementConfig (de.dagere.peass.config.MeasurementConfig)1 TestCase (de.dagere.peass.dependency.analysis.data.TestCase)1 CallTreeNode (de.dagere.peass.measurement.rca.data.CallTreeNode)1 TestcaseStatistic (de.dagere.peass.measurement.statistics.data.TestcaseStatistic)1 Test (org.junit.jupiter.api.Test)1