Search in sources :

Example 6 with CompareData

use of de.dagere.peass.measurement.statistics.bimodal.CompareData in project peass by DaGeRe.

the class TestBimodalChange method testIsBimodalChange.

@Test
public void testIsBimodalChange() {
    List<Result> before = BimodalTestUtil.buildValues(50, 100);
    List<Result> after = BimodalTestUtil.buildValues(51, 101);
    CompareData data = new CompareData(before, after);
    final BimodalityTester tester = new BimodalityTester(data);
    Assert.assertTrue(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 7 with CompareData

use of de.dagere.peass.measurement.statistics.bimodal.CompareData in project peass by DaGeRe.

the class TestDifferentStatisticTests method testBimodalExample.

@Test
public void testBimodalExample() {
    final CallTreeNode node = new CallTreeNode("de.mypackage.Test#callMethod", "public void de.mypackage.Test.callMethod()", "public void de.mypackage.Test.callMethod()", TestCallTreeStatistics.CONFIG);
    final CallTreeNode otherVersionNode = new CallTreeNode("de.mypackage.Test#callMethod", "public void de.mypackage.Test.callMethod()", "public void de.mypackage.Test.callMethod()", TestCallTreeStatistics.CONFIG);
    node.setOtherVersionNode(otherVersionNode);
    buildBimodalMeasurementValues(node);
    CompareData cd = node.getComparableStatistics("A", "B");
    TestCallTreeStatistics.CONFIG.getStatisticsConfig().setStatisticTest(ImplementedTests.AGNOSTIC_T_TEST);
    Relation relationAgnostic = StatisticUtil.isDifferent(cd, TestCallTreeStatistics.CONFIG.getStatisticsConfig());
    Assert.assertEquals(Relation.UNKOWN, relationAgnostic);
    TestCallTreeStatistics.CONFIG.getStatisticsConfig().setStatisticTest(ImplementedTests.T_TEST);
    Relation relationTTest = StatisticUtil.isDifferent(cd, TestCallTreeStatistics.CONFIG.getStatisticsConfig());
    Assert.assertEquals(Relation.EQUAL, relationTTest);
    TestCallTreeStatistics.CONFIG.getStatisticsConfig().setStatisticTest(ImplementedTests.BIMODAL_T_TEST);
    Relation relation = StatisticUtil.isDifferent(cd, TestCallTreeStatistics.CONFIG.getStatisticsConfig());
    Assert.assertEquals(Relation.LESS_THAN, relation);
    TestCallTreeStatistics.CONFIG.getStatisticsConfig().setStatisticTest(ImplementedTests.MANN_WHITNEY_TEST);
    Relation relationMannWhitney = StatisticUtil.isDifferent(cd, TestCallTreeStatistics.CONFIG.getStatisticsConfig());
    Assert.assertEquals(Relation.LESS_THAN, relationMannWhitney);
    TestCallTreeStatistics.CONFIG.getStatisticsConfig().setStatisticTest(ImplementedTests.CONFIDENCE_INTERVAL);
    Relation relationConfidence = StatisticUtil.isDifferent(cd, TestCallTreeStatistics.CONFIG.getStatisticsConfig());
    Assert.assertEquals(Relation.EQUAL, relationConfidence);
}
Also used : CompareData(de.dagere.peass.measurement.statistics.bimodal.CompareData) Relation(de.dagere.peass.measurement.statistics.Relation) Test(org.junit.jupiter.api.Test)

Example 8 with CompareData

use of de.dagere.peass.measurement.statistics.bimodal.CompareData in project peass by DaGeRe.

the class StatisticUtil method isBimodal.

public static boolean isBimodal(final List<Result> valuesPrev, final List<Result> valuesVersion) {
    CompareData data = new CompareData(valuesPrev, valuesVersion);
    final BimodalityTester tester = new BimodalityTester(data);
    return tester.isBimodal();
}
Also used : CompareData(de.dagere.peass.measurement.statistics.bimodal.CompareData) BimodalityTester(de.dagere.peass.measurement.statistics.bimodal.BimodalityTester)

Example 9 with CompareData

use of de.dagere.peass.measurement.statistics.bimodal.CompareData in project peass by DaGeRe.

the class DifferentNodeDeterminer method calculateNodeDifference.

private void calculateNodeDifference(final CallTreeNode currentPredecessorNode, final CompareData cd) {
    if (cd.getBeforeStat() == null || cd.getAfterStat() == null) {
        LOG.debug("Statistics is null, is different: {} vs {}", cd.getBeforeStat(), cd.getAfterStat());
        levelDifferentPrecessor.add(currentPredecessorNode);
    } else {
        final CompareData cleaned = removeOutliers(cd);
        printComparisonInfos(currentPredecessorNode, cleaned.getBeforeStat(), cleaned.getAfterStat());
        checkNodeDiffering(currentPredecessorNode, cleaned);
    }
}
Also used : CompareData(de.dagere.peass.measurement.statistics.bimodal.CompareData)

Example 10 with CompareData

use of de.dagere.peass.measurement.statistics.bimodal.CompareData in project peass by DaGeRe.

the class DifferentNodeDeterminer method calculateDiffering.

public void calculateDiffering() {
    final Iterator<CallTreeNode> predecessorIterator = measurePredecessor.iterator();
    for (; predecessorIterator.hasNext(); ) {
        final CallTreeNode currentPredecessorNode = predecessorIterator.next();
        CompareData cd = currentPredecessorNode.getComparableStatistics(measurementConfig.getExecutionConfig().getVersionOld(), measurementConfig.getExecutionConfig().getVersion());
        calculateNodeDifference(currentPredecessorNode, cd);
    }
}
Also used : CompareData(de.dagere.peass.measurement.statistics.bimodal.CompareData) CallTreeNode(de.dagere.peass.measurement.rca.data.CallTreeNode)

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