Second-Language Acquisition (Cross-Linguistic Influence and Learner Language)
Cross Language Clone Analysis Team 2 November 10, 2010.
-
Upload
iris-bishop -
Category
Documents
-
view
218 -
download
0
description
Transcript of Cross Language Clone Analysis Team 2 November 10, 2010.
Presentation 6Cross Language Clone Analysis
Team 2November 10, 2010
• Current Tasks• Parsing & CodeDOM• Clone Analysis• Unit Testing• Team Collaboration• Path Forward
Agenda
2
Allen Tucker Patricia Bradford Greg Rodgers Brian Bentley Ashley Chafin
Our Team
3
Current TasksWhat we are tackling…
4
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”:
Current Tasks (Review)
5
UML Model – Load & Parse
6
UML Model – Translate
7
UML Model – Associate
8
Parsing & CodeDOMGOLD Parsing Populating CodeDOM
9
Task Understanding Three Step Process• Step 1 Code Translation
• Step 2 Clone Detection
• Step 3 Visualization
Source Files Translator Common
Model
Common Model Inspector Detected
Clones
Detected Clones UI Clone
Visualization
10
Grammar Updates 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
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.
Grammar Update Issues
12
What’s in CodeDOM (Java Code)
13
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
Our Grammar Bookkeeping
14
Our Grammar Bookkeeping
15
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)
Parsing & CodeDOM Status
16
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)
SLOC For Our Project
17
Clone AnalysisDr. Kraft’s Student’s Tool
18
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
Clone Research
19
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
Dr. Kraft Approach
20
Dr. Kraft Approach (cont)
21
◦About 50% complete porting the analysis code
◦Dr. Kraft's code AST, codeDOM and Tokenization's are
woven tightly together
Porting Clone Analysis
22
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)
Limitations
23
Our User Interface
24
Unit TestingNUnit
25
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
Two Types of Testing
26
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
NUnit
27
NUnit Example Code
28
NUnit Example Code
29
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
Unit Test Progress
30
Team CollaborationTeam 2 & Team 3
31
Team Collaboration Team 2 & Team 3 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
Patricia’s StatusPatricia Bradford
33
Beautiful baby boy, Joshua Aydan.
Patricia Had A….
34
Path ForwardNext Iteration & Schedule
35
Finalize Iteration 1Task (C++ to CodeDom) Continue Iteration 2 Task (Code Analysis) Continue Iteration 3 Task (Begin GUI)
Path Forward
36
Schedule
37