Presentation is loading. Please wait.

Presentation is loading. Please wait.

Mining Logical Clones in Software: Revealing High-Level Business & Programming Rules Wenyi Qian 1, Xin Peng 1, Zhenchang Xing 2, Stan Jarzabek 3, Wenyun.

Similar presentations


Presentation on theme: "Mining Logical Clones in Software: Revealing High-Level Business & Programming Rules Wenyi Qian 1, Xin Peng 1, Zhenchang Xing 2, Stan Jarzabek 3, Wenyun."— Presentation transcript:

1 Mining Logical Clones in Software: Revealing High-Level Business & Programming Rules Wenyi Qian 1, Xin Peng 1, Zhenchang Xing 2, Stan Jarzabek 3, Wenyun Zhao 1 1 Fudan University, China 2 Nanyang Technological University, Singapore 3 National University of Singapore, Singapore

2 Logical Clones may not well documented revealing high-level rules

3 Logical Clones Logical clones consisting of: –Similar methods –Similar code fragments –Similar entity classes –Persistent data projects

4 Logical Clones Today’s techniques on clone/similarity detection: –Simple clone (text, token, AST…) –Structural clone (simple clone) –Similar design structures (similarity metrics, machine learning) They are not enough to detect high-level clones: –lack of high-level information –need of pre-defined templates, such as certain design pattern

5 Approach Overview input abstraction output

6 Program Model Methods & functional clusters Entity classes Code clones Persistent data objects

7 Program Model Methods & functional clusters –Semantic clustering

8 Program Model Entity classes –Encapsulating information with getter/setter

9 Program Model Code clones –Simple clones in different methods

10 Program Model Persistent data objects –Data tables in DB or data entries in files

11 Mining Process PosScreen processPay PosPayCheck PosScreen processPay PosPayGiftCard PosClearPayment PosScreen

12 Mining Process PosScreen processPay PosPayCheck PosScreen processPay PosPayGiftCard PosClearPayment PosScreen

13 Mining Process

14 PosScreen processPay PosPayCheck PosScreen processPay PosPayGiftCard PosClearPayment PosScreen

15 Mining Process

16 PosScreen processPay PosPayCheck PosScreen processPay PosPayGiftCard PosClearPayment PosScreen

17 Mining Process

18 Tool: MiLico

19 Case Study Project: Opentaps 1.4.0 –14,351 classes & interfaces –253,743 methods 1690 logical clones mined –at least 3 nodes & 2 instances

20 Case Study

21 Categories of Logical Clones Categories of Mined Logical Clones (manual work) –Programming Convention (37%) –Design Structure (24%) –Business Task (23%) –Business Process (16%)

22 Categories of Logical Clones Programming Convention –Similar ways to implement similar functions

23 Categories of Logical Clones Design Structure –Similar interaction structures

24 Categories of Logical Clones Business Task –Similar ways to implement similar business task

25 Categories of Logical Clones Business Process –Similar business process or sub-process

26 Human Study 5 senior graduate students, 2 questions: Helpful for Programming understanding? Helpful for Reuse/Evolution?

27 Human Study

28 5 senior graduate students, 2 questions: Helpful for Programming understanding? YES Helpful for Reuse/Evolution? YES

29 Discussion Helpful for reuse, without knowledge of code details Developers with good domain knowledge will use logical clones better Making MiLiCo integrated with IDEs will make logical clones more useful

30 Conclusion The concept of logical clones The approach for mining logical clones The tool: MiLoCo A case study, showing that logical clones are helpful in software understanding, reuse and maintainance

31 Thanks for your attention!


Download ppt "Mining Logical Clones in Software: Revealing High-Level Business & Programming Rules Wenyi Qian 1, Xin Peng 1, Zhenchang Xing 2, Stan Jarzabek 3, Wenyun."

Similar presentations


Ads by Google