Software Engineering Laboratory, Department of Computer Science, Graduate School of Information Science and Technology, Osaka University Applying Clone.

Slides:



Advertisements
Similar presentations
Software Engineering Laboratory, Department of Computer Science, Graduate School of Information Science and Technology, Osaka University A Preliminary.
Advertisements

Software Engineering Laboratory, Department of Computer Science, Graduate School of Information Science and Technology, Osaka University Identifying Source.
Software Engineering Laboratory, Department of Computer Science, Graduate School of Information Science and Technology, Osaka University Evolutional Analysis.
Software Engineering Laboratory, Department of Computer Science, Graduate School of Information Science and Technology, Osaka University Extraction of.
Software Engineering Laboratory, Department of Computer Science, Graduate School of Information Science and Technology, Osaka University Extracting Code.
A Tool Support to Merge Similar Methods with a Cohesion Metric COB ○ Masakazu Ioka 1, Norihiro Yoshida 2, Tomoo Masai 1,Yoshiki Higo 1, Katsuro Inoue 1.
Software Engineering Laboratory, Department of Computer Science, Graduate School of Information Science and Technology, Osaka University A Prototype of.
Refactoring Support Tool: Cancer Yoshiki Higo Osaka University.
Software Engineering Laboratory, Department of Computer Science, Graduate School of Information Science and Technology, Osaka University Industrial Application.
Software Engineering Laboratory, Department of Computer Science, Graduate School of Information Science and Technology, Osaka University ICSE 2003 Java.
Software Engineering Laboratory, Department of Computer Science, Graduate School of Information Science and Technology, Osaka University Finding Similar.
Detecting software clones in binaries Zaharije Radivojević, Saša Stojanović, Miloš Cvetanović School of Electrical Engineering, Belgrade University 14th.
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 1 Refactoring.
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.
Software Engineering Laboratory, Department of Computer Science, Graduate School of Information Science and Technology, Osaka University 1 ARIES: Refactoring.
Software Engineering Laboratory, Department of Computer Science, Graduate School of Information Science and Technology, Osaka University A Multi-Objective.
Department of Computer Science, Graduate School of Information Science & Technology, Osaka University A Method to Detect License Inconsistencies for Large-
Mining and Analysis of Control Structure Variant Clones Guo Qiao.
Software Engineering Laboratory, Department of Computer Science, Graduate School of Information Science and Technology, Osaka University Code-Clone Analysis.
2002/12/11PROFES20021 On software maintenance process improvement based on code clone analysis Yoshiki Higo* , Yasushi Ueda* , Toshihiro Kamiya** , Shinji.
Reishi Yokomori Nanzan University, Japan Harvey Siy University of Nebraska at Omaha, USA Norihiro Yoshida Nara Institute of Science and Technology, Japan.
Department of Computer Science, Graduate School of Information Science & Technology, Osaka University Detection and evolution analysis of code clones for.
CMCD: Count Matrix based Code Clone Detection Yang Yuan and Yao Guo Key Laboratory of High-Confidence Software Technologies (Ministry of Education) Peking.
1 Gemini: Maintenance Support Environment Based on Code Clone Analysis *Graduate School of Engineering Science, Osaka Univ. **PRESTO, Japan Science and.
Software Engineering Laboratory, Department of Computer Science, Graduate School of Information Science and Technology, Osaka University 1 Design and Implementation.
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.
Summarizing the Content of Large Traces to Facilitate the Understanding of the Behaviour of a Software System Abdelwahab Hamou-Lhadj Timothy Lethbridge.
SYSTEMSDESIGNANALYSIS 1 Chapter 20 Software Engineering Jerry Post Copyright © 1997.
Software Engineering Laboratory, Department of Computer Science, Graduate School of Information Science and Technology, Osaka University VerXCombo: An.
Software Engineering Laboratory, Department of Computer Science, Graduate School of Information Science and Technology, Osaka University Code-Clone Detection.
Presented by: Ashgan Fararooy Referenced Papers and Related Work on:
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.
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 July 21, 2008WODA.
Copyright © 2015 NTT DATA Corporation Kazuo Kobori, NTT DATA Corporation Makoto Matsushita, Osaka University Katsuro Inoue, Osaka University SANER2015.
Software Engineering Laboratory, Department of Computer Science, Graduate School of Information Science and Technology, Osaka University Finding Code Clones.
Software Engineering Laboratory, Department of Computer Science, Graduate School of Information Science and Technology, Osaka University IWPSE 2003 Program.
1 Measuring Similarity of Large Software System Based on Source Code Correspondence Tetsuo Yamamoto*, Makoto Matsushita**, Toshihiro Kamiya***, Katsuro.
Department of Computer Science, Graduate School of Information Science & Technology, Osaka University An Empirical Study of Out-dated Third-party Code.
Experience of Finding Inconsistently-Changed Bugs in Code Clones of Mobile Software Katsuro Inoue†, Yoshiki Higo†, Norihiro Yoshida†, Eunjong Choi†, Shinji.
Software Engineering Laboratory, Department of Computer Science, Graduate School of Information Science and Technology, Osaka University 1 Classification.
Software Engineering Laboratory, Department of Computer Science, Graduate School of Information Science and Technology, Osaka University 1 Extracting Sequence.
What kind of and how clones are refactored? A case study of three OSS projects WRT2012 June 1, Eunjong Choi†, Norihiro Yoshida‡, Katsuro Inoue†
Department of Computer Science, Graduate School of Information Science and Technology, Osaka University Towards a Collection of Refactoring Patterns Based.
1 Gemini: Code Clone Analysis Tool †Graduate School of Engineering Science, Osaka Univ., Japan ‡ Graduate School of Information Science and Technology,
Software Engineering Laboratory, Department of Computer Science, Graduate School of Information Science and Technology, Osaka University 1 Aries: Refactoring.
Department of Computer Science, Graduate School of Information Science & Technology, Osaka University Detection of License Inconsistencies in Free and.
Department of Computer Science, Graduate School of Information Science & Technology, Osaka University A Metric-based Approach for Reconstructing Methods.
Estimating Code Size After a Complete Code-Clone Merge Buford Edwards III, Yuhao Wu, Makoto Matsushita, Katsuro Inoue 1 Graduate School of Information.
Naoya Ujihara1, Ali Ouni2, Takashi Ishio1, Katsuro Inoue1
Do Developers Focus on Severe Code Smells?
Empirical Project Monitor and Results from 100 OSS Development Projects Masao Ohira Empirical Software Engineering Research Laboratory, Nara Institute.
Ruru Yue1, Na Meng2, Qianxiang Wang1 1Peking University 2Virginia Tech
Yuta Nakamura1, Eunjong Choi1, Norihiro Yoshida2,
○Yuichi Semura1, Norihiro Yoshida2, Eunjong Choi3, Katsuro Inoue1
Predicting Fault-Prone Modules Based on Metrics Transitions
Refactoring Support Tool: Cancer
Quaid-i-Azam University
Yuhao Wu1, Yuki Manabe2, Daniel M. German3, Katsuro Inoue1
Daniel Kim Software Engineering Laboratory Professor Katsuro Inoue
On Refactoring Support Based on Code Clone Dependency Relation
Where Does This Code Come from and Where Does It Go?
Research Activities of Software Engineering Lab in Osaka University
Presentation transcript:

