Class ConstructionValidation
java.lang.Object
org.variantsync.diffdetective.experiments.thesis_bm.ConstructionValidation
- All Implemented Interfaces:
Analysis.Hooks
Validates, evaluates and benchmarks the construction of
VariationDiffs 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:
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic final classTiming of a variation diff construction with a specific matching algorithm and quality results compared to another variation diff.static final classAggregate of the results of the three comparisons.private classprivate class -
Field Summary
FieldsModifier and TypeFieldDescriptionprivate BufferedWriterprivate final EditClassCatalogueprivate final com.github.gumtreediff.matchers.Matcherstatic final AnalysisResult.ResultKey<ConstructionValidation.Result> -
Constructor Summary
ConstructorsConstructorDescriptionConstructionValidation(com.github.gumtreediff.matchers.Matcher matcher, EditClassCatalogue editClasses) -
Method Summary
Modifier and TypeMethodDescriptionbooleananalyzeVariationDiff(Analysis analysis) The main hook for analyzing non-empty diff trees.private com.github.gumtreediff.matchers.MatchervoidbeginBatch(Analysis analysis) private <L extends Label>
ConstructionValidation.ComparisonResultcompare(VariationDiff<L> a, VariationDiff<L> b) private voidcounts(VariationDiff<DiffLinesLabel> tree, ConstructionValidation.VariationDiffStatistics statistics) voidvoidinitializeResults(Analysis analysis) Initialization hook forAnalysis.getResult().static voidMain 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 voidwriteCsvCell(Writer destination, Object o) Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods 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.HooksInitialization 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:
initializeResultsin interfaceAnalysis.Hooks
-
beginBatch
- Specified by:
beginBatchin interfaceAnalysis.Hooks- Throws:
IOException
-
analyzeVariationDiff
Description copied from interface:Analysis.HooksThe main hook for analyzing non-empty diff trees. Called at most once during the patch phase.- Specified by:
analyzeVariationDiffin interfaceAnalysis.Hooks- Throws:
ExceptionDiffParseException
-
endBatch
- Specified by:
endBatchin 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:
IOExceptionDiffParseException
-
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)
-