1.54k likes | 1.64k Vues
Presentation 7. Cross Language Clone Analysis Team 2 November 22, 2010. Agenda. Feasibility Study Release Plan Architecture Parsing CodeDOM Clone Analysis Testing Demonstration Team Collaboration Path Forward. Our Team. Allen Tucker Patricia Bradford Greg Rodgers Brian Bentley
E N D
Presentation 7 Cross Language Clone Analysis Team 2 November 22, 2010
Agenda • Feasibility Study • Release Plan • Architecture • Parsing • CodeDOM • Clone Analysis • Testing • Demonstration • Team Collaboration • Path Forward
Our Team • Allen Tucker • Patricia Bradford • Greg Rodgers • Brian Bentley • Ashley Chafin
Feasibility Study Our evaluation of the project to determine the difficulty in carrying out the task.
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.
Related Research • 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
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
Task Understanding (cont.) • Step 1: Code Translation • C#, C++, Java, VB (or Python) • CodeDOM • Step 2: Clone Detection • Leverage current clone detection techniques and research • Step 3: Clone Visualization • Need for an intuitive user interface
Clone Detection as a Product • Commercial Product • What are the benefits of Software Clone Detection? • Main Goal: Decrease Coding Errors (bugs)
Benefits • Fact: Modularity is a key characteristic in today’s software world • Why? Allows us to divide software into a decomposed separation of concerns • Attributes to maintainability, reusability, testability and reliability • Clone Detection allows us to detect common software spread across large bodies of code • Identify code that is subject to further modularity
Benefits (cont) • But not all code can be cleanly decomposed • Crosscutting Concerns • Responsible for tangling and scattering (code duplication) an implementation • Logging • Scattered across Unrelated Functions • How do you Manage large areas of (usually) Duplicated Crosscuts? • Errors, Changes
Benefits (cont) • Aspect Oriented Programming • Modularize Crosscuts using Advice and Join Points • Example: Spring Framework • Identifying Aspects (crosscuts) • Time Consuming task • Use Clone Detection to Identify Aspects • Define Rule
Benefits (cont) • Summarize • What? • Detect code that is a candidate for modularity • Identify Crosscuts in modules • Am I a candidate for ASP? • How? • Continuous Integration • Generate Reports every time new code is added
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)
Features (cont) • Extendible • Built on a Plug-in Framework • Add new languages • Easy to Navigate between Clones • Persists Clones for easy Retrieval
Human Factors • Designing to meet user needs • User center approach • Need for an intuitive user interface • Clone Visualization techniques
Intellectual Property The University of Alabama in Huntsville would own and manage any and all intellectual property associated with the research and developmental artifacts of this project.
Project and Development Issues • Fast, Good, and Cheap…choose two. • Fast…time required to deliver products • Good…quality of product • Cheap…cost of designing and building
Risk Analysis • 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.
Project Scale-Down Factors • Our initial approach…maximize existing open sourced developed items in order to reduce project timeline. • Instability in harvested projects. • Lack of support…documentation, forums, etc. • Disjoint projects code bases. • Non-existing code bases to harvest from.
Release Plan Release Plan and User Stories
User Story Approach • User Stories Applied…Mike Cohn suggested formal approach • As a (role) I want (something) so that (benefit). • Quality Attributes • Independent • Negotiable • Valuable to user or customers • Estimatable • Small • Testable
Re-tooled User Stories • Came out with original Release Plan on 9/15/20 • Due to customer wants/needs, we had to re-tool our user stories. • Dr. Etzkorn’s main concerns: • Load source code and translate to a language independent model • Analyze the translated source code for clones • Results from meeting: • Created two new user stories (see next two slides) • These two user stories have been pushed to the front of our card stack
CS 666 Studio I User Stories Phase I
Summary • ~ 68 remaining development days • Focus on top 3 user stories • Focus on Translation and Analysis
Source Code Load & Translate 017 1 14 Days As an analyst I want the to load and translate my source code projectsso I can analyze the source for clones.
Source Code Analyze 018 1 14 Days As an analyst I want the to analyze my source code projectsso I can see the clones.
Code Clone Highlights 002 1 14 Days As a analyst I want the capability to have the source code associated with clones highlighted within source files so that they are easy to identify.
CS 668 Software Studio II Phase II
Summary • ~ 80 development days • Focus on next 5 user stories • Focus on analysis capabilities
Auto-Navigate 013 2 7 Days As a developer I want the capability to auto-browse to the code segment associated with a clone so I do not have to manually search for it.
Visual Reports 003 1 21 Days As a analyst I want the capability to generate reports on clones within projects in a number of formats (e.g. html, cvs, etc.)so that I can include them in presentations.
Clone Density Graph 014 1 21 Days As an analyst I want the capability to have a projects clone density reported in a graph form so I can visually see the distribution of detected clones within a project.
Project Management 001 10 5 Days As a analyst I want the capability to load and manage multiple projectswithin the application so that I can perform analysis on them at various times without having to reload them.
Analysis Options 005 3 20 Days As a analyst I want the capability to view summary analysis data (e.g. clones per file, package, projects, etc.) so that I can identify the distribution of clones within a project.
Follow-On Work Future Capabilities
Project Language Auto-Detection 010 8 14 Days As an analyst I want the capability to have the language of a source code project auto-detected so I do not have to define it.
Clone Categorization 008 5 14 Days As an analyst I want the capability to have the detected clones categorized by a number of criteria (e.g. type, priority, etc.) so that work prioritization can be established.
False Positive Identification 004 7 14 Days As a analyst I want the capability to label a prospective clone as a false positive so that it will be ignored in analysis and reports.
Development Environment Integration 007 4 30 Days As a developer I want the capability to integrate the clone detection tool directly into my development environment (e.g. eclipse, netbeans, visual studio, etc.) so that I have a single application with all development tools integrated.
Project History 012 6 21 Days As an analyst I want the capability to see project change history (e.g. initial project, xx clones found, clone id yyy removed, project updated, xx new clones found, etc.) so I can assess the impact of code changes within a project.
Detection Updates 011 9 21 Days As an analyst I want the capability to update a projects associated source code and the tool to detect these changes and offer a detection re-do so I can make corrections to clones and see resolutions in action.
Interactive Help 015 10 21 Days As a general user I want an interactive help system with context sensitive search so I can learn the system with ease.
Build Environment Integration 006 10 30 Days As a configuration manager I want the capability to integrate clone detection into an automated build environment (e.g. ant, nmake, msbuild, etc.) so that I can view reports on a code projects as they are built.
Dropped User Stories Cut By Customer
Source Code Association 009 11 5 Days As an analyst I want the capability to retain or not to retain the associated source code with a project so I can reduce my project size footprint. Customer priority of 11 (Normal range is 1 – 10)…indicated would cut from scope.
Current Tasks Requirements & Models