Class VEVOSUtilities

java.lang.Object
org.variantsync.boosting.eval.util.VEVOSUtilities

public class VEVOSUtilities extends Object
Utility class for using the VEVOS benchmark generator.
  • Constructor Summary

    Constructors
    Constructor
    Description
     
  • Method Summary

    Modifier and Type
    Method
    Description
    cloneRepositories(Path cloneBaseDir)
    Clones all datasets listed in the default dataset file to the cloneBaseDir.
    cloneRepositories(Path datasetFile, Path cloneBaseDir)
    Clones all datasets listed in the given dataset file to the cloneBaseDir.
    configurationsToFile(Path pathToConfigurationDir, org.variantsync.vevos.simulation.feature.sampling.Sample variantSample)
    Writes the configurations of all variants in the sample to individual files that are created in the given directory.
    Map<String,org.variantsync.vevos.simulation.variability.pc.groundtruth.GroundTruth>
    generateVariants(Path pathToSPL, Path variantGenerationDir, org.variantsync.vevos.simulation.variability.SPLCommit commit, org.variantsync.vevos.simulation.feature.sampling.Sample sample, org.variantsync.vevos.simulation.variability.pc.options.ArtefactFilter<org.variantsync.vevos.simulation.variability.pc.SourceCodeFile> fileFilter)
    Generate all variants in the given sample to variantGenerationDir.
    List<org.variantsync.vevos.simulation.variability.SPLCommit>
    loadGroundTruth(Path groundTruthPath)
    Loads the ground truth from the given directory and returns all SPLCommit objects that represent successfully loaded ground truths for specific commits.
    org.variantsync.vevos.simulation.feature.sampling.Sample
    sampleVariants(org.variantsync.vevos.simulation.variability.SPLCommit commit, int variantCount, int maxFeatures)
    Sample a desired number of variants for a given SPLCommit object

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • Constructor Details

    • VEVOSUtilities

      public VEVOSUtilities()
  • Method Details

    • cloneRepositories

      public List<Path> cloneRepositories(Path cloneBaseDir)
      Clones all datasets listed in the default dataset file to the cloneBaseDir. Returns the paths to which the SPLs where cloned.
    • cloneRepositories

      public List<Path> cloneRepositories(Path datasetFile, Path cloneBaseDir)
      Clones all datasets listed in the given dataset file to the cloneBaseDir. Returns the paths to which the SPLs where cloned.
    • loadGroundTruth

      public List<org.variantsync.vevos.simulation.variability.SPLCommit> loadGroundTruth(Path groundTruthPath)
      Loads the ground truth from the given directory and returns all SPLCommit objects that represent successfully loaded ground truths for specific commits.
    • sampleVariants

      public org.variantsync.vevos.simulation.feature.sampling.Sample sampleVariants(org.variantsync.vevos.simulation.variability.SPLCommit commit, int variantCount, int maxFeatures)
      Sample a desired number of variants for a given SPLCommit object
    • generateVariants

      public Map<String,org.variantsync.vevos.simulation.variability.pc.groundtruth.GroundTruth> generateVariants(Path pathToSPL, Path variantGenerationDir, org.variantsync.vevos.simulation.variability.SPLCommit commit, org.variantsync.vevos.simulation.feature.sampling.Sample sample, org.variantsync.vevos.simulation.variability.pc.options.ArtefactFilter<org.variantsync.vevos.simulation.variability.pc.SourceCodeFile> fileFilter)
      Generate all variants in the given sample to variantGenerationDir. The generation is done for a specific SPL of which we require the source code. This SPL is given as a Path to its root directory (i.e., the path to which it was cloned). The generation is done for one commit at a time. Note that the generation directory has to be cleaned before new variants are generated.

      The method returns a map of variants to their ground truth. The ground truth can be accessed via the artefact() method and contains the presence conditions, feature mappings, etc.

    • configurationsToFile

      public Map<String,Path> configurationsToFile(Path pathToConfigurationDir, org.variantsync.vevos.simulation.feature.sampling.Sample variantSample) throws IOException
      Writes the configurations of all variants in the sample to individual files that are created in the given directory.
      Parameters:
      pathToConfigurationDir - The directory in which the configuration files are to be created
      variantSample - The sample of variants for which the configuration files are to be created
      Returns:
      A map of variant to configuration file
      Throws:
      IOException - If creating or writing the files is not possible