Search in sources :

Example 1 with TestcaseStatistic

use of de.dagere.peass.measurement.statistics.data.TestcaseStatistic 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 TestcaseStatistic

use of de.dagere.peass.measurement.statistics.data.TestcaseStatistic in project peass by DaGeRe.

the class FindLowestIterationsRCA method getMedianTestcaseStatistic.

public TestcaseStatistic getMedianTestcaseStatistic(final int iterations) {
    final SummaryStatistics current = ((FullCallTreeStatistic) data.get(config.getExecutionConfig().getVersion())).getMedianStatistics(iterations);
    final SummaryStatistics previous = ((FullCallTreeStatistic) data.get(config.getExecutionConfig().getVersionOld())).getMedianStatistics(iterations);
    return new TestcaseStatistic(previous, current, data.get(config.getExecutionConfig().getVersionOld()).getCalls(), data.get(config.getExecutionConfig().getVersion()).getCalls());
}
Also used : TestcaseStatistic(de.dagere.peass.measurement.statistics.data.TestcaseStatistic) SummaryStatistics(org.apache.commons.math3.stat.descriptive.SummaryStatistics)

Example 3 with TestcaseStatistic

use of de.dagere.peass.measurement.statistics.data.TestcaseStatistic in project peass by DaGeRe.

the class FindLowestIterationsRCA method getMinTestcaseStatistic.

public TestcaseStatistic getMinTestcaseStatistic(final int iterations) {
    final SummaryStatistics current = ((FullCallTreeStatistic) data.get(config.getExecutionConfig().getVersion())).getMinStatistics(iterations);
    final SummaryStatistics previous = ((FullCallTreeStatistic) data.get(config.getExecutionConfig().getVersionOld())).getMinStatistics(iterations);
    return new TestcaseStatistic(previous, current, data.get(config.getExecutionConfig().getVersionOld()).getCalls(), data.get(config.getExecutionConfig().getVersion()).getCalls());
}
Also used : TestcaseStatistic(de.dagere.peass.measurement.statistics.data.TestcaseStatistic) SummaryStatistics(org.apache.commons.math3.stat.descriptive.SummaryStatistics)

Example 4 with TestcaseStatistic

use of de.dagere.peass.measurement.statistics.data.TestcaseStatistic in project peass by DaGeRe.

the class TestChangedIterationReading method testChangedIterationReading.

@Test
public void testChangedIterationReading() throws InterruptedException {
    VersionComparator.setVersions(Arrays.asList(new GitCommit("a23e385264c31def8dcda86c3cf64faa698c62d8", null, null, null), new GitCommit("33ce17c04b5218c25c40137d4d09f40fbb3e4f0f", null, null, null)));
    ProjectStatistics statistics = new ProjectStatistics();
    AnalyseFullData afd = new AnalyseFullData(new File("target/changes.json"), statistics, null, new StatisticsConfig());
    afd.analyseFolder(new File(DATA_FOLDER, "measurement_a23e385264c31def8dcda86c3cf64faa698c62d8_33ce17c04b5218c25c40137d4d09f40fbb3e4f0f/measurements"));
    TestcaseStatistic testcaseStatistic = statistics.getStatistics().get("a23e385264c31def8dcda86c3cf64faa698c62d8").get(new TestCase("de.test.CalleeTest#onlyCallMethod2"));
    System.out.println(testcaseStatistic);
    System.out.println(testcaseStatistic.getDeviationCurrent());
    System.out.println(testcaseStatistic.getDeviationOld());
    MatcherAssert.assertThat(testcaseStatistic.getDeviationCurrent(), Matchers.lessThan(800000d));
    MatcherAssert.assertThat(testcaseStatistic.getDeviationOld(), Matchers.lessThan(800000d));
}
Also used : TestcaseStatistic(de.dagere.peass.measurement.statistics.data.TestcaseStatistic) StatisticsConfig(de.dagere.peass.config.StatisticsConfig) GitCommit(de.dagere.peass.vcs.GitCommit) AnalyseFullData(de.dagere.peass.analysis.measurement.AnalyseFullData) TestCase(de.dagere.peass.dependency.analysis.data.TestCase) ProjectStatistics(de.dagere.peass.analysis.measurement.ProjectStatistics) File(java.io.File) Test(org.junit.jupiter.api.Test)

Example 5 with TestcaseStatistic

use of de.dagere.peass.measurement.statistics.data.TestcaseStatistic in project peass by DaGeRe.

the class KoPeMeTreeConverter method readStatistics.

private void readStatistics(final CauseSearchFolders folders, final String version, final TestCase testcase) throws JAXBException {
    for (File versionFolder : folders.getArchiveResultFolder(version, testcase).listFiles()) {
        // For the beginning, just analyze topmost KoPeMe-measurement
        File levelFolder = new File(versionFolder, "0");
        for (File kopemeFile : levelFolder.listFiles((FilenameFilter) new WildcardFileFilter(testcase.getMethod() + "*.xml"))) {
            readFile(version, testcase, versionFolder.getName(), kopemeFile);
        }
    }
    final TestcaseStatistic overallStatistic = new TestcaseStatistic(statisticsOld, statisticsCurrent, callsOld, calls);
    node.setStatistic(overallStatistic);
    node.setValues(statisticsCurrent.getValues());
    node.setValuesPredecessor(statisticsOld.getValues());
}
Also used : TestcaseStatistic(de.dagere.peass.measurement.statistics.data.TestcaseStatistic) File(java.io.File) WildcardFileFilter(org.apache.commons.io.filefilter.WildcardFileFilter)

Aggregations

TestcaseStatistic (de.dagere.peass.measurement.statistics.data.TestcaseStatistic)28 TestCase (de.dagere.peass.dependency.analysis.data.TestCase)7 ProjectStatistics (de.dagere.peass.analysis.measurement.ProjectStatistics)5 File (java.io.File)5 Map (java.util.Map)5 SummaryStatistics (org.apache.commons.math3.stat.descriptive.SummaryStatistics)5 Test (org.junit.Test)5 TTest (org.apache.commons.math3.stat.inference.TTest)4 Test (org.junit.jupiter.api.Test)4 BuildMeasurementValues (de.dagere.peass.ci.persistence.BuildMeasurementValues)3 TestMeasurementValues (de.dagere.peass.ci.persistence.TestMeasurementValues)3 MeasurementConfig (de.dagere.peass.config.MeasurementConfig)3 MeasuredNode (de.dagere.peass.measurement.rca.serialization.MeasuredNode)3 LinkedHashMap (java.util.LinkedHashMap)3 JsonIgnore (com.fasterxml.jackson.annotation.JsonIgnore)2 DefaultMeasurementVisualizer (de.dagere.peass.ci.helper.DefaultMeasurementVisualizer)2 TreeBuilder (de.dagere.peass.measurement.rca.helper.TreeBuilder)2 GraphNode (de.dagere.peass.visualization.GraphNode)2 NodePreparator (de.dagere.peass.visualization.NodePreparator)2 SimpleModule (com.fasterxml.jackson.databind.module.SimpleModule)1