Search in sources :

Example 1 with Guess

use of de.dagere.peass.analysis.guessing.Guess in project peass by DaGeRe.

the class GuessClassificationsByRules method guessVersion.

private void guessVersion(final Classification manual, final Entry<String, ChangeProperties> version) throws IOException {
    File versionFolder = new File(methodFileFolder, version.getKey());
    for (Entry<String, List<ChangeProperty>> testcase : version.getValue().getProperties().entrySet()) {
        GuessDecider guesser = new GuessDecider(versionFolder);
        for (ChangeProperty property : testcase.getValue()) {
            all++;
            if (version.getKey().equals("4ed6e923cb2033272fcb993978d69e325990a5aa")) {
                System.err.println();
            }
            Guess guess = guesser.guess(property.getAffectedMethods());
            testStructuralChanges(guesser, property, guess);
            if (guess != null) {
                VersionClass versionClass = manual.getVersions().get(version.getKey());
                if (versionClass != null) {
                    ChangedEntity entity = new ChangedEntity(testcase.getKey(), "", property.getMethod());
                    TestcaseClass testcaseClass = versionClass.getTestcases().get(entity);
                    if (testcaseClass != null) {
                        checkCorrectness(guess, testcaseClass, version.getKey(), entity);
                    } else {
                        LOG.error("In version {}, Testcase {} is missing - changes not consistent with properties!", version.getKey(), testcase);
                    }
                } else {
                    LOG.error("Version {} is missing - changes not consistent with properties!", version.getKey());
                }
            }
        }
    }
}
Also used : VersionClass(de.dagere.peass.analysis.groups.VersionClass) Guess(de.dagere.peass.analysis.guessing.Guess) List(java.util.List) ChangeProperty(de.dagere.peass.analysis.properties.ChangeProperty) ChangedEntity(de.dagere.peass.dependency.analysis.data.ChangedEntity) File(java.io.File) GuessDecider(de.dagere.peass.analysis.guessing.GuessDecider) TestcaseClass(de.dagere.peass.analysis.groups.TestcaseClass)

Aggregations

TestcaseClass (de.dagere.peass.analysis.groups.TestcaseClass)1 VersionClass (de.dagere.peass.analysis.groups.VersionClass)1 Guess (de.dagere.peass.analysis.guessing.Guess)1 GuessDecider (de.dagere.peass.analysis.guessing.GuessDecider)1 ChangeProperty (de.dagere.peass.analysis.properties.ChangeProperty)1 ChangedEntity (de.dagere.peass.dependency.analysis.data.ChangedEntity)1 File (java.io.File)1 List (java.util.List)1