cross language clone analysis team 2 february 3, 2011
TRANSCRIPT
![Page 1: Cross Language Clone Analysis Team 2 February 3, 2011](https://reader035.vdocuments.net/reader035/viewer/2022070415/5697bfd81a28abf838caef5d/html5/thumbnails/1.jpg)
Presentation 9Cross Language Clone Analysis
Team 2February 3, 2011
![Page 2: Cross Language Clone Analysis Team 2 February 3, 2011](https://reader035.vdocuments.net/reader035/viewer/2022070415/5697bfd81a28abf838caef5d/html5/thumbnails/2.jpg)
• Parsing/CodeDOM• Clone Analysis• Customer Meeting• GUI Implementation• Testing• Current Status• Path Forward
Agenda
2
![Page 3: Cross Language Clone Analysis Team 2 February 3, 2011](https://reader035.vdocuments.net/reader035/viewer/2022070415/5697bfd81a28abf838caef5d/html5/thumbnails/3.jpg)
Allen Tucker Patricia Bradford Greg Rodgers Ashley Chafin
Our Team
3
![Page 4: Cross Language Clone Analysis Team 2 February 3, 2011](https://reader035.vdocuments.net/reader035/viewer/2022070415/5697bfd81a28abf838caef5d/html5/thumbnails/4.jpg)
Parsing & CodeDOMParsing and conversion to CodeDOM
4
![Page 5: Cross Language Clone Analysis Team 2 February 3, 2011](https://reader035.vdocuments.net/reader035/viewer/2022070415/5697bfd81a28abf838caef5d/html5/thumbnails/5.jpg)
C++ Grammar
Received grammar and included in project.
One parser engine == Three languages
![Page 6: Cross Language Clone Analysis Team 2 February 3, 2011](https://reader035.vdocuments.net/reader035/viewer/2022070415/5697bfd81a28abf838caef5d/html5/thumbnails/6.jpg)
Significant work remaining to get all statement variations into CodeDOM
Estimate of 35% complete
On going work will not impede analysis work.
Java to CodeDOM Conversion
![Page 7: Cross Language Clone Analysis Team 2 February 3, 2011](https://reader035.vdocuments.net/reader035/viewer/2022070415/5697bfd81a28abf838caef5d/html5/thumbnails/7.jpg)
Clone AnalysisThe Algorithm
7
![Page 8: Cross Language Clone Analysis Team 2 February 3, 2011](https://reader035.vdocuments.net/reader035/viewer/2022070415/5697bfd81a28abf838caef5d/html5/thumbnails/8.jpg)
3 Types of Clones (Definition of Similarity):◦ Type 1: An exact copy without modifications
(except for whitespace and comments)
◦ Type 2: A syntactically identical copy Only variable, type, or function identifiers have
been changed
◦ Type 3: A copy with further modifications Statements have been changed, reordered,
added, or removed
Clones Types
8
![Page 9: Cross Language Clone Analysis Team 2 February 3, 2011](https://reader035.vdocuments.net/reader035/viewer/2022070415/5697bfd81a28abf838caef5d/html5/thumbnails/9.jpg)
Clone Analysis
9
Code Base
CodeDOM Conversion
Use Gold Parser for conversion
Transformation
Transform the CodeDOM elements into a sequence of tokens
Processed Code
Match Detection
Run comparison algorithm on transformed code
Transformed Code
Clones Formatting
Clone pair/class locations of the transformed code are mapped to the original code base by line numbers and file location
Clone Pairs/Classes
Filtering
Clones are extracted from the source, visualized and manually analyzed to filter out false positives
![Page 10: Cross Language Clone Analysis Team 2 February 3, 2011](https://reader035.vdocuments.net/reader035/viewer/2022070415/5697bfd81a28abf838caef5d/html5/thumbnails/10.jpg)
Covert source code to CodeDOM
Algorithm (Conversion)
10
![Page 11: Cross Language Clone Analysis Team 2 February 3, 2011](https://reader035.vdocuments.net/reader035/viewer/2022070415/5697bfd81a28abf838caef5d/html5/thumbnails/11.jpg)
Transform the CodeDOM syntax to a sequence of tokens
Algorithm (Transformation)
11
![Page 12: Cross Language Clone Analysis Team 2 February 3, 2011](https://reader035.vdocuments.net/reader035/viewer/2022070415/5697bfd81a28abf838caef5d/html5/thumbnails/12.jpg)
$p$p($p$p&$p){$p$p=$p;$p$p=$p.$p();for(; $p!=$p. $p();++$p){$p<<$p<<$p<<*$p<<$p;++$p;}}
$p$p($p$p&$p){$p$p=$p;$p$p=$p.$p();for(; $p!=$p. $p();++$p){$p<<$p<<$p<<$p->$p<<$p<<$p->$p<<$p;++$p;}}
Levenshtein Distance◦ minimum number of edits needed to transform one string into the other
Insertion Deletion substitution
Algorithm (Match Detection)
12
![Page 13: Cross Language Clone Analysis Team 2 February 3, 2011](https://reader035.vdocuments.net/reader035/viewer/2022070415/5697bfd81a28abf838caef5d/html5/thumbnails/13.jpg)
Algorithm (Match Detection)
13
![Page 14: Cross Language Clone Analysis Team 2 February 3, 2011](https://reader035.vdocuments.net/reader035/viewer/2022070415/5697bfd81a28abf838caef5d/html5/thumbnails/14.jpg)
Customer MeetingCustomer Meeting on 1/27/11
14
![Page 15: Cross Language Clone Analysis Team 2 February 3, 2011](https://reader035.vdocuments.net/reader035/viewer/2022070415/5697bfd81a28abf838caef5d/html5/thumbnails/15.jpg)
We met with the customer on 1/27/11. We discussed the following:
◦ Updated release plan We moved up the project management user story.
◦ Current user stories (in design/development) - 5 Source Code Load & Translate Source Code Analyze Code Clone Highlights Auto-Navigate Project Management
Met with Customer
15
![Page 16: Cross Language Clone Analysis Team 2 February 3, 2011](https://reader035.vdocuments.net/reader035/viewer/2022070415/5697bfd81a28abf838caef5d/html5/thumbnails/16.jpg)
We discussed the following (cont.):◦ Use cases – 8
Load New Source Code Project Parse Source Code Translate to CodeDOM Associate Source Code Load Project Save & Delete Project Name & Rename Project View & Edit Project Properties
Met with Customer (cont.)
16
![Page 17: Cross Language Clone Analysis Team 2 February 3, 2011](https://reader035.vdocuments.net/reader035/viewer/2022070415/5697bfd81a28abf838caef5d/html5/thumbnails/17.jpg)
We discussed the following (cont.):◦ UML Models – 6
We had to transport over some UML models created last semester into our current UML model collection.
◦ Sketches – 4 Created sketched for the project management user
story.◦ Functional Tests – 3
Created functional tests for the project management user story.
Met with Customer (cont.)
17
![Page 18: Cross Language Clone Analysis Team 2 February 3, 2011](https://reader035.vdocuments.net/reader035/viewer/2022070415/5697bfd81a28abf838caef5d/html5/thumbnails/18.jpg)
GUI ImplementationSketches / Demo
18
![Page 19: Cross Language Clone Analysis Team 2 February 3, 2011](https://reader035.vdocuments.net/reader035/viewer/2022070415/5697bfd81a28abf838caef5d/html5/thumbnails/19.jpg)
Frame Layout
19
UI Development Complete
![Page 20: Cross Language Clone Analysis Team 2 February 3, 2011](https://reader035.vdocuments.net/reader035/viewer/2022070415/5697bfd81a28abf838caef5d/html5/thumbnails/20.jpg)
Project Frame
20
Partially complete
![Page 21: Cross Language Clone Analysis Team 2 February 3, 2011](https://reader035.vdocuments.net/reader035/viewer/2022070415/5697bfd81a28abf838caef5d/html5/thumbnails/21.jpg)
Edit/Create Project Window
21
UI Development Complete
![Page 22: Cross Language Clone Analysis Team 2 February 3, 2011](https://reader035.vdocuments.net/reader035/viewer/2022070415/5697bfd81a28abf838caef5d/html5/thumbnails/22.jpg)
Project View
22
Under Construction
![Page 23: Cross Language Clone Analysis Team 2 February 3, 2011](https://reader035.vdocuments.net/reader035/viewer/2022070415/5697bfd81a28abf838caef5d/html5/thumbnails/23.jpg)
Application Menu Options◦ Should be added to Frame Layout design
Property Pages◦ Project◦ File Group?◦ Source Files
Probable Changes in next iteration◦ XP Process and Single/Multiple Projects
Missing Sketches/GUI design
23
![Page 24: Cross Language Clone Analysis Team 2 February 3, 2011](https://reader035.vdocuments.net/reader035/viewer/2022070415/5697bfd81a28abf838caef5d/html5/thumbnails/24.jpg)
TestingWhite Box and Black Box Testing
24
![Page 25: Cross Language Clone Analysis Team 2 February 3, 2011](https://reader035.vdocuments.net/reader035/viewer/2022070415/5697bfd81a28abf838caef5d/html5/thumbnails/25.jpg)
White Box Testing: ◦ Unit Testing
Black Box Testing:◦ Production Rule Testing
Allows us to test the robustness of our engine because we can force rule production errors.
Regression Testing Automated
◦ Functional Testing
Testing Our Project
25
![Page 26: Cross Language Clone Analysis Team 2 February 3, 2011](https://reader035.vdocuments.net/reader035/viewer/2022070415/5697bfd81a28abf838caef5d/html5/thumbnails/26.jpg)
Project Metrics
![Page 27: Cross Language Clone Analysis Team 2 February 3, 2011](https://reader035.vdocuments.net/reader035/viewer/2022070415/5697bfd81a28abf838caef5d/html5/thumbnails/27.jpg)
Project Metrics (Baseline)
![Page 28: Cross Language Clone Analysis Team 2 February 3, 2011](https://reader035.vdocuments.net/reader035/viewer/2022070415/5697bfd81a28abf838caef5d/html5/thumbnails/28.jpg)
Current Test Count: 33 Added test to cover existing code All tests are passing…
◦ “Happy Path Tests”◦ Will begin off-nominals
Project Unit Test Results
![Page 29: Cross Language Clone Analysis Team 2 February 3, 2011](https://reader035.vdocuments.net/reader035/viewer/2022070415/5697bfd81a28abf838caef5d/html5/thumbnails/29.jpg)
Unit Test Sample
![Page 30: Cross Language Clone Analysis Team 2 February 3, 2011](https://reader035.vdocuments.net/reader035/viewer/2022070415/5697bfd81a28abf838caef5d/html5/thumbnails/30.jpg)
Current StatusWhere we currently stand
30
![Page 31: Cross Language Clone Analysis Team 2 February 3, 2011](https://reader035.vdocuments.net/reader035/viewer/2022070415/5697bfd81a28abf838caef5d/html5/thumbnails/31.jpg)
31
Source Code Load & Translate -◦ C++ -◦ C# -◦ Java -◦ Associate -
Source Code Analyze -◦ Dr. Kraft’s tool - ◦ Type 1 clones – ◦ Type 2 clones – ◦ Type 3 clones –
Where we stand…
![Page 32: Cross Language Clone Analysis Team 2 February 3, 2011](https://reader035.vdocuments.net/reader035/viewer/2022070415/5697bfd81a28abf838caef5d/html5/thumbnails/32.jpg)
32
Project Management –◦ Remove “demo” GUI – 100%◦ Sketches for visual design – 40%◦ GUI Rework –
Testing - ◦ Baseline unit tests – 100%◦ Update unit test for this iteration -
Where we stand…
![Page 33: Cross Language Clone Analysis Team 2 February 3, 2011](https://reader035.vdocuments.net/reader035/viewer/2022070415/5697bfd81a28abf838caef5d/html5/thumbnails/33.jpg)
As of Feb 3, 2011 SLOC:
◦ CS666_Client = 2137 lines◦ CS666_Core = 2695 lines◦ CS666_Console = 138 lines◦ CS666_CppParser = 155 lines◦ CS666_CsParser = 3265 lines◦ CS666_JavaParser = 3388 lines◦ CS666_LanguageSupport = 84 lines◦ CS666_UnitTests = 944 lines
Total = 12806 lines (including unit tests)
SLOC For Our Project
33
- Used lcounter.exe to count SLOC
![Page 34: Cross Language Clone Analysis Team 2 February 3, 2011](https://reader035.vdocuments.net/reader035/viewer/2022070415/5697bfd81a28abf838caef5d/html5/thumbnails/34.jpg)
Path ForwardPath Forward for the next iteration
34
![Page 35: Cross Language Clone Analysis Team 2 February 3, 2011](https://reader035.vdocuments.net/reader035/viewer/2022070415/5697bfd81a28abf838caef5d/html5/thumbnails/35.jpg)
35
Schedule
![Page 36: Cross Language Clone Analysis Team 2 February 3, 2011](https://reader035.vdocuments.net/reader035/viewer/2022070415/5697bfd81a28abf838caef5d/html5/thumbnails/36.jpg)
36
Below is a list of the tasks for our next iteration:◦ Parsing/CodeDOM
C++ parsing Complete Java conversion to CodeDOM
◦ Clone Analysis Detecting Type 1 clones
◦ GUI Project management Displaying source code Sketches for visual design
Next Iteration
![Page 37: Cross Language Clone Analysis Team 2 February 3, 2011](https://reader035.vdocuments.net/reader035/viewer/2022070415/5697bfd81a28abf838caef5d/html5/thumbnails/37.jpg)
37
◦ Documentation User Stories, Use Cases, UML Models, Sketches
Project management Displaying source code Displaying CodeDOM Displaying Type 1 clones detected
Functional Tests Update schedule
◦ Testing Unit tests Execute functional tests
Next Iteration