Software Engineering Laboratory, Department of Computer Science, Graduate School of Information Science and Technology, Osaka University Applying Clone Change Notification System into an Industrial Development Process Yuki Yamanaka 1, Eunjong Choi 1, Norihiro Yoshida 2, Katsuro Inoue 1, Tateki Sano 3 1 Osaka University, Japan 2 Nara Institute of Science and Technology, Japan 3 NEC Corporation, Japan 1

Department of Computer Science, Graduate School of Information Science and Technology, Osaka University Contents 1.Background 2.Clone Notifier 3.Industrial Application 4.Summary and Future Work 2

Department of Computer Science, Graduate School of Information Science and Technology, Osaka University What is Code Clone ? A code fragment that has similar or identical part in source code 3 Code Clone Clone Set † † Clone Set: a set of code clones identical or similar to each other

Department of Computer Science, Graduate School of Information Science and Technology, Osaka University Maintaining Code Clones (1/2) Consistent modification –Modifying code clones in a single clone set consistently 4 Include Bugs Remove Bugs Consistent Modification Old VersionNew Version

Department of Computer Science, Graduate School of Information Science and Technology, Osaka University Maintaining Code Clones (2/2) Refactoring –Merging clone set into a single program unit 5 Remove Code Clones call Merging Old Version New Version

