Search in sources :

Example 1 with DependencyStatistics

use of de.dagere.peass.dependency.statistics.DependencyStatistics in project peass by DaGeRe.

the class RegressionTestSelectionSummarizer method getSimpleTable.

private void getSimpleTable(final File folder) throws IOException, JsonParseException, JsonMappingException, JAXBException {
    System.out.println("Project & Versions & Tests & SIC & TIC\\");
    for (final File xmlFile : FileUtils.listFiles(folder, new WildcardFileFilter(ResultsFolders.STATIC_SELECTION_PREFIX + "*.json"), TrueFileFilter.INSTANCE)) {
        final String projektName = xmlFile.getName().replace(ResultsFolders.STATIC_SELECTION_PREFIX, "").replace(".xml", "");
        final File executeFile = new File(xmlFile.getParentFile(), "views_" + projektName + "/execute" + projektName + ".json");
        if (xmlFile.exists() && executeFile.exists()) {
            final ExecutionData changedTests = Constants.OBJECTMAPPER.readValue(executeFile, ExecutionData.class);
            final DependencyStatistics statistics = DependencyStatisticAnalyzer.getChangeStatistics(xmlFile, changedTests);
            final double percent = 10000d * statistics.getChangedTraceTests() / statistics.getOverallRunTests();
            System.out.println(percent);
            System.out.println(projektName + " & " + statistics.getSize() + " & " + statistics.getOverallRunTests() + " & " + statistics.getPruningRunTests() + " & " + statistics.getChangedTraceTests() + " & " + Math.round(percent) / 100d + " %\\");
        }
    }
}
Also used : DependencyStatistics(de.dagere.peass.dependency.statistics.DependencyStatistics) File(java.io.File) WildcardFileFilter(org.apache.commons.io.filefilter.WildcardFileFilter) ExecutionData(de.dagere.peass.dependency.persistence.ExecutionData)

Example 2 with DependencyStatistics

use of de.dagere.peass.dependency.statistics.DependencyStatistics in project peass by DaGeRe.

the class RegressionTestSelectionSummarizer method getExtendedTable.

private void getExtendedTable(final File folder) throws IOException, JsonParseException, JsonMappingException, JAXBException {
    System.out.println("Project;Versions;Normal-Tests;SIC;TIC; Tests once changed; Tests multiple times changed");
    for (final File xmlFile : FileUtils.listFiles(folder, new WildcardFileFilter(ResultsFolders.STATIC_SELECTION_PREFIX + "*.json"), TrueFileFilter.INSTANCE)) {
        final String projektName = xmlFile.getName().replace(ResultsFolders.STATIC_SELECTION_PREFIX, "").replace(".xml", "");
        final File executeFile = new File(xmlFile.getParentFile(), "views_" + projektName + "/execute" + projektName + ".json");
        if (xmlFile.exists() && executeFile.exists()) {
            final ExecutionData changedTests = Constants.OBJECTMAPPER.readValue(executeFile, ExecutionData.class);
            final DependencyStatistics statistics = DependencyStatisticAnalyzer.getChangeStatistics(xmlFile, changedTests);
            System.out.println(projektName + ";" + statistics.getSize() + ";" + statistics.getOverallRunTests() + ";" + statistics.getPruningRunTests() + ";" + statistics.getChangedTraceTests() + ";" + statistics.getOnceChangedTests().size() + ";" + statistics.getMultipleChangedTest().size());
        }
    }
}
Also used : DependencyStatistics(de.dagere.peass.dependency.statistics.DependencyStatistics) File(java.io.File) WildcardFileFilter(org.apache.commons.io.filefilter.WildcardFileFilter) ExecutionData(de.dagere.peass.dependency.persistence.ExecutionData)

Aggregations

ExecutionData (de.dagere.peass.dependency.persistence.ExecutionData)2 DependencyStatistics (de.dagere.peass.dependency.statistics.DependencyStatistics)2 File (java.io.File)2 WildcardFileFilter (org.apache.commons.io.filefilter.WildcardFileFilter)2