Skip to content

BugAID Developer Resource

Quinn Hanam edited this page Sep 26, 2017 · 1 revision

The project commitminer-main contains the main executables for BugAID:

  1. LearningAnalysisMain builds a dataset of commits
  2. LearningDataSetMain clusters the commits

LearningAnalysisMain

GitProjectAnalysis traverses the Git project history and triggers a CommitAnalysis for each commit. A CommitAnalysis performs an analysis on an entire commit by calling zero or more DomainAnalysis. For BugAID, the CommitAnalysis instance is built using LearningCommitAnalysisFactory, which includes two domains: LearningDomainAnalysis and ComplexityDomainAnalysis. The LearningDomainAnalysis is the tool analysis that builds the BugAID dataset.

LearningDomainAnalysis

The DomainAnalysis abstract class iterates through each file (analyzeFile) in the commit and diffs the old and new versions using ControlFlowDifferencing. This builds a CFDContext, which stores the ASTs and structural change annotations. analyzeFile then calls a SourceCodeFileAnalysis for each file, passing it the AST and CFG for the file, which are annotated with structural change information.

SourceCodeFileAnalysis

Calls LearningFunctionAnalysis for each function defined in the file.

LearningFunctionAnalysis

Visits a function's AST (with visitor pattern) and extracts features from the function to be included in the feature vector for the commit being analyzed.