use of org.evosuite.coverage.dataflow.DefUseCoverageTestFitness in project evosuite by EvoSuite.
the class AllUsesAnalysis method addNewGoalToFoundPairs.
private void addNewGoalToFoundPairs(CCFGMethodEntryNode investigatedMethod, BytecodeInstruction activeDef, BytecodeInstruction freeUse, DefUsePairType type, Set<DefUseCoverageTestFitness> foundPairs) {
checkDefinitionSanity(activeDef);
checkUseSanity(freeUse);
if (type.equals(DefUsePairType.INTER_METHOD) && !ccfg.isPublicMethod(investigatedMethod))
return;
DefUseCoverageTestFitness goal = DefUseCoverageFactory.createGoal(activeDef, freeUse, type);
if (goal != null) {
foundPairs.add(goal);
// System.out.println();
// System.out.println(" created goal: " + goal.toString());
}
}
use of org.evosuite.coverage.dataflow.DefUseCoverageTestFitness in project evosuite by EvoSuite.
the class AllUsesAnalysis method createIntraClassPairsForFreeUse.
private Set<DefUseCoverageTestFitness> createIntraClassPairsForFreeUse(BytecodeInstruction freeUse) {
checkFreeUseSanity(freeUse);
Set<DefUseCoverageTestFitness> r = new HashSet<DefUseCoverageTestFitness>();
for (String method : determinedActiveDefs.keySet()) {
if (!ccfg.isPublicMethod(method)) {
continue;
}
Set<Map<String, BytecodeInstruction>> activeDefss = determinedActiveDefs.get(method);
for (Map<String, BytecodeInstruction> activeDefs : activeDefss) {
// checkActiveDefsSanity(activeDefs);
// if (activeDefs.get(freeUse.getDUVariableName()) == null)
// continue;
BytecodeInstruction activeDef = activeDefs.get(freeUse.getVariableName());
if (activeDef == null)
continue;
addNewGoalToFoundPairs(null, activeDef, freeUse, DefUsePairType.INTRA_CLASS, r);
}
}
return r;
}
Aggregations