use of de.dagere.peass.config.StatisticsConfig in project peass by DaGeRe.
the class AnalyseFullData method main.
public static void main(final String[] args) throws InterruptedException, JAXBException, JsonParseException, JsonMappingException, IOException {
final File folder = new File(args[0]);
if (!folder.getName().equals("measurements")) {
throw new RuntimeException("Can only be executed with measurements-folder! For searching folders, use FolderSearcher");
}
LOG.info("Draw results: " + Constants.DRAW_RESULTS);
VersionComparator.setDependencies(new StaticTestSelection());
// final File dependencyFile = new File(args[1]);
// final Dependencies dependencies = Constants.OBJECTMAPPER.readValue(dependencyFile, Dependencies.class);
// VersionComparator.setDependencies(dependencies);
// throw new RuntimeException("adapt if needed");
ProjectStatistics statistics = new ProjectStatistics();
final AnalyseFullData analyseFullData = new AnalyseFullData(new File("results/changes.json"), statistics, null, new StatisticsConfig());
analyseFullData.analyseFolder(folder);
Constants.OBJECTMAPPER.writeValue(new File("results/statistics.json"), statistics);
}
use of de.dagere.peass.config.StatisticsConfig 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.config.StatisticsConfig in project peass by DaGeRe.
the class StatisticsConfigMixin method getStasticsConfig.
public StatisticsConfig getStasticsConfig() {
StatisticsConfig config = new StatisticsConfig();
config.setType1error(getType1error());
config.setType2error(getType2error());
config.setStatisticTest(getStatisticTest());
config.setOutlierFactor(getOutlierFactor());
return config;
}
use of de.dagere.peass.config.StatisticsConfig in project peass by DaGeRe.
the class TestAnalyseFullData method testReading.
@Test
public void testReading() throws InterruptedException {
LinkedList<GitCommit> versions = new LinkedList<GitCommit>();
versions.add(new GitCommit("946e4318267b56838aa35da0a2a4e5c0528bfe04", "", "", ""));
versions.add(new GitCommit("fd79b2039667c09167c721b2823425629fad6d11", "", "", ""));
VersionComparator.setVersions(versions);
File baseFolder = new File(DATA_READING_FOLDER, "android-example-correct");
ModuleClassMapping mapping = new ModuleClassMapping(baseFolder, new ProjectModules(new File(baseFolder, "app")), new ExecutionConfig());
AnalyseFullData afd = new AnalyseFullData(new File("target/test.json"), new ProjectStatistics(), mapping, new StatisticsConfig());
afd.analyseFolder(REGULAR_DATA_FOLDER);
ProjectChanges changes = afd.getProjectChanges();
Set<String> changedTests = changes.getVersion("946e4318267b56838aa35da0a2a4e5c0528bfe04").getTestcaseChanges().keySet();
MatcherAssert.assertThat(changedTests, Matchers.contains("appĀ§com.example.android_example.ExampleUnitTest"));
}
use of de.dagere.peass.config.StatisticsConfig in project peass by DaGeRe.
the class TestAnalyseFullData method testReadingWithParams.
@Test
public void testReadingWithParams() throws InterruptedException {
LinkedList<GitCommit> versions = new LinkedList<GitCommit>();
versions.add(new GitCommit("49f75e8877c2e9b7cf6b56087121a35fdd73ff8b", "", "", ""));
versions.add(new GitCommit("a12a0b7f4c162794fca0e7e3fcc6ea3b3a2cbc2b", "", "", ""));
VersionComparator.setVersions(versions);
ModuleClassMapping mapping = Mockito.mock(ModuleClassMapping.class);
ProjectStatistics statistics = new ProjectStatistics();
AnalyseFullData afd = new AnalyseFullData(new File("target/test.json"), statistics, mapping, new StatisticsConfig());
afd.analyseFolder(new File(PARAM_DATA_FOLDER, "measurements"));
ProjectChanges changes = afd.getProjectChanges();
Set<String> changedTests = changes.getVersion("a12a0b7f4c162794fca0e7e3fcc6ea3b3a2cbc2b").getTestcaseChanges().keySet();
try {
System.out.println(Constants.OBJECTMAPPER.writeValueAsString(statistics));
System.out.println(Constants.OBJECTMAPPER.writeValueAsString(changes));
} catch (JsonProcessingException e) {
// TODO Auto-generated catch block
e.printStackTrace();
}
MatcherAssert.assertThat(changedTests, Matchers.contains("de.dagere.peass.ExampleTest"));
List<Change> methodChanges = TestChangeReader.checkParameterizedResult(changes);
Assert.assertEquals(4152486.88, methodChanges.get(0).getOldTime(), 0.1);
}
Aggregations