public boolean execute() throws Exception {
    boolean     result;
    Instances   data;
    Instance	filteredInstance;
    Instances	filteredInstances;
    Instance	filteredInstanceSource;
    Instances	filteredInstancesSource;
    DataSource  source;
    Filter	filter;
    Filter	filterSource;
    int		i;
    
    result = true;
    
    // a few checks
    if (getFilter() == null)
      throw new Exception("No filter set!");
    if (getSourceCode() == null)
      throw new Exception("No source code set!");
    if (getDataset() == null)
      throw new Exception("No dataset set!");
    if (!getDataset().exists())
      throw new Exception(
          "Dataset '" + getDataset().getAbsolutePath() + "' does not exist!");
    
    // load data
    source = new DataSource(getDataset().getAbsolutePath());
    data   = source.getDataSet();
    if (getClassIndex() == -2)
      data.setClassIndex(data.numAttributes() - 1);
    else
      data.setClassIndex(getClassIndex());
    
    // compare output
    // 1. batch filtering
    filter = Filter.makeCopy(getFilter());
    filter.setInputFormat(data);
    filteredInstances = Filter.useFilter(data, filter);

    filterSource = Filter.makeCopy(getSourceCode());
    filterSource.setInputFormat(data);
    filteredInstancesSource = Filter.useFilter(data, filterSource);

    result = compare(filteredInstances, filteredInstancesSource);
    
    // 2. instance by instance
    if (result) {
      filter = Filter.makeCopy(getFilter());
      filter.setInputFormat(data);
      Filter.useFilter(data, filter);
      
      filterSource = Filter.makeCopy(getSourceCode());
      filterSource.setInputFormat(data);

      for (i = 0; i < data.numInstances(); i++) {
	filter.input(data.instance(i));
	filter.batchFinished();
	filteredInstance = filter.output();
	
	filterSource.input(data.instance(i));
	filterSource.batchFinished();
	filteredInstanceSource = filterSource.output();
	
	if (!compare(filteredInstance, filteredInstanceSource))
	  System.out.println(
	      (i+1) + ". instance (Filter/Source code): " 
	      + filteredInstance + " != " + filteredInstanceSource);
      }
    }
    
    return result;
  }