Identify bug-introducing commits using semantic analysis that extends traditional SZZ algorithm. Distinguishes semantic changes from refactorings or code movements using control-flow and data-flow similarity analysis. Use when analyzing bug-fix commits to trace back to bug-introducing changes, investigating software evolution, conducting empirical studies on defect prediction, or reducing false positives in bug localization. Supports git repositories and provides explanations for why commits are identified as bug-introducing.
80%
Does it follow best practices?
Run evals on this skill
Adds up to 20 points to the overall score
Critical
Do not install without reviewing
Fix and improve this skill with Tessl
tessl review fix ./skills/semantic-szz-analyzer/SKILL.mdSemantic SZZ Analyzer extends the traditional SZZ (Sliwerski-Zimmermann-Zeller) algorithm by incorporating semantic analysis to identify bug-introducing commits more accurately. It distinguishes actual semantic changes from refactorings or code movements by analyzing control-flow and data-flow similarity across versions.
Analyze commits to distinguish between:
Use control-flow graphs (CFG) and data-flow analysis to compute similarity between code versions.
Given a bug-fix commit, trace back through git history to identify the commit that introduced the bug:
git blame to find commits that last modified those linesTraditional SZZ produces many false positives due to:
Semantic SZZ filters these by analyzing AST (Abstract Syntax Tree) structure and semantic equivalence.
Start by identifying the bug-fix commit. Look for:
Extract the changed lines and affected files.
Use git blame or git log -L to trace the history of changed lines:
git blame -L <start>,<end> <file> <bug-fix-commit>^This identifies commits that last modified the buggy lines before the fix.
For each candidate commit, run semantic analysis using the provided script:
python scripts/semantic_analyzer.py --repo <repo-path> --candidate <commit-hash> --fix <fix-commit-hash>The script computes:
Filter candidates based on semantic similarity threshold (default: 0.7). Rank remaining candidates by:
For each identified bug-introducing commit, generate an explanation including:
Example 1: Analyze a specific bug-fix
python scripts/semantic_szz.py --repo /path/to/repo --fix-commit abc123Example 2: Batch analysis of multiple fixes
python scripts/batch_analyze.py --repo /path/to/repo --fixes-file bug_fixes.txtExample 3: Generate detailed report
python scripts/semantic_szz.py --repo /path/to/repo --fix-commit abc123 --output report.json --explainAdjust sensitivity by modifying similarity thresholds:
# In scripts/semantic_analyzer.py
CFG_THRESHOLD = 0.7 # Control-flow similarity
DFG_THRESHOLD = 0.6 # Data-flow similarity
AST_THRESHOLD = 0.8 # AST structural similarityThe analyzer supports multiple languages with language-specific parsers:
ast modulejavalang or tree-sitterpycparser or tree-sitteresprima or tree-sitterSee references/language_support.md for details.
Link bug-fixes to issue IDs for automated analysis:
python scripts/semantic_szz.py --repo /path/to/repo --issue JIRA-123Results are provided in JSON format:
{
"fix_commit": "abc123",
"bug_introducing_commits": [
{
"commit": "def456",
"confidence": 0.85,
"semantic_change_type": "logic_modification",
"explanation": "Modified conditional logic in function foo()",
"changed_lines": [45, 46, 47],
"similarity_scores": {
"cfg": 0.72,
"dfg": 0.68,
"ast": 0.81
}
}
]
}ArabelaTso/Skills-4-SE
4f38503
If you maintain this skill, you can claim it as your own. Once claimed, you can manage eval scenarios, bundle related skills, attach documentation or rules, and ensure cross-agent compatibility.