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);
}
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());
}
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());
}
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));
}
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());
}
Aggregations