Department of Computer Science, Graduate School of Information Science and Technology, Osaka University Clone Detection Tool : CCFinder [1] A token-based clone detection tool –Transform source code into sequence of tokens –Detect identical parts of the sequence as code clones High speed and accuracy 6 InputOutput Source Files Location Information of Code Clone CCFinder [1] T. Kamiya, S. Kusumoto, and K. Inoue, “CCFinder: A multilinguistic token-based code clone detection system for large scale source code”, IEEE Transactions on Software Engineering, 28(7): , 2002.

Department of Computer Science, Graduate School of Information Science and Technology, Osaka University Clone Change Management Besides CCFinder, various clone detection tools have been proposed. Developers have to find targets of refactoring or consistent modification manually. 7 It is necessary to perform clone change management.

Department of Computer Science, Graduate School of Information Science and Technology, Osaka University Newly-appeared code clones are candidates for refactoring. 8 New Version Old Version copy Examples of Clone Change Management (1/2)

Department of Computer Science, Graduate School of Information Science and Technology, Osaka University Examples of Clone Change Management (2/2) Inconsistent modified clone sets may introduce bugs into source code. 9 modify New Version Old Version Include bugs

Department of Computer Science, Graduate School of Information Science and Technology, Osaka University Industrial Motivation Touching source code after large-scale test may increase risk of defect. Automatic clone change management is highly motivated for reducing cost of maintaining code clones. 10 We need the daily clone change notification system.

Department of Computer Science, Graduate School of Information Science and Technology, Osaka University Overview of Our Study Develop clone change notification system Clone Notifier. Investigate the usefulness of Clone Notifier for industrial development process in NEC. 11

Department of Computer Science, Graduate School of Information Science and Technology, Osaka University Contents 1.Background 2.Clone Notifier 3.Industrial Application 4.Summary and Future Work 12

Department of Computer Science, Graduate School of Information Science and Technology, Osaka University Overview of Clone Notifier Developer Version Control System Commit source code Checkout source code Report change information notification Web-based UI Clone Notifier Categorize clone sets 13 According to opinions of developer

Department of Computer Science, Graduate School of Information Science and Technology, Osaka University Process of Clone Notifier Step1: Checkout source code Step2: Detect code clones Step3: Trace clone evolution Step4: Categorize code clones Step5: Categorize clone sets 14

Department of Computer Science, Graduate School of Information Science and Technology, Osaka University Step1: Checkout Source Code 15 Gain source code from version control system New Version Old Version

Department of Computer Science, Graduate School of Information Science and Technology, Osaka University Step2: Detect Code Clones 16 Apply CCFinder into two versions New Version Old Version

Department of Computer Science, Graduate School of Information Science and Technology, Osaka University Trace code clones based on correspondence between start and end points of code fragments Step3: Trace Clone Evolution New Version Old Version Correspond 17

Department of Computer Science, Graduate School of Information Science and Technology, Osaka University Step4: Categorize Code Clones Old Version 18 Categorize code clones based on evolution patterns of them New Version Old Version New Version Old Version

Department of Computer Science, Graduate School of Information Science and Technology, Osaka University Step4: Categorize Code Clones Old Version 19 Categorize code clones based on evolution patterns of them New Version Old Version New Version Old Version Not modified Stable

Department of Computer Science, Graduate School of Information Science and Technology, Osaka University Step4: Categorize Code Clones Old Version 20 Categorize code clones based on evolution patterns of them New Version Old Version New Version Old Version Not modified Stable Added

