Class ConstructionValidation
java.lang.Object
org.variantsync.diffdetective.experiments.thesis_bm.ConstructionValidation
- All Implemented Interfaces:
Analysis.Hooks
Validates, evaluates and benchmarks the construction of
VariationDiff
s using Gumtree.
This experiment computes the variation diff from
- a line matching (
Viegener's algorithm
- a tree matching computed by Gumtree (
GumTreeDiff.diffUsingMatching(org.variantsync.diffdetective.variation.tree.VariationTree<L>, org.variantsync.diffdetective.variation.tree.VariationTree<L>)
- a hybrid matching (
GumTreeDiff.improveMatching(org.variantsync.diffdetective.variation.diff.DiffNode<L>, com.github.gumtreediff.matchers.Matcher)
)
- Author:
- Benjamin Moosherr
- See Also:
-
- "Constructing Variation Diffs Using Tree Diffing Algorithms"
-
Nested Class Summary
Modifier and TypeClassDescriptionstatic final class
Timing of a variation diff construction with a specific matching algorithm and quality results compared to another variation diff.static final class
Aggregate of the results of the three comparisons.private class
private class
-
Field Summary
Modifier and TypeFieldDescriptionprivate BufferedWriter
private final EditClassCatalogue
private final com.github.gumtreediff.matchers.Matcher
static final AnalysisResult.ResultKey<ConstructionValidation.Result>
-
Constructor Summary
ConstructorDescriptionConstructionValidation
(com.github.gumtreediff.matchers.Matcher matcher, EditClassCatalogue editClasses) -
Method Summary
Modifier and TypeMethodDescriptionboolean
analyzeVariationDiff
(Analysis analysis) The main hook for analyzing non-empty diff trees.private com.github.gumtreediff.matchers.Matcher
void
beginBatch
(Analysis analysis) private <L extends Label>
ConstructionValidation.ComparisonResultcompare
(VariationDiff<L> a, VariationDiff<L> b) private void
counts
(VariationDiff<DiffLinesLabel> tree, ConstructionValidation.VariationDiffStatistics statistics) void
void
initializeResults
(Analysis analysis) Initialization hook forAnalysis.getResult()
.static void
Main method to start the validation.private <L extends Label>
voidparallelPreOrderWalk
(Projection<L> nodeA, Projection<L> nodeB, BiConsumer<DiffNode<L>, DiffNode<L>> consumer, Set<DiffNode<L>> visited) private <L extends Label>
voidparallelPreOrderWalk
(VariationDiff<L> nodeA, VariationDiff<L> nodeB, BiConsumer<DiffNode<L>, DiffNode<L>> consumer) private VariationDiff<DiffLinesLabel>
parseVariationTree
(Analysis analysis, org.eclipse.jgit.revwalk.RevCommit commit) private void
writeCsvCell
(Writer destination, Object o) Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
Methods inherited from interface org.variantsync.diffdetective.analysis.Analysis.Hooks
beginCommit, beginPatch, endCommit, endPatch, onFailedCommit, onFailedParse, onParsedCommit
-
Field Details
-
RESULT
-
matcher
private final com.github.gumtreediff.matchers.Matcher matcher -
editClasses
-
destination
-
-
Constructor Details
-
ConstructionValidation
public ConstructionValidation(com.github.gumtreediff.matchers.Matcher matcher, EditClassCatalogue editClasses)
-
-
Method Details
-
main
Main method to start the validation.- Parameters:
args
- Command-line options.- Throws:
IOException
- When copying the log file fails.
-
writeCsvCell
- Throws:
IOException
-
initializeResults
Description copied from interface:Analysis.Hooks
Initialization hook forAnalysis.getResult()
. All result types should be appended with a neutral value usingAnalysis.append(org.variantsync.diffdetective.analysis.AnalysisResult.ResultKey<T>, T)
. No other side effects should be performed during this methods as it might be called an arbitrary amount of times.- Specified by:
initializeResults
in interfaceAnalysis.Hooks
-
beginBatch
- Specified by:
beginBatch
in interfaceAnalysis.Hooks
- Throws:
IOException
-
analyzeVariationDiff
Description copied from interface:Analysis.Hooks
The main hook for analyzing non-empty diff trees. Called at most once during the patch phase.- Specified by:
analyzeVariationDiff
in interfaceAnalysis.Hooks
- Throws:
Exception
DiffParseException
-
endBatch
- Specified by:
endBatch
in interfaceAnalysis.Hooks
- Throws:
IOException
-
counts
private void counts(VariationDiff<DiffLinesLabel> tree, ConstructionValidation.VariationDiffStatistics statistics) -
parseVariationTree
private VariationDiff<DiffLinesLabel> parseVariationTree(Analysis analysis, org.eclipse.jgit.revwalk.RevCommit commit) throws IOException, DiffParseException - Throws:
IOException
DiffParseException
-
compare
private <L extends Label> ConstructionValidation.ComparisonResult compare(VariationDiff<L> a, VariationDiff<L> b) -
parallelPreOrderWalk
private <L extends Label> void parallelPreOrderWalk(VariationDiff<L> nodeA, VariationDiff<L> nodeB, BiConsumer<DiffNode<L>, DiffNode<L>> consumer) -
parallelPreOrderWalk
private <L extends Label> void parallelPreOrderWalk(Projection<L> nodeA, Projection<L> nodeB, BiConsumer<DiffNode<L>, DiffNode<L>> consumer, Set<DiffNode<L>> visited) -
augmentedMatcher
private com.github.gumtreediff.matchers.Matcher augmentedMatcher(ConstructionValidation.VariationDiffStatistics statistics)
-