Download presentation
Presentation is loading. Please wait.
Published byIris Bishop Modified over 8 years ago
1
Cross Language Clone Analysis Team 2 November 10, 2010
2
Current Tasks Parsing & CodeDOM Clone Analysis Unit Testing Team Collaboration Path Forward 2
3
Allen Tucker Patricia Bradford Greg Rodgers Brian Bentley Ashley Chafin 3
4
What we are tackling… 4
5
Current tasks created for the first user story “Source Code Load & Translate”: ◦ Load & parse C#, Java, C++ source code. ◦ Translate the parsed C#, Java, C++ source code to CodeDOM. ◦ Associate the CodeDOM to the original source code. Current tasks created for the second user story “Source Code Analyze”: 5
6
6
7
7
8
8
9
GOLD Parsing Populating CodeDOM 9
10
Three Step Process Step 1 Code Translation Step 2 Clone Detection Step 3 Visualization Source Files Translator Common Model Inspector Detected Clones UI Clone Visualization 10
11
Currently the grammars we have for the Gold parser are out dated. Current Gold Grammars ◦ C# version 2.0 ◦ Java version 1.4 Current available software versions ◦ C# version 4.0 ◦ Java version 6 11
12
Grammars for C# and Java are very complex and require a lot of work to build. Antler and Gold Parser grammars use completely different syntax. Positive note: Other development not halted by use of older grammars. 12
13
13
14
Since there are so many production rules, we came up with the following bookkeeping: A spreadsheet of the compiled grammar table (for each language) with each production rule indexed. ◦ This spreadsheet covers: various aspects of language what we have/have not handled from the parser what we have/have not implemented into CodeDOM percentage complete 14
15
15
16
Parsing Handlers’ Status: ◦ C# = 52% complete ◦ Java = 100% complete CodeDOM Translation Status: ◦ We currently do not believe we can give an accurate measure of our completeness on this. It is a learning process, and we are working hard to complete it. ◦ We are working on the CodeDOM translation for Java currently. (We will demo) 16
17
As of Nov 8, 2010 Sloc: ◦ CS666_Client = 510 lines ◦ CS666_Core = 114 lines ◦ CS666_CppParser = 117 lines ◦ CS666_CsParser = 1678 lines ◦ CS666_JavaParser = 3182 lines ◦ CS666_LanguageSupport = 48 lines ◦ CS666_Tests = 0 lines ◦ CS666_UnitTests = lines Total = 5649 lines (excluding unit tests) 17
18
Dr. Kraft’s Student’s Tool 18
19
Detecting clones across multiple programming languages is on the cutting edge of research. A preliminary version of this was done by Dr. Kraft and his students for C# and VB. ◦ They compared the Mono C# parser (written in C#) to the Mono VB parser (written in VB). ◦ Publication: Nicholas A. Kraft, Brandon W. Bonds, Randy K. Smith: Cross-language Clone Detection. SEKE 2008: 54-59 19
20
Token sequence of CodeDOM graphs with Levenshtein distance ◦ The Levenshtein distance between two sequences is defined as the minimum number of edits needed to transform one sequence into the other Performs Comparisons of code files CodeDOM tree is tokenized Based on Distances ◦ Percentage of matching tokens in a sequence 20
21
21
22
◦ About 50% complete porting the analysis code ◦ Dr. Kraft's code AST, codeDOM and Tokenization's are woven tightly together 22
23
Only does file-to-file comparisons ◦ Does not detect clones in same source file Can only detect Type 1 and some Type 2 clones Not very efficient (brute force) 23
24
24
25
NUnit 25
26
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 26
27
What Is NUnit? NUnit is a unit-testing framework for all.Net languages. Initially ported from JUnit, the current production release, version 2.5, is the sixth major release of this xUnit based unit testing tool for Microsoft.NET. It is written entirely in C# and has been completely redesigned to take advantage of many.NET language features, for example custom attributes and other reflection related capabilities. http://www.nunit.org/index.php http://www.nunit.org/index.php 27
28
28
29
29
30
NUnit has approximately 180 unit test stubs created. We are currently adding code to the unit test stubs that have functional code to support the test. Unit testing demo 30
31
Team 2 & Team 3 31
32
Both teams met Monday (11-8-10) after class and performed the required Pair Programming. Team 2 ◦ All project source code has been made available. ◦ We are researching and working to update the Java and C# grammars. Team 3 ◦ Team 3 is working on C++ parsing. Looking into other parser, ELSA. 32
33
Patricia Bradford 33
34
Beautiful baby boy, Joshua Aydan. 34
35
Next Iteration & Schedule 35
36
Finalize Iteration 1Task (C++ to CodeDom) Continue Iteration 2 Task (Code Analysis) Continue Iteration 3 Task (Begin GUI) Path Forward 36
37
Schedule 37
Similar presentations
© 2024 SlidePlayer.com. Inc.
All rights reserved.