Department of Computer Science, Graduate School of Information Science and Technology, Osaka University Step4: Categorize Code Clones Old Version 21 Categorize code clones based on evolution patterns of them New Version Old Version New Version Old Version Not modified Stable Added Modified

Department of Computer Science, Graduate School of Information Science and Technology, Osaka University New Version Old Version 22 Not modified Stable Categorize code clones based on evolution patterns of them Modified Added Deleted Step4: Categorize Code Clones

Department of Computer Science, Graduate School of Information Science and Technology, Osaka University Step5: Categorize Clone Set 23 Stable Clone Set –Share only stable clones between two versions Changed Clone Set –Share modified, added and deleted clones between two versions New Clone Set –Share only added clones between two versions Deleted Clone Set –Share only deleted clones between two versions

Department of Computer Science, Graduate School of Information Science and Technology, Osaka University Example of Stable Clone Set Clone Set A Stable Clone Set A Stable New VersionOld Version Stable By ignoring this clone set, the cost of finding candidates for maintenance can be reduced. Stable 24

Department of Computer Science, Graduate School of Information Science and Technology, Osaka University Example of Changed Clone Set Modified Clone Set A Stable Clone Set A Modify Stable Modified New VersionOld Version Stable According to the report on this clone set, developers can notice forgotten modifications. 25

Department of Computer Science, Graduate School of Information Science and Technology, Osaka University Example of New Clone Set Added Clone Set A Added New VersionOld Version copy This clone set may be candidate for refactoring 26

Department of Computer Science, Graduate School of Information Science and Technology, Osaka University Example of Deleted Clone Set Clone Set A Stable Deleted New Version Old Version Stable Deleted Refactoring Deleted According to the report on this clone set. developers can confirm to perform refactoring. 27

Department of Computer Science, Graduate School of Information Science and Technology, Osaka University Notification UIs notification –Send an initial report of change information of code clones Web-based UI –Help developers to understand the detail of change information of code clones 28

Department of Computer Science, Graduate School of Information Science and Technology, Osaka University Example of Notification \src\main\org\apache\tools\ant\listener\MailLogger.java \src\main\org\apache\tools\ant\filters\FixCrLfFilter.java \src\main\org\apache\tools\ant\filters\FixCrLfFilter.java \src\main\org\apache\tools\ant\taskdefs\MacroInstance.java ### \src\main\org\apache\tools\ant\listener\MailLogger.java 372 } 373 // convert the replyTo string into a vector of addresses 374 Vector replyToList = vectorize Addresses(values.replytoList()); 375 mailer.setHost(values.mailhost()); 376 mailer.setPort(values.port()); 377 mailer.setUser(values.user()); 378 mailer.setPassword(values.password()); 379 mailer.setSSL(values.ssl()); mailer.setEnableStartTLS(values.starttls()); - mailer.setEnableStartTLS(values.ssl()); 381 Message mymessage = 382 new Message(values.body().length() > 0 ? values.body() : message); 383 mymessage.setProject(project); Clone Set ID Code Clone List Code Fragment Code Clone ID CategorySource File Location Information 29

Department of Computer Science, Graduate School of Information Science and Technology, Osaka University 30 Screenshots of Web-based UI Clone Set List Page Users can confirm detail of change information of code clones Source File Page

Department of Computer Science, Graduate School of Information Science and Technology, Osaka University Contents 1.Background 2.Clone Notifier 3.Industrial Application 4.Summary and Future Work 31

Department of Computer Science, Graduate School of Information Science and Technology, Osaka University Industrial Application (1/2) Apply Clone Notifier to development process in NEC Do the questionnaire and get feedback from a industrial developer in NEC 32 Clone Notifier Daily Report Questionnaire Feedback DeveloperAuthors

Department of Computer Science, Graduate School of Information Science and Technology, Osaka University Industrial Application (2/2) Term –December 19, January 31, 2012 ( 40days ) Project – Web application system – 6 programmers –120 KLOC, 350 files, written in Java Target of questionnaire –A project manager –10 years of development experiences of Java 33

