Program: 21397
Project: 21397
Buggy source:
public BayesianNetwork wrapperBNOneMonthNB(DataOnMemory<DataInstance> data){
  StaticVariables Vars=new StaticVariables(data.getAttributes());
  List<DataOnMemory<DataInstance>> splitData=this.splitTrainAndTest(data,66.0);
  DataOnMemory<DataInstance> trainingData=splitData.get(0);
  DataOnMemory<DataInstance> testData=splitData.get(1);
  List<Variable> NSF=new ArrayList<>(Vars.getListOfVariables());
  NSF.remove(classVariable);
  NSF.remove(classVariable_PM);
  int nbrNSF=NSF.size();
  List<Variable> SF=new ArrayList();
  Boolean stop=false;
  BayesianNetwork bNet=train(trainingData,Vars,SF,false);
  System.out.println(bNet.toString());
  double score=testFS(testData,bNet);
  int cont=0;
  while (nbrNSF > 0 && stop == false) {
    System.out.print(cont + "String_Node_Str" + score+ "String_Node_Str"+ SF.size()+ "String_Node_Str");
    SF.stream().forEach(v -> System.out.print(v.getName() + "String_Node_Str"));
    System.out.println();
    Map<Variable,Double> scores=new HashMap<>();
    for (    Variable V : NSF) {
      if (V.getVarID() > 5)       break;
      System.out.println("String_Node_Str" + V.getName());
      SF.add(V);
      bNet=train(trainingData,Vars,SF,false);
      scores.put(V,testFS(testData,bNet));
      SF.remove(V);
    }
    double maxScore=(Collections.max(scores.values()));
    if (maxScore - score > 0.001) {
      score=maxScore;
      for (      Map.Entry<Variable,Double> entry : scores.entrySet()) {
        if (entry.getValue() == maxScore) {
          Variable SelectedV=entry.getKey();
          SF.add(SelectedV);
          NSF.remove(SelectedV);
          break;
        }
      }
      nbrNSF=nbrNSF - 1;
    }
 else {
      stop=true;
    }
    cont++;
  }
  bNet=train(data,Vars,SF,true);
  System.out.println(bNet.getDAG().toString());
  return bNet;
}

Fixed version (ground truth):
public BayesianNetwork wrapperBNOneMonthNB(DataOnMemory<DataInstance> data){
  StaticVariables Vars=new StaticVariables(data.getAttributes());
  List<DataOnMemory<DataInstance>> splitData=this.splitTrainAndTest(data,66.0);
  DataOnMemory<DataInstance> trainingData=splitData.get(0);
  DataOnMemory<DataInstance> testData=splitData.get(1);
  List<Variable> NSF=new ArrayList<>(Vars.getListOfVariables());
  NSF.remove(classVariable);
  NSF.remove(classVariable_PM);
  int nbrNSF=NSF.size();
  List<Variable> SF=new ArrayList();
  Boolean stop=false;
  BayesianNetwork bNet=train(trainingData,Vars,SF,false);
  System.out.println(bNet.toString());
  double score=testFS(testData,bNet);
  int cont=0;
  while (nbrNSF > 0 && stop == false) {
    System.out.print(cont + "String_Node_Str" + score+ "String_Node_Str"+ SF.size()+ "String_Node_Str");
    SF.stream().forEach(v -> System.out.print(v.getName() + "String_Node_Str"));
    System.out.println();
    Map<Variable,Double> scores=new HashMap<>();
    for (    Variable V : NSF) {
      System.out.println("String_Node_Str" + V.getName());
      SF.add(V);
      bNet=train(trainingData,Vars,SF,false);
      scores.put(V,testFS(testData,bNet));
      SF.remove(V);
    }
    double maxScore=(Collections.max(scores.values()));
    if (maxScore - score > 0.001) {
      score=maxScore;
      for (      Map.Entry<Variable,Double> entry : scores.entrySet()) {
        if (entry.getValue() == maxScore) {
          Variable SelectedV=entry.getKey();
          SF.add(SelectedV);
          NSF.remove(SelectedV);
          break;
        }
      }
      nbrNSF=nbrNSF - 1;
    }
 else {
      stop=true;
    }
    cont++;
  }
  bNet=train(data,Vars,SF,true);
  System.out.println(bNet.getDAG().toString());
  return bNet;
}