300 likes | 380 Views
Presentation 8. Cross Language Clone Analysis Team 2 January 20, 2011. Agenda. Quick Overview Current Status Current Status Analysis Path Forward Next Iteration. Our Team. Allen Tucker Patricia Bradford Greg Rodgers Ashley Chafin. Quick Overview.
E N D
Presentation 8 Cross Language Clone Analysis Team 2 January 20, 2011
Agenda • Quick Overview • Current Status • Current Status Analysis • Path Forward • Next Iteration
Our Team • Allen Tucker • Patricia Bradford • Greg Rodgers • Ashley Chafin
Quick Overview Quick overview of our project and where we currently stand.
Task Summary • Our Customers: Dr. Etzkorn and Dr. Kraft • Customer Request: • A tool that will abstract programs in C++, C#, Java, and (Python or VB) to the Dagstuhl Middle Metamodel, Microsoft CodeDOM or something similar, and detect cross-language clones. • Areas to Note: • the user interface • easy comparisons of clones • visualization of clones • sub-clones • clone detection for large bodies of code
Task Summary (cont.) • Per our task, in order to find clones across different programming languages, we will have to first convert the code from each language over to a language independent object model. • Some Language Independent Object Models: • Dagstuhl Middle Metamodel (DMM) • Microsoft CodeDOM • Both of these models provide a language independent object model for representing the structure of source code.
Clones Types • 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
Task Understanding • Three Step Process • Step 1 Code Translation • Step 2 Clone Detection • Step 3 Visualization Common Model Translator Source Files Detected Clones Inspector Common Model Clone Visualization UI Detected Clones
Architecture Application User Interface Web Interface Core Clone Detection Algorithms Code Model Service API Language Support (Interface) Eclipse Plug-in C# Service Java Service C++ Service Etc…
Key Architecture Points • Multilanguage support • Configurable for different platforms • Stand-along application • plug-in • backend service • Extendable
Features • Clone Detection Software Suite • Identifies • Tracks • Manages Software Clones • Multi-language support • C++ • C# • Java
Features (cont) • Provides complete code coverage • Multi-Application Support • Stand-alone • Plug-in based (Eclipse) • Backend service (Ant task) • Extendible • Built on a Plug-in Framework • Add new languages • Easy to Navigate between Clones • Persists Clones for easy Retrieval
Risks • Complexity of problem proves more difficult than initial estimates. • Technology to be applied is neither well-established or has yet to be developed. • Unable to complete defined project scope within schedule. • Volatile user requirements leading to redefinition of project objectives.
Testing Our Project • 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
Current Status Where we currently stand
Where we stand… • Iteration 1: Parsing -> 85% • Completed parsing for Java & C# • No parsing for C++ • But we have a foundation and design to start from. • Iteration 2: Translation to CodeDOM -> 60% • We have the foundation and design completed. • Now, it is a matter of turning the crank for the languages. • Iteration 3: Clone Analysis -> 30% • Ported majority of Dr. Kraft’s student project code. • Started focusing on the GUI
Task Understanding • Three Step Process • Step 1 Code Translation • Step 2 Clone Detection • Step 3 Visualization Common Model Translator Source Files Detected Clones Inspector Common Model Clone Visualization UI Detected Clones
SLOC For Our Project • As of Nov 22, 2010 • SLOC: • CS666_Client = 1746 lines • CS666_Core = 2653 lines • CS666_CppParser = 155 lines • CS666_CsParser = 3259 lines • CS666_JavaParser = 3378 lines • CS666_LanguageSupport = 84 lines • CS666_UnitTests = 2162 lines • Total = 13467 lines (including unit tests)
Path Forward Current Status Analysis & Path Forward for Next Semester
Pre-Iteration Analysis • We did an analysis on the following areas that we plan to work on this next iteration and provided a recommendation for path forward in that area: • C++ Parsing • CodeDOM: Java & C# • Analysis Algorithm • Visual Aspects • Requirements • Testing
C++ Parsing • Difficult problem to solve • Possible solutions • ANTLR… • PCCTS… • Elsa… • “Undiscovered treasure” • Recommendation: • “spike” as soon as possible to explore options
CodeDOM: Java & C# • Current solution and path forward is suitable, well defined. • Continue where task was suspended from last semester… • Recommendation: • Java completed in first iteration • C# completed in second iteration
Analysis Algorithm • The algorithm… • is checked into our code base and will compile. • not “wired in” yet because it was directly coupled with the parsing algorithm in Dr. Kraft’s Tool. • Recommendation: • Add post processing of the CodeDOM to generate a format compatible with Dr. Kraft’s clone detection algorithm. • Manipulate the output into a more generic format to be able to build different Visual Views of the data. • Update the algorithm for the following enhancements: • Same file clone detection • Type 3 clone detection (Requires more research) • More efficient
Visual Aspects • Where we were • GUI “tossed” together for testing • No visual designs • Test Cases created after the fact based on what functions were available in the GUI • Recommendation: • Start with Use Cases • Task flow • Test Case • Create Visual Designs based on Use Cases • Simple sketches • Meet with customer for approval
Requirements • We have currently User Stories, UML Models for previous iteration user stories, and limited test cases. • Recommendation: • update release plan for this semester • For next iteration: • create use cases/UML models from the selected user stories • create test cases from use cases User Story <<trace>> Requirements Use Case Test Cases
Testing • We had very little frontend test procedures to produce given primary focus of last semester…parse, parse, parse • Due to our difficulty finding a solution for parsing, we spent the rest of our time last semester trying to get the parsing and CodeDOM developed, with little time spent on unit tests. • Recommendation: • Beef up our testing • Unit Testing to test backend functionality. • Functional testing to test visual functions. • Create a baseline with current code/gui. • Requires some test to be written in order to bring backend test code to baseline
Path Forward • Tasks we plan to accomplish early this semester: • Testing: • Unit test cleanup/completion • Create function test cases for GUI • Visual Aspects: • Sketches for current/past user stories • Parsing & CodeDOM: • Complete Java conversion to CodeDOM • Complete C# conversion to CodeDOM • C++ parser research spike
Path Forward (cont.) • Algorithms: • Cleanup/Improve Dr. Kraft algorithms • New clone detection algorithms • Requirements: • Create use cases/UML models • Meet with customer to flesh out visual designs and requirements for use stories • Prototype: • Rework current GUI/Design
Next Iteration • Below is a list of the tasks for our next iteration: • Test cleanup/completion for current code • Sketches for visual design • Create use cases • Meet with customer to review sketches/use cases • Complete Java conversion to CodeDOM • Rework GUI based on new sketches and use cases