Department of Computer Science, Graduate School of Information Science and Technology, Osaka University Candidates for Maintenance 34 DateCategory Method of Maintenance 1Dec. 28, 2011NewRefactoring 2Dec. 28, 2011NewRefactoring 3Jan. 13, 2012NewRefactoring 4Jan. 13, 2012NewComment 5Jan. 13, 2012NewRefactoring 6Jan. 13, 2012NewRefactoring 7Jan. 13, 2012NewRefactoring 8Jan. 16, 2012NewRefactoring 9Jan. 16, 2012NewRefactoring 10Jan. 18, 2012NewRefactoring 11Jan. 24, 2012NewRefactoring

Department of Computer Science, Graduate School of Information Science and Technology, Osaka University DateCategory Method of Maintenance 1Dec. 28, 2011NewRefactoring 2Dec. 28, 2011NewRefactoring 3Jan. 13, 2012NewRefactoring 4Jan. 13, 2012NewComment 5Jan. 13, 2012NewRefactoring 6Jan. 13, 2012NewRefactoring 7Jan. 13, 2012NewRefactoring 8Jan. 16, 2012NewRefactoring 9Jan. 16, 2012NewRefactoring 10Jan. 18, 2012NewRefactoring 11Jan. 24, 2012NewRefactoring Candidates for Maintenance 35 All candidates are newly-appeared clone sets.

Department of Computer Science, Graduate School of Information Science and Technology, Osaka University DateCategory Method of Maintenance 1Dec. 28, 2011NewRefactoring 2Dec. 28, 2011NewRefactoring 3Jan. 13, 2012NewRefactoring 4Jan. 13, 2012NewComment 5Jan. 13, 2012NewRefactoring 6Jan. 13, 2012NewRefactoring 7Jan. 13, 2012NewRefactoring 8Jan. 16, 2012NewRefactoring 9Jan. 16, 2012NewRefactoring 10Jan. 18, 2012NewRefactoring 11Jan. 24, 2012NewRefactoring 36 Almost of candidates needed refactoring! Candidates for Maintenance

Department of Computer Science, Graduate School of Information Science and Technology, Osaka University DateCategory Method of Maintenance 1Dec. 28, 2011NewRefactoring 2Dec. 28, 2011NewRefactoring 3Jan. 13, 2012NewRefactoring 4Jan. 13, 2012NewComment 5Jan. 13, 2012NewRefactoring 6Jan. 13, 2012NewRefactoring 7Jan. 13, 2012NewRefactoring 8Jan. 16, 2012NewRefactoring 9Jan. 16, 2012NewRefactoring 10Jan. 18, 2012NewRefactoring 11Jan. 24, 2012NewRefactoring 37 Candidates for Maintenance Add comment on the location of code clones in source code

Department of Computer Science, Graduate School of Information Science and Technology, Osaka University Analysis of Application Result 38 Collect data for the techniques of recommend refactoring candidates Help developers to reduce the cost of finding refactoring candidates We observed the characteristics of refactoring candidate.

Department of Computer Science, Graduate School of Information Science and Technology, Osaka University Findings (1/2) All refactoring candidates are newly-appeared by adding new code. We reduced candidates that are newly-appeared by only code replacement and deletion % of clone sets were reduced.

Department of Computer Science, Graduate School of Information Science and Technology, Osaka University Findings (2/2) All refactoring candidates include whole parts of loop or branch statements. We reduced candidates by eliminating syntactically incomplete clone sets % of clone sets were reduced.

Department of Computer Science, Graduate School of Information Science and Technology, Osaka University Contents 1.Background 2.Clone Notifier 3.Industrial Application 4.Summary and Future Work 41

Department of Computer Science, Graduate School of Information Science and Technology, Osaka University Summary Developed a Clone Notifier based on opinions of industrial developers in NEC Confirmed the usefulness of it by applying to the industrial development process –Clone Notifier has been used in NEC. Investigated the characteristics of clone sets recognized as refactoring 42

Department of Computer Science, Graduate School of Information Science and Technology, Osaka University Future Work Integrate the filtering techniques with Clone Notifier based on findings of investigation Conduct longer-term case study 43

Software Engineering Laboratory, Department of Computer Science, Graduate School of Information Science and Technology, Osaka University Thank you! 44