@Test public void testCalculateFrameSimilarity_nonZeroDistance() throws IOException { BufferedReader obj = new BufferedReader(new StringReader("java.lang.IllegalArgumentException:\n" + "\tat eu.stamp.ClassA.method2(ClassA.java:10)\n" + "\tat eu.stamp.ClassB.method1(ClassB.java:20)")); StackTrace target = Mockito.spy(new StackTrace()); Mockito.doReturn(obj).when(target).readFromFile(anyString()); target.setup("", 2); StackTraceElement[] trace = new StackTraceElement[2]; trace[0] = new StackTraceElement("eu.stamp.ClassA", "method2", "ClassA", 10); trace[1] = new StackTraceElement("eu.stamp.ClassB", "method1", "ClassB", 21); double distance = calculator.calculateFrameSimilarity(trace, target); assertEquals(0.25, distance, 0.000001); }
public double calculateFrameSimilarity( StackTraceElement[] trace) { return calculateFrameSimilarity(trace, targetCrash); }
CrashCoverageFitnessCalculator { public double calculateFrameSimilarity( StackTraceElement[] trace) { return calculateFrameSimilarity(trace, targetCrash); } }
CrashCoverageFitnessCalculator { public double calculateFrameSimilarity( StackTraceElement[] trace) { return calculateFrameSimilarity(trace, targetCrash); } CrashCoverageFitnessCalculator(StackTrace crash); }
CrashCoverageFitnessCalculator { public double calculateFrameSimilarity( StackTraceElement[] trace) { return calculateFrameSimilarity(trace, targetCrash); } CrashCoverageFitnessCalculator(StackTrace crash); double getLineCoverageFitness( ExecutionResult result , int lineNumber); double getLineCoverageForFrame( ExecutionResult result, int frameLevel); double calculateFrameSimilarity( StackTraceElement[] trace); double getFrameDistance(StackTraceElement targetFrame, StackTraceElement generatedFrame); }
CrashCoverageFitnessCalculator { public double calculateFrameSimilarity( StackTraceElement[] trace) { return calculateFrameSimilarity(trace, targetCrash); } CrashCoverageFitnessCalculator(StackTrace crash); double getLineCoverageFitness( ExecutionResult result , int lineNumber); double getLineCoverageForFrame( ExecutionResult result, int frameLevel); double calculateFrameSimilarity( StackTraceElement[] trace); double getFrameDistance(StackTraceElement targetFrame, StackTraceElement generatedFrame);  }