Yuta Nakamura1, Eunjong Choi1, Norihiro Yoshida2,

Slides:



Advertisements
Similar presentations
ASP.NET Intro An introduction to the languages and communication of an ASP.NET system.
Advertisements

JavaScript FaaDoOEngineers.com FaaDoOEngineers.com.
Introduction to JavaScript
Modern Web Application Frameworks CSE 591 – Security and Vulnerability Analysis Spring 2015 Adam Doupé Arizona State University
Software Engineering Laboratory, Department of Computer Science, Graduate School of Information Science and Technology, Osaka University Extracting Code.
MSc. Publishing on WWW JavaScript. What is JavaScript? A scripting language devised by Netscape Adds functionality to web pages by: Embedding code into.
Multiple Tiers in Action
Lecture 4B: Server-Side Scripting IT 202—Internet Applications Based on notes developed by Morgan Benton.
Tutorial 3: Adding and Formatting Text. 2 Objectives Session 3.1 Type text into a page Copy text from a document and paste it into a page Check for spelling.
ITM352 Javascript and Dynamic Web Pages: Client Side Processing.
Software Engineering Laboratory, Department of Computer Science, Graduate School of Information Science and Technology, Osaka University Industrial Application.
XP New Perspectives on Microsoft Access 2002 Tutorial 71 Microsoft Access 2002 Tutorial 7 – Integrating Access With the Web and With Other Programs.
Java Server Pages (JSP) Presented by: Ananth Prasad & Alex Ivanov May 10, 2001.
Overview of JSP Technology. The need of JSP With servlets, it is easy to – Read form data – Read HTTP request headers – Set HTTP status codes and response.
©Ian Sommerville 2004Software Engineering, 7th edition. Chapter 13 Slide 1 Application architectures.
Using Data Active Server Pages Objectives In this chapter, you will: Learn about variables and constants Explore application and session variables Learn.
PHP : Hypertext Preprocessor
Software Engineering Laboratory, Department of Computer Science, Graduate School of Information Science and Technology, Osaka University Finding Similar.
Software Engineering Laboratory, Department of Computer Science, Graduate School of Information Science and Technology, Osaka University What Kinds of.
Software Engineering Laboratory, Department of Computer Science, Graduate School of Information Science and Technology, Osaka University A Criterion for.
Department of Computer Science, Graduate School of Information Science and Technology, Osaka University DCCFinder: A Very- Large Scale Code Clone Analysis.
Department of Computer Science, Graduate School of Information Science & Technology, Osaka University A clone detection approach for a collection of similar.
Software Engineering Laboratory, Department of Computer Science, Graduate School of Information Science and Technology, Osaka University What Do Practitioners.
 This presentation introduces the following: › 3 types of CSS › CSS syntax › CSS comments › CSS and color › The box model.
