cross language clone analysis team 2 april 7, 2011
TRANSCRIPT
Presentation 15Cross Language Clone Analysis
Team 2April 7, 2011
• Parsing/CodeDOM• Clone Analysis• GUI Implementation• Testing• Current Status• Path Forward
Agenda
2
Allen Tucker Patricia Bradford Greg Rodgers Ashley Chafin
Our Team
3
Parsing & CodeDOMParsing and conversion to CodeDOM
4
CodeDOM Status
Accomplishments
Java and C# conversion into CodeDOM to support cross language detections are equal (see teal cells left)
Local variable statement in place for Java.
Not much progress this iteration.
5
Language Element CodeDOM Java C# C++Source File CodeCompilationUnit Yes YesImports/Using CodeNamespaceImport Yes YesFormal Parameters CodeParameterDeclarationExpression Yes YesMethod Declaration CodeMemberMethod Yes YesInterface Declaration CodeTypeDeclaration Yes YesField Declaration CodeMemberField Yes YesEnumeration Declaration CodeTypeDeclaration Yes YesClass Declaration CodeTypeDeclaration Yes YesStruct Declaration CodeTypeDeclaration Yes YesConstructor Declaration CodeConstructor Yes YesLocal Variable Statement CodeStatement YesIf StatementWhile StatementIf Then StatementFor StatementForeach Statement
Clone AnalysisI see ewe
6
Clone Analysis
7
Code Base
CodeDOM Conversion
Use Gold Parser for conversion
Transformation
Transform the CodeDOM elements into a sequence of tokens
Processed Code
Clone Analysis
Run comparison algorithm on transformed code
Transformed Code
Clone Formatting
Clone pair/class locations of the transformed code are mapped to the original code base by line numbers and file location
Clone Match
0…*
0…*
8
Current Status 100 % complete with
Tokenization Analysis Formatting
Making progress on Java into CodeDOM C# into CodeDOM
9
Additions
Clone Match Clone Type
Type 1 - An exact copy Type 2 - A syntactically identical copy Type 3 - A copy with further modifications
Fixed a handful (<10) bugs
Language Plugin Documentation
How do you build the model?
10
11
Documentation
Tokenize Analyze
Expressions 25/25 25/25
Statements 14/14 14/14
Other 7/7 7/7
Total 46/46 46/46
How are we using CodeDOM as a common code representation?
12
Documentation
CodeDOM ExpressionsCodeArgumentReferenceExpression
CodeDefaultValueExpression
CodeBinaryOperatorExpression
…
25
Java ExpressionsPreIncrementExpression
MultiplicativeExpression
ShiftExpression
…
80+
C# ExpressionsPreIncrementExpression
MultiplicativeExpression
ShiftExpression
…
80+
GUI ImplementationSketches Old/New
13
Source File Properties
14
Namespace Properties
15
File Type Properties
16
File Group Properties
17
Density Graph
18
Need to add legend
Clone View
19
Need to implement grouping by other types.
Language/File group
Preferences - UI
20
Preferences - Detection
21
GUI ImplementationDemo
22
TestingWhite Box and Black Box Testing
23
Project Unit Test Results
24
98/101 Unit Tests Currently Pass
Failed based on recent change to tokenization technique for Labels to accommodate java and c# codeDOM conversion.
Project Metrics (Release 0.04)
25
Project Metrics (Release 0.04)
26
Path ForwardPath Forward for the next iteration
27
28
Below is a list of the tasks for our next iteration:◦ Parsing/CodeDOM
Continue Java, C# conversion to CodeDOM◦ Clone Analysis
Look at Performance Improvements◦ GUI
Bug fixes /Enhancements Project Properties Page Preference Page Performance Checks/Enhancements
Next Iteration
29
◦ Documentation User Stories, Use Cases, UML Models, Sketches Functional Tests Update schedule Language Plugin Development
◦ Testing Unit tests Execute functional tests Record bugs/issues found
Next Iteration