1 / 31

Mining Logical Clones in Software: Revealing High-Level Business & Programming Rules

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.

wood
Télécharger la présentation

Mining Logical Clones in Software: Revealing High-Level Business & Programming Rules

An Image/Link below is provided (as is) to download presentation Download Policy: Content on the Website is provided to you AS IS for your information and personal use and may not be sold / licensed / shared on other websites without getting consent from its author. Content is provided to you AS IS for your information and personal use only. Download presentation by click this link. While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server. During download, if you can't get a presentation, the file might be deleted by the publisher.

E N D

Presentation Transcript


  1. Mining Logical Clones in Software:Revealing High-Level Business & Programming Rules Wenyi Qian1, XinPeng1, ZhenchangXing2, Stan Jarzabek3, Wenyun Zhao1 1Fudan University, China 2Nanyang Technological University, Singapore 3National 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 output input abstraction

  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 <Method> <Method> PosClearPayment PosPayCheck <Entity class> <Entity class> PosScreen <Method> PosScreen processPay PosPayGiftCard <Method> <Entity class> PosScreen processPay <Method>

  12. Mining Process <Method> <Method> PosClearPayment PosPayCheck <Entity class> <Entity class> PosScreen <Method> PosScreen processPay PosPayGiftCard <Method> <Entity class> PosScreen processPay <Method>

  13. Mining Process

  14. Mining Process <Method> <Method> PosClearPayment PosPayCheck <Entity class> <Entity class> PosScreen <Method> PosScreen processPay PosPayGiftCard <Method> <Entity class> PosScreen processPay <Method>

  15. Mining Process

  16. Mining Process <Method> <Method> PosClearPayment PosPayCheck <Entity class> <Entity class> PosScreen <Method> PosScreen processPay PosPayGiftCard <Method> <Entity class> PosScreen processPay <Method>

  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. Human Study • 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!

More Related