Lecture 19 Web Application Frameworks Boriana Koleva Room: C54
Software Engineering Laboratory, Department of Computer Science, Graduate School of Information Science and Technology, Osaka University Applying Clone.
Department of Computer Science, Graduate School of Information Science & Technology, Osaka University Inoue Laboratory Eunjong Choi 1 Investigating Clone.
Software Engineering Laboratory, Department of Computer Science, Graduate School of Information Science and Technology, Osaka University How to extract.
Introduction to Client Side Scripting CS Client Side Scripting Client side means the Browser is interpreting the script Script is downloaded with.
Software Engineering Laboratory, Department of Computer Science, Graduate School of Information Science and Technology, Osaka University Development of.
Department of Computer Science, Graduate School of Information Science & Technology, Osaka University Retrieving Similar Code Fragments based on Identifier.
Department of Computer Science, Graduate School of Information Science & Technology, Osaka University 1 Towards an Assessment of the Quality of Refactoring.
Web Page Design Introduction. The ________________ is a large collection of pages stored on computers, or ______________ around the world. Hypertext ________.
JavaScript Syntax, how to use it in a HTML document
JavaScript - Basic Concepts Prepared and Presented by Hienvinh Nguyen, Afshin Tiraie.
Introduction to JavaScript CS101 Introduction to Computing.
Department of Computer Science, Graduate School of Information Science & Technology, Osaka University 1 Towards an Investigation of Opportunities for Refactoring.
Software Engineering Laboratory, Department of Computer Science, Graduate School of Information Science and Technology, Osaka University Finding Code Clones.
1) PHP – Personal Home Page Scripting Language 2) JavaScript.
What kind of and how clones are refactored? A case study of three OSS projects WRT2012 June 1, Eunjong Choi†, Norihiro Yoshida‡, Katsuro Inoue†
JavaScript Dynamic Active Web Pages Client Side Scripting.
Department of Computer Science, Graduate School of Information Science and Technology, Osaka University Towards a Collection of Refactoring Patterns Based.
JavaScript & Introduction to AJAX
COSC 2328 – Web Programming.  PHP is a server scripting language  It’s widely-used and free  It’s an alternative to Microsoft’s ASP and Ruby  PHP.
IST 210: PHP Basics IST 210: Organization of Data IST2101.
Yasuhiro Hayase†, Yu Kashima‡, Yuki Manabe‡, Katsuro Inoue‡
PHP Basics and Syntax Lesson 3 ITBS2203 E-Commerce for IT.
Introduction to.
Javascript and Dynamic Web Pages: Client Side Processing
Using JavaScript to Show an Alert
Naoya Ujihara1, Ali Ouni2, Takashi Ishio1, Katsuro Inoue1
>> Introduction to CSS
Section 17.1 Section 17.2 Add an audio file using HTML
Do Developers Focus on Severe Code Smells?
Assembler, Compiler, Interpreter
Introduction to JavaScript
○Yuichi Semura1, Norihiro Yoshida2, Eunjong Choi3, Katsuro Inoue1
CIS16 Application Development – Programming with Visual Basic
Introduction to JavaScript
Tatsuya Miyake Takashi Ishio Katsuro Inoue
Refactoring Support Tool: Cancer
JavaScript.
Unit 6 part 3 Test Javascript Test.
Unit 6 part 2 Test Javascript Test.
Assembler, Compiler, Interpreter
Recommending Verbs for Rename Method using Association Rule Mining
On Refactoring Support Based on Code Clone Dependency Relation
Kazuki Yokoi1 Eunjong Choi2 Norihiro Yoshida3 Katsuro Inoue1
Dotri Quoc†, Kazuo Kobori†, Norihiro Yoshida
Introduction to JavaScript
Presentation transcript:

Towards Detection and Analysis of Inter-Language Clones for Multilingual Web Applications Yuta Nakamura1, Eunjong Choi1, Norihiro Yoshida2, Shusuke Haruna1, Katsuro Inoue1 1Osaka University, Japan 2Nagoya University, Japan (Thank you for the introduction. ) (Hello, I’m Yuta Nakamura. I’m a graduate student at Osaka University.) Now, I would like to talk about my research entitled “Towards Detection and Analysis of Inter-language Clones for Multilingual Web Applications”.

Web Application Web applications tend to be developed by multiple programming languages. E.g.) HTML, JavaScript, Java, PHP, etc. Web applications contain many clones. Web applications that more than 50% codes compose clones were found[1]. At First, I will explain about the background of my research, web application. In recent years, web applications and their development become popular. One of the characteristics of the web application is that they tend to be developed by multiple programming languages, for example, client side languages such as HTML and JavaScript, or server side languages such as PHP and Java. Another characteristic is that web applications contain many clones. According to an investigation of clones in web applications, web applications that more than 50% codes compose clones were found. This is because developers give priority to the rapid development capability or their performance. These two characteristics of web applications cause special clones, inter-language clones. I will explain about the inter-language clone. Reasons: Rapid development capability Improvement of performance [1] Rajapakse et al.”An Investigation of Cloning in Web Applications”, ICWE'05 , 2005

Inter-Language Clone - Example - channel_edit_modal.html chat_edit_modal.html <div class="md_simple_modal <button class=“btn btn-md btn ng-click=“updateChannel() ” </div> <div class="md_simple_modal <button class=“btn btn-md btn ng-click=“updateGroup() ” </div> … … … … call call controllers.js controllers.js $scope.updateChannel=function () { })['finally'](function () { delete $scope.channel.updating; }); }; I will give an actual example of the inter-language clone. These code fragments are a part of a real OSS web application and written in two languages, HTML and JavaScript. This HTML code fragment calls a JavaScript code fragment by calling function updateChannel(). And, there is similar pair of code fragments and they have similar callee/caller relation. In my research, I call the two pairs of the code fragments as an instance of inter-language clone. $scope.updateGroup=function () { })['finally'](function () { delete $scope.group.updating; }); }; … …

