use of de.dagere.peass.folders.CauseSearchFolders in project peass by DaGeRe.
the class CauseTester method main.
public static void main(final String[] args) throws IOException, XmlPullParserException, InterruptedException, JAXBException, ClassNotFoundException {
final File projectFolder = new File("../../projekte/commons-fileupload");
final String version = "4ed6e923cb2033272fcb993978d69e325990a5aa";
final TestCase test = new TestCase("org.apache.commons.fileupload.ServletFileUploadTest", "testFoldedHeaders");
final MeasurementConfig config = new MeasurementConfig(15 * 1000 * 60, 15, true, version, version + "~1");
config.setUseKieker(true);
final CauseSearcherConfig causeConfig = new CauseSearcherConfig(test, false, 0.01, false, false, RCAStrategy.COMPLETE, 1);
final CauseTester manager = new CauseTester(new CauseSearchFolders(projectFolder), config, causeConfig, new EnvironmentVariables());
final CallTreeNode node = new CallTreeNode("FileUploadTestCase#parseUpload", "protected java.util.List org.apache.commons.fileupload.FileUploadTestCase.parseUpload(byte[],java.lang.String)", "protected java.util.List org.apache.commons.fileupload.FileUploadTestCase.parseUpload(byte[],java.lang.String)", config);
node.setOtherVersionNode(node);
final Set<CallTreeNode> nodes = new HashSet<>();
nodes.add(node);
manager.setIncludedMethods(nodes);
manager.runOnce(test, version, 0, new File("log"));
// manager.evaluate(test);
}
use of de.dagere.peass.folders.CauseSearchFolders in project peass by DaGeRe.
the class LevelCauseSearchExperimentalStarter method main.
public static void main(final String[] args) throws IOException, XmlPullParserException, InterruptedException, IllegalStateException, AnalysisConfigurationException, ViewNotFoundException, JAXBException {
final File projectFolder = new File("../../projekte/commons-fileupload");
final String version = "4ed6e923cb2033272fcb993978d69e325990a5aa";
final TestCase test = new TestCase("org.apache.commons.fileupload.ServletFileUploadTest", "testFoldedHeaders");
final MeasurementConfig measurementConfiguration = new MeasurementConfig(15 * 1000 * 60, 5, true, version, version + "~1");
measurementConfiguration.setUseKieker(true);
final CauseSearcherConfig causeSearcherConfig = new CauseSearcherConfig(test, false, 0.1, false, false, RCAStrategy.COMPLETE, 1);
final CauseSearchFolders folders2 = new CauseSearchFolders(projectFolder);
final BothTreeReader reader = new BothTreeReader(causeSearcherConfig, measurementConfiguration, folders2, new EnvironmentVariables());
final CauseTester measurer = new CauseTester(folders2, measurementConfiguration, causeSearcherConfig, new EnvironmentVariables());
final LevelCauseSearcher searcher = new LevelCauseSearcher(reader, causeSearcherConfig, measurer, measurementConfiguration, folders2, new EnvironmentVariables());
reader.readTrees();
List<CallTreeNode> predecessor = Arrays.asList(new CallTreeNode[] { reader.getRootPredecessor() });
List<CallTreeNode> current = Arrays.asList(new CallTreeNode[] { reader.getRootVersion() });
int level = 0;
boolean hasChilds = true;
while (hasChilds) {
level++;
LOG.info("Level: " + level + " " + predecessor.get(0).getKiekerPattern());
boolean foundNodeLevel = false;
final List<CallTreeNode> predecessorNew = new LinkedList<>();
final List<CallTreeNode> currentNew = new LinkedList<>();
final Iterator<CallTreeNode> currentIterator = current.iterator();
for (final Iterator<CallTreeNode> preIterator = predecessor.iterator(); preIterator.hasNext() && currentIterator.hasNext(); ) {
final CallTreeNode predecessorChild = preIterator.next();
final CallTreeNode currentChild = currentIterator.next();
predecessorNew.addAll(predecessorChild.getChildren());
currentNew.addAll(currentChild.getChildren());
final String searchedCall = "public static long org.apache.commons.fileupload.util.Streams.copy(java.io.InputStream,java.io.OutputStream,boolean,byte[])";
if (predecessorChild.getKiekerPattern().equals(searchedCall) && currentChild.getKiekerPattern().equals(searchedCall)) {
foundNodeLevel = true;
}
if (predecessorChild.getKiekerPattern().equals(searchedCall) != currentChild.getKiekerPattern().equals(searchedCall)) {
LOG.info(predecessorChild.getKiekerPattern());
LOG.info(currentChild.getKiekerPattern());
throw new RuntimeException("Tree structure differs above searched node!");
}
}
if (foundNodeLevel) {
LOG.info("Found!");
searcher.isLevelDifferent(predecessorNew, currentNew);
}
predecessor = predecessorNew;
current = currentNew;
if (predecessor.isEmpty()) {
hasChilds = false;
}
}
}
use of de.dagere.peass.folders.CauseSearchFolders in project peass by DaGeRe.
the class RootCauseAnalysis method call.
@Override
public Void call() throws Exception {
if (testName == null) {
throw new RuntimeException("Test needs to be defined!");
}
initVersionProcessor();
if (version == null) {
version = executionData.getVersions().keySet().iterator().next();
LOG.info("Version was not defined, using " + version);
}
final TestCase test = new TestCase(testName);
final VersionStaticSelection versionInfo = staticTestSelection.getVersions().get(version);
boolean found = versionInfo.getTests().getTests().contains(test);
if (!found) {
LOG.error("Test " + test + " is not contained in regression test selection result, therefore it is unlikely to have a performance change!");
}
final String predecessor = versionInfo.getPredecessor();
LOG.debug("Timeout in minutes: {}", executionMixin.getTimeout());
final MeasurementConfig measurementConfiguration = getConfiguration(predecessor);
final CauseSearcherConfig causeSearcherConfig = new CauseSearcherConfig(test, causeSearchConfigMixin);
if (kiekerConfigMixin.isUseAggregation() && measurementConfiguration.getKiekerConfig().getRecord() == AllowedKiekerRecord.OPERATIONEXECUTION) {
throw new RuntimeException("Aggregation and OperationExecutionRecord can not be combined!");
}
final CauseSearchFolders alternateFolders = new CauseSearchFolders(folders.getProjectFolder());
final BothTreeReader reader = new BothTreeReader(causeSearcherConfig, measurementConfiguration, alternateFolders, new EnvironmentVariables());
final CauseSearcher tester = getCauseSeacher(measurementConfiguration, causeSearcherConfig, alternateFolders, reader);
tester.search();
return null;
}
use of de.dagere.peass.folders.CauseSearchFolders in project peass by DaGeRe.
the class TestKoPeMeResultTransformation method testConversion.
@Test
public void testConversion() throws JAXBException {
final TestCase testcase = new TestCase("com.example.android_example.ExampleUnitTest", "test_TestMe");
CauseSearchFolders folders = new CauseSearchFolders(new File("src/test/resources/visualization/project_test"));
KoPeMeTreeConverter converter = new KoPeMeTreeConverter(folders, "7675e29a368e5ac051e76c145e84c80af7ae1e88", testcase);
GraphNode convertedNode = converter.getData();
Assert.assertEquals(0.004, convertedNode.getStatistic().getMeanOld(), DELTA);
Assert.assertEquals(0.003, convertedNode.getStatistic().getMeanCurrent(), DELTA);
Assert.assertEquals(0.0035, convertedNode.getVmValues().getValues().get(0).get(0).getMean(), DELTA);
Assert.assertEquals(0.0025, convertedNode.getVmValues().getValues().get(0).get(1).getMean(), DELTA);
Assert.assertEquals(0.0045, convertedNode.getVmValuesPredecessor().getValues().get(0).get(0).getMean(), DELTA);
Assert.assertEquals(0.0035, convertedNode.getVmValuesPredecessor().getValues().get(0).get(1).getMean(), DELTA);
Assert.assertEquals(0.003, convertedNode.getValues()[0], DELTA);
Assert.assertEquals(0.003, convertedNode.getValues()[1], DELTA);
Assert.assertEquals(0.004, convertedNode.getValuesPredecessor()[0], DELTA);
Assert.assertEquals(0.004, convertedNode.getValuesPredecessor()[1], DELTA);
}
use of de.dagere.peass.folders.CauseSearchFolders in project peass by DaGeRe.
the class AdaptiveExecutorMoreParameterIT method testOneMethodExecution.
@Test
public void testOneMethodExecution() throws IOException, XmlPullParserException, InterruptedException, ViewNotFoundException, AnalysisConfigurationException, JAXBException {
try (MockedStatic<VersionControlSystem> mockedVCS = Mockito.mockStatic(VersionControlSystem.class);
MockedStatic<GitUtils> mockedGitUtils = Mockito.mockStatic(GitUtils.class)) {
VCSTestUtils.mockGetVCS(mockedVCS);
VCSTestUtils.mockGoToTagAny(mockedGitUtils, SOURCE_DIR);
CauseSearchFolders folders = new CauseSearchFolders(projectFolder);
executor = new CauseTester(folders, TestConstants.SIMPLE_MEASUREMENT_CONFIG_KIEKER, TestConstants.SIMPLE_CAUSE_CONFIG_TESTME, new EnvironmentVariables());
testSuccessfull();
}
}
Aggregations