Inter-Language Clone - Definition(1/2) - call relation set (CR) A set of code fragments which have callee/caller relations call relation graph (CRG) A node represents a code fragment. An edge represents a callee/caller relation. A node name represents a language used to write the code fragment. Next, I will introduce definition of the inter-language clone. Call relation set is defined as a set of code fragments which have callee/caller relations. Specifically, if there’re two code fragments and one code fragment call the other code fragment, the set of the two code fragments will be call relation set. Call relation graph is graph representation of call relation set. A node represents a code fragment and an edge represents a callee/caller relation and a node name represents a language used to write the code fragment. CR CRG HTML code fragment call JavaScript

Inter-Language Clone - Definition(2/2) - For two given Call Relation set CR1 and CR2, and its graph CRG1 and CRG2, we call the pair of CR1 and CR2 as an inter-language clone if the following three conditions are satisfied. Callee/caller relations span multiple programming languages. CFG1 and CFG2 are isomorphic. Each pair of the corresponding nodes between CFG1 and CFG2, holds a clone relation. CR1 CRG1 CR2 CRG2 For two given call relation set and its graph, the two sets are called as an inter-language clone if the following three conditions are satisfied. First, callee/caller relation span multiple languages. Second, two graphs are isomorphic. Third, each pair of the corresponding nodes between two graphs holds a clone relation. In this figure, call relation span two languages HTML and JavaScript, and two graphs are isomorphic and each pair of the nodes are a clone. So, these two call relation set will be an inter-language clone. HTML HTML call call JavaScript JavaScript The same color means clone relation.

Inter-Language Clone - Benefit of Detection - Developers can check less number of clone instances in the software maintenance. Saving the maintenance cost clones written in HTML clones written in JavaScript excluded clone call clone which has a callee/caller relation Next, I will explain about benefit of detecting inter-language clones. In the software maintenance, many clones increase the cost. For example, If developers modify a clone, they need to check whether other clones are similarly modified. But, in the case of the inter-language clones, clones which have no callee/caller relations will not be interlanguage clones. So, developers can check less number of instances of clone in the software maintenance like this figure. inter-language clone check excluded Developer

Overview of Detection Approach web application source codes STEP1 Detecting Clones for Each Programming Language clones for each programming language STEP2 Analyzing Callee/Caller Relations callee/caller relations At present, an overview of detection approach is here. My approach consists of 3 steps. First, my approach detects code clones for each programming language. Second, my approach analyzes callee/caller relations among code fragments. Finally, my approach detects inter-language clones by using the detected clones and the relations. Next, I will introduce research challenges in detecting the inter-language clones. STEP3 Detecting Inter-language Clones inter-language clones

Research Challenge - Target Programming Languages - Language-dependent approach are desirable due to analysis of callee/caller relations. Which combinations of languages should be focused? Java Script HTML Java Script The first challenge is target programming languages. Language-dependent approach are desirable due to analysis of callee/caller relation. Then, I need to decide which combinations of languages should be focused. Java Java Script PHP HTML

Research Challenge - Tangled Files - There exist files written in multiple programming languages. These tangled files prevent our approach from analyzing. <div> HTML codes <script> JavaScript codes </script> </div> HTML and JavaScript codes are tangled in a file. The second challenge is tangled files. There exit files written in multiple languages in web applications. For example, HTML source codes might contain JavaScript codes between <script> tags. These tangled files prevent our approach from analyzing. Therefore, I should decide how to deal with this problem.

Research Challenge - Granularity of Clone Detection - Which granularity of clone detection will be appropriate? Note: Detecting fine grained clones, not very similar code fragments might be detected as an inter-language clone. call detected clone of fine grain Final challenge is granularity of clone detection. In detecting clones from each programming language, which granularity of clone detection will be appropriate? I think not very similar code fragments might be detected as an inter-language clone if I detect fine grained clones. Like this figure, if I detect an inter-language clone by using a fine grained clone, the callee code fragment such as a function might be actually larger than the clone. As a result, caller code fragment calls not very similar a callee code fragment. Detecting an inter-language clone by using a fine grained clone, the callee code fragment might be actually larger than the clone. call caller code fragment callee code fragment

Summary Web applications have two characteristics. They contain many clones. They tend to be developed by multiple programming languages. We introduced an “inter-language clone” caused by these characteristics. We introduced three research challenges. Target Programming Languages Tangled Files Granularity of Clone Detection Finally, a summary of my presentation is here. Web applications have two characteristics and I introduced an inter-language clone caused by These characteristics. Then, I introduced three research challenges. That’s all. Thank you for listening.