SlideShare a Scribd company logo
Experiments on Design Pattern Discovery Jing Dong and Yajing Zhao Department of Computer Science The University of Texas at Dallas {jdong, yxz045100}@utdallas.edu
Outline Introduction Related Work Our Approach Experiment Data Result and Discussion Precision and Recall Benchmark Conclusion and Future Work
Introduction Difficult to understand large computer-based systems No original architecture and design Patterns help on understanding systems Patterns embed future change of systems Need of design pattern discovery since patterns are lost in source code
Introduction (Cont’d) DP-Miner Experiment data: System source code JUnit JEdit JHotDraw Java.AWT Such experiments lead to benchmarks
Related Work X Flyweight X Facade X X Chain of Responsibility X X Builder X X X Abstract Factory X X X X X X X X X X Balanyi 2003 X X Command X X X Proxy X X X X X X Composite X X X X X Decorator X X X X Factory Method X X X X Observer X X Prototype X X X X Singleton X X X X Strategy X X X Template Method X X X Visitor X X X X Bridge X X X X Adapter Gueheneuc 2006 Shi 2006 Blewitt 2001 Niere 2002 Heuzeroth 2003 Antoniol 1998 Tsantalis 2006 Authors Tools
Our Approach – DP-Miner Matrix and Weight Product of Prime Numbers Structural, Behavioral, and Semantic Analysis
Experiment Data JUnit: A regression test framework that helps developers to implement unit tests in Java. JEdit: A mature and easy-to-use text editor. JHotDraw: A two dimensional graphics frameworks for technical and structured drawing editors written in Java.  Java.AWT: A library for developing graphical user interfaces for Java programs.
Why Those Four Systems as Data? At the time they were developed, the idea of design patterns is already mature and widely applied. Other works on design pattern discovery use one or more of these systems to evaluate their approaches, which allows us to compare and evaluate our experiment results.
Experiment Data System information Version Number of Classes Number of Files 484 530 6.0 beta 1 JHotDraw 394 1001 4.2 JEdit 93 126 3.8.2 JUnit 345 570 JDK1.4.2 Java.AWT File # Class # Version Systems
Experiment Result 64 24 6 76 Strategy 0 58 4 JHotDraw 0 24 17 JEdit 3 6 3 JUnit 3 65 21 Java.AWT Composite Bridge Adapter Systems
Experiment Result – Java.AWT Results for Each Analysis Phase N/A 76 65 N/A Semantic Analysis 3 3 92 Composite 76 76 100 Strategy 65 76 100 Bridge 21 21 57 Adapter Final Result Behavioral Analysis Structural Analysis Systems Java.AWT
Experiment Result – JUnit Results for Each Analysis Phase N/A 6 6 N/A Semantic Analysis 3 6 6 3 Final Result 3 9 Composite 6 6 Strategy 6 6 Bridge 3 15 Adapter Behavioral Analysis Structural Analysis Systems JUnit
Experiment Result – JEdit Results for Each Analysis Phase N/A 24 24 N/A Semantic Analysis 0 0 0 Composite 24 24 33 Strategy 24 24 33 Bridge 17 17 80 Adapter Final Result Behavioral Analysis Structural Analysis Systems JEdit
Experiment Result – JHotDraw Results for Each Analysis Phase N/A 64 58 N/A Semantic Analysis 0 0 0 Composite 64 64 74 Strategy 58 64 74 Bridge 4 4 27 Adapter Final Result Behavioral Analysis Structural Analysis Systems JHotDraw
Observations Behavioral analysis phase only deals with a small number of classes, since it’s based on the result of structural analysis phase. Significant reduction of the candidates between structural and behavioral analysis of Adapter and Composite pattern than those of Bridge and Strategy patterns, since the former have more behavioral characteristics than the latter do. Result of structural and behavioral analysis of the Bridge and Strategy patterns are the same, since they have same structural and behavioral characteristics and only differ in their intents.
Recovery Precisions for JHotDraw Manually checked the results generated by our tool and see whether they are real pattern instances.  TP: True Positive FP: False Positive 100% 0 0 Composite 90.63% 6 58 Strategy 91.38% 5 53 Bridge 100% 0 4 Adapter Precision  FP TP JHotDraw
Instances Missed Instances manually found but missed by DP-Miner Recall: 89.23% DrawingView SelectionTool [7] Locator LocatorConnector [6] Locator LocatorHandle [5] Locator PolygonHandle [4] Connector ConnectionTool [3] Connector ChangeConnectionHandle [2] Connector LineConnection [1] STRATEGY CONTEXT
Reasons of Discrepancy Flexibility of design pattern Composite pattern: Collapse both the Component and Composite classes into a single class or not. Adapter pattern: Full matching all three roles, i.e. Target, Adapter, and Adaptee, or partial matching of only Adapter and Adaptee.  Object-oriented programming languages provide special language constructs that greatly simplify the implementation of a design pattern. E.g., Java provides LinkedList, ArrayList, HashMap, and Hashtable, which make the implementation of aggregate elements in patterns easy, but the detection harder.
Benchmark Correct number of pattern instances and their locations are generally not available. Lacking benchmarks is the main impediment  Hard to evaluate and compare design pattern discovery techniques. Hard to judge whether an approach discovers all instances and whether the discovered ones are correct. To calculate the precision and recall of a pattern matching result, it’s essential to know  The number of correct pattern instances  The locations of correct pattern instances JHotDraw pattern benchmark
Conclusion We did a series of experiments on design pattern discovery from open-source systems using DP-Miner Patterns concerned: Adapter, Bridge, Strategy, Composite Experiment data: Java.AWT, JUnit, JEdit, JHotDraw We compared our experiment results with others and found several discrepancies. We analyzed the issues and discussed possible reasons. We argue for benchmarks for design pattern discovery.
Future Work Improve our tool. Experiment on other systems  Manually check results of other systems and perfect the benchmark Research on other object-oriented languages, such as C++.
Thank You!
Questions?
Overall Architecture of Our Approach System    Design Pattern match Source Code Intermediate Representation
Structural Analysis – Matrix
1 1 1 1 7 1 1 1 1 TextComponent 1 1 1 1 7 1 1 1 1 Scrollbar 1 1 1 1 7 1 1 1 1 Label 1 1 1 1 35 1 1 1 1 Container 1 1 1 5 1 1 1 1 1 Component 1 1 1 1 7 1 1 1 1 Choice 1 1 1 1 7 1 1 1 1 Checkbox 1 1 1 1 7 1 1 1 1 Canvas 1 1 1 1 7 1 1 1 1 Button TextComponent Scrollbar Label Container Component Choice Checkbox Canvas Button
1 1 1 1 7 1 1 1 1 TextComponent 1 1 1 1 7 1 1 1 1 Scrollbar 1 1 1 1 7 1 1 1 1 Label 1 1 1 1 35 1 1 1 1 Container 1 1 1 5 1 1 1 1 1 Component 1 1 1 1 7 1 1 1 1 Choice 1 1 1 1 7 1 1 1 1 Checkbox 1 1 1 1 7 1 1 1 1 Canvas 1 1 1 1 7 1 1 1 1 Button TextComponent Scrollbar Label Container Component Choice Checkbox Canvas Button 1 35 1 Composite 1 1 1 Component 1 7 1 Leaf Composite Component Leaf

More Related Content

PPT
Using Developer Information as a Prediction Factor
Tim Menzies
 
PPT
Complexity Measures for Secure Service-Orieted Software Architectures
Tim Menzies
 
PPT
Assessing the Reliability of a Human Estimator
Tim Menzies
 
PPT
Make the Most of Your Time: How Should the Analyst Work with Automated Tracea...
Tim Menzies
 
PPT
Promise Keynote
Tim Menzies
 
PPT
Decision Support Analyss for Software Effort Estimation by Analogy
Tim Menzies
 
PDF
A survey of fault prediction using machine learning algorithms
Ahmed Magdy Ezzeldin, MSc.
 
PDF
AI-Driven Software Quality Assurance in the Age of DevOps
Chakkrit (Kla) Tantithamthavorn
 
Using Developer Information as a Prediction Factor
Tim Menzies
 
Complexity Measures for Secure Service-Orieted Software Architectures
Tim Menzies
 
Assessing the Reliability of a Human Estimator
Tim Menzies
 
Make the Most of Your Time: How Should the Analyst Work with Automated Tracea...
Tim Menzies
 
Promise Keynote
Tim Menzies
 
Decision Support Analyss for Software Effort Estimation by Analogy
Tim Menzies
 
A survey of fault prediction using machine learning algorithms
Ahmed Magdy Ezzeldin, MSc.
 
AI-Driven Software Quality Assurance in the Age of DevOps
Chakkrit (Kla) Tantithamthavorn
 

What's hot (20)

PDF
Towards a Better Understanding of the Impact of Experimental Components on De...
Chakkrit (Kla) Tantithamthavorn
 
PDF
The adoption of machine learning techniques for software defect prediction: A...
RAKESH RANA
 
PDF
An Empirical Comparison of Model Validation Techniques for Defect Prediction ...
Chakkrit (Kla) Tantithamthavorn
 
PDF
Instance Space Analysis for Search Based Software Engineering
Aldeida Aleti
 
PDF
Software Analytics In Action: A Hands-on Tutorial on Mining, Analyzing, Model...
Chakkrit (Kla) Tantithamthavorn
 
PDF
Leveraging HPC Resources to Improve the Experimental Design of Software Analy...
Chakkrit (Kla) Tantithamthavorn
 
PPT
Formal Method for Avionics Software Verification
AdaCore
 
PDF
Speeding-up Software Testing With Computational Intelligence
Annibale Panichella
 
PPTX
A software fault localization technique based on program mutations
Tao He
 
PDF
Model-Driven Run-Time Enforcement of Complex Role-Based Access Control Policies
Lionel Briand
 
PPTX
Odin2018_Minh_ML_Risk_Prediction
Minh Nguyen
 
PPTX
StratCel: A Strategy-Centric Approach to the Design of End-User Debugging Tools
hciresearch
 
PDF
Evaluating Model Testing and Model Checking for Finding Requirements Violatio...
Lionel Briand
 
PDF
Automated parameter optimization should be included in future 
defect predict...
Chakkrit (Kla) Tantithamthavorn
 
PDF
Explainable Artificial Intelligence (XAI) 
to Predict and Explain Future Soft...
Chakkrit (Kla) Tantithamthavorn
 
PPT
Formal meth
memoalwandy
 
PDF
[Tho Quan] Fault Localization - Where is the root cause of a bug?
Ho Chi Minh City Software Testing Club
 
PPT
Testing 2 - Thinking Like A Tester
ArleneAndrews2
 
PDF
Ssbse12b.ppt
Ptidej Team
 
PDF
The Impact of Class Rebalancing Techniques on the Performance and Interpretat...
Chakkrit (Kla) Tantithamthavorn
 
Towards a Better Understanding of the Impact of Experimental Components on De...
Chakkrit (Kla) Tantithamthavorn
 
The adoption of machine learning techniques for software defect prediction: A...
RAKESH RANA
 
An Empirical Comparison of Model Validation Techniques for Defect Prediction ...
Chakkrit (Kla) Tantithamthavorn
 
Instance Space Analysis for Search Based Software Engineering
Aldeida Aleti
 
Software Analytics In Action: A Hands-on Tutorial on Mining, Analyzing, Model...
Chakkrit (Kla) Tantithamthavorn
 
Leveraging HPC Resources to Improve the Experimental Design of Software Analy...
Chakkrit (Kla) Tantithamthavorn
 
Formal Method for Avionics Software Verification
AdaCore
 
Speeding-up Software Testing With Computational Intelligence
Annibale Panichella
 
A software fault localization technique based on program mutations
Tao He
 
Model-Driven Run-Time Enforcement of Complex Role-Based Access Control Policies
Lionel Briand
 
Odin2018_Minh_ML_Risk_Prediction
Minh Nguyen
 
StratCel: A Strategy-Centric Approach to the Design of End-User Debugging Tools
hciresearch
 
Evaluating Model Testing and Model Checking for Finding Requirements Violatio...
Lionel Briand
 
Automated parameter optimization should be included in future 
defect predict...
Chakkrit (Kla) Tantithamthavorn
 
Explainable Artificial Intelligence (XAI) 
to Predict and Explain Future Soft...
Chakkrit (Kla) Tantithamthavorn
 
Formal meth
memoalwandy
 
[Tho Quan] Fault Localization - Where is the root cause of a bug?
Ho Chi Minh City Software Testing Club
 
Testing 2 - Thinking Like A Tester
ArleneAndrews2
 
Ssbse12b.ppt
Ptidej Team
 
The Impact of Class Rebalancing Techniques on the Performance and Interpretat...
Chakkrit (Kla) Tantithamthavorn
 
Ad

Viewers also liked (20)

PPT
Plan De Trabajo
kundera
 
PPT
06 Dic02
Hei Monroy
 
PPS
If you want loyalty...
Bea Tosta
 
PPT
06 Dic09
Hei Monroy
 
PPS
APRENDA PORTUGUES
pedronr3
 
PPT
06 D I C16
Hei Monroy
 
PPT
07 Ene20
Hei Monroy
 
PPS
DESFILADEIRO DE COLORADO
pedronr3
 
PPT
Spring Trip 2007 Texas Style
Alyson Esch
 
PPT
Memorias
fdorb
 
PPT
El blues del pasota
aep
 
PPS
Violeta
Cristina de Ross
 
PPT
07 Ene6
Hei Monroy
 
PPS
O Mundo Em Miniatura
JASG
 
PDF
Archeologia Della Società Di Massa Ver 3.3 Teorie Marcobinotto
Marco Binotto
 
PPT
Workshops2
issseminar
 
PPT
Cicle Reflexiu
Raül Fernández
 
PPS
Subaru Policia Francia
corindu
 
PPT
Project Data Incorporating Qualitative Factors for Improved Software Defect P...
Tim Menzies
 
PPT
DARPA Grand Challenge
jabret
 
Plan De Trabajo
kundera
 
06 Dic02
Hei Monroy
 
If you want loyalty...
Bea Tosta
 
06 Dic09
Hei Monroy
 
APRENDA PORTUGUES
pedronr3
 
06 D I C16
Hei Monroy
 
07 Ene20
Hei Monroy
 
DESFILADEIRO DE COLORADO
pedronr3
 
Spring Trip 2007 Texas Style
Alyson Esch
 
Memorias
fdorb
 
El blues del pasota
aep
 
07 Ene6
Hei Monroy
 
O Mundo Em Miniatura
JASG
 
Archeologia Della Società Di Massa Ver 3.3 Teorie Marcobinotto
Marco Binotto
 
Workshops2
issseminar
 
Cicle Reflexiu
Raül Fernández
 
Subaru Policia Francia
corindu
 
Project Data Incorporating Qualitative Factors for Improved Software Defect P...
Tim Menzies
 
DARPA Grand Challenge
jabret
 
Ad

Similar to Experiments on Design Pattern Discovery (20)

PDF
MSR Asia Summit
Ptidej Team
 
PPTX
Metabolomic Data Analysis Workshop and Tutorials (2014)
Dmitry Grapov
 
PDF
IRJET- Deep Learning Model to Predict Hardware Performance
IRJET Journal
 
PDF
IRJET- Analysis of PV Fed Vector Controlled Induction Motor Drive
IRJET Journal
 
PDF
Analyzing the solutions of DEA through information visualization and data min...
Gurdal Ertek
 
PDF
Generation of Random EMF Models for Benchmarks
Markus Scheidgen
 
PDF
IRJET- Sentimental Analysis for Online Reviews using Machine Learning Algorithms
IRJET Journal
 
PDF
poster_3.0
Stefano Sansone
 
PDF
Ase02 dmp.ppt
Yann-Gaël Guéhéneuc
 
PDF
EXPERIMENTAL EVALUATION AND RESULT DISCUSSION OF METAMORPHIC TESTING AUTOMATI...
IAEME Publication
 
PPTX
Lessons Learned from Building Machine Learning Software at Netflix
Justin Basilico
 
PPTX
Machine Learning - Simple Linear Regression
Siddharth Shrivastava
 
PPT
3 analysis and design overview
Châu Thanh Chương
 
PDF
Next directions in Mahout's recommenders
sscdotopen
 
PDF
Overview of Movie Recommendation System using Machine learning by R programmi...
IRJET Journal
 
PPTX
Towards better software quality assurance by providing intelligent support
Concordia University
 
PPTX
Scalable constrained spectral clustering
Nishanth Harapanahalli
 
PDF
A Hierarchical Feature Set optimization for effective code change based Defec...
IOSR Journals
 
PPTX
Bug prediction + sdlc automation
Alexey Tokar
 
PPT
Presentation
butest
 
MSR Asia Summit
Ptidej Team
 
Metabolomic Data Analysis Workshop and Tutorials (2014)
Dmitry Grapov
 
IRJET- Deep Learning Model to Predict Hardware Performance
IRJET Journal
 
IRJET- Analysis of PV Fed Vector Controlled Induction Motor Drive
IRJET Journal
 
Analyzing the solutions of DEA through information visualization and data min...
Gurdal Ertek
 
Generation of Random EMF Models for Benchmarks
Markus Scheidgen
 
IRJET- Sentimental Analysis for Online Reviews using Machine Learning Algorithms
IRJET Journal
 
poster_3.0
Stefano Sansone
 
Ase02 dmp.ppt
Yann-Gaël Guéhéneuc
 
EXPERIMENTAL EVALUATION AND RESULT DISCUSSION OF METAMORPHIC TESTING AUTOMATI...
IAEME Publication
 
Lessons Learned from Building Machine Learning Software at Netflix
Justin Basilico
 
Machine Learning - Simple Linear Regression
Siddharth Shrivastava
 
3 analysis and design overview
Châu Thanh Chương
 
Next directions in Mahout's recommenders
sscdotopen
 
Overview of Movie Recommendation System using Machine learning by R programmi...
IRJET Journal
 
Towards better software quality assurance by providing intelligent support
Concordia University
 
Scalable constrained spectral clustering
Nishanth Harapanahalli
 
A Hierarchical Feature Set optimization for effective code change based Defec...
IOSR Journals
 
Bug prediction + sdlc automation
Alexey Tokar
 
Presentation
butest
 

Recently uploaded (20)

PDF
MASTERDECK GRAPHSUMMIT SYDNEY (Public).pdf
Neo4j
 
PPTX
cloud computing vai.pptx for the project
vaibhavdobariyal79
 
PDF
SparkLabs Primer on Artificial Intelligence 2025
SparkLabs Group
 
PDF
Doc9.....................................
SofiaCollazos
 
PPTX
Applied-Statistics-Mastering-Data-Driven-Decisions.pptx
parmaryashparmaryash
 
PDF
Economic Impact of Data Centres to the Malaysian Economy
flintglobalapac
 
PDF
Tea4chat - another LLM Project by Kerem Atam
a0m0rajab1
 
PPTX
AI and Robotics for Human Well-being.pptx
JAYMIN SUTHAR
 
PPTX
AI in Daily Life: How Artificial Intelligence Helps Us Every Day
vanshrpatil7
 
PPTX
Agile Chennai 18-19 July 2025 | Emerging patterns in Agentic AI by Bharani Su...
AgileNetwork
 
PDF
How ETL Control Logic Keeps Your Pipelines Safe and Reliable.pdf
Stryv Solutions Pvt. Ltd.
 
PPTX
Agile Chennai 18-19 July 2025 Ideathon | AI Powered Microfinance Literacy Gui...
AgileNetwork
 
PDF
Responsible AI and AI Ethics - By Sylvester Ebhonu
Sylvester Ebhonu
 
PDF
GDG Cloud Munich - Intro - Luiz Carneiro - #BuildWithAI - July - Abdel.pdf
Luiz Carneiro
 
PDF
Get More from Fiori Automation - What’s New, What Works, and What’s Next.pdf
Precisely
 
PDF
Google I/O Extended 2025 Baku - all ppts
HusseinMalikMammadli
 
PDF
A Strategic Analysis of the MVNO Wave in Emerging Markets.pdf
IPLOOK Networks
 
PDF
Accelerating Oracle Database 23ai Troubleshooting with Oracle AHF Fleet Insig...
Sandesh Rao
 
PDF
CIFDAQ's Market Wrap : Bears Back in Control?
CIFDAQ
 
PPTX
Introduction to Flutter by Ayush Desai.pptx
ayushdesai204
 
MASTERDECK GRAPHSUMMIT SYDNEY (Public).pdf
Neo4j
 
cloud computing vai.pptx for the project
vaibhavdobariyal79
 
SparkLabs Primer on Artificial Intelligence 2025
SparkLabs Group
 
Doc9.....................................
SofiaCollazos
 
Applied-Statistics-Mastering-Data-Driven-Decisions.pptx
parmaryashparmaryash
 
Economic Impact of Data Centres to the Malaysian Economy
flintglobalapac
 
Tea4chat - another LLM Project by Kerem Atam
a0m0rajab1
 
AI and Robotics for Human Well-being.pptx
JAYMIN SUTHAR
 
AI in Daily Life: How Artificial Intelligence Helps Us Every Day
vanshrpatil7
 
Agile Chennai 18-19 July 2025 | Emerging patterns in Agentic AI by Bharani Su...
AgileNetwork
 
How ETL Control Logic Keeps Your Pipelines Safe and Reliable.pdf
Stryv Solutions Pvt. Ltd.
 
Agile Chennai 18-19 July 2025 Ideathon | AI Powered Microfinance Literacy Gui...
AgileNetwork
 
Responsible AI and AI Ethics - By Sylvester Ebhonu
Sylvester Ebhonu
 
GDG Cloud Munich - Intro - Luiz Carneiro - #BuildWithAI - July - Abdel.pdf
Luiz Carneiro
 
Get More from Fiori Automation - What’s New, What Works, and What’s Next.pdf
Precisely
 
Google I/O Extended 2025 Baku - all ppts
HusseinMalikMammadli
 
A Strategic Analysis of the MVNO Wave in Emerging Markets.pdf
IPLOOK Networks
 
Accelerating Oracle Database 23ai Troubleshooting with Oracle AHF Fleet Insig...
Sandesh Rao
 
CIFDAQ's Market Wrap : Bears Back in Control?
CIFDAQ
 
Introduction to Flutter by Ayush Desai.pptx
ayushdesai204
 

Experiments on Design Pattern Discovery

  • 1. Experiments on Design Pattern Discovery Jing Dong and Yajing Zhao Department of Computer Science The University of Texas at Dallas {jdong, yxz045100}@utdallas.edu
  • 2. Outline Introduction Related Work Our Approach Experiment Data Result and Discussion Precision and Recall Benchmark Conclusion and Future Work
  • 3. Introduction Difficult to understand large computer-based systems No original architecture and design Patterns help on understanding systems Patterns embed future change of systems Need of design pattern discovery since patterns are lost in source code
  • 4. Introduction (Cont’d) DP-Miner Experiment data: System source code JUnit JEdit JHotDraw Java.AWT Such experiments lead to benchmarks
  • 5. Related Work X Flyweight X Facade X X Chain of Responsibility X X Builder X X X Abstract Factory X X X X X X X X X X Balanyi 2003 X X Command X X X Proxy X X X X X X Composite X X X X X Decorator X X X X Factory Method X X X X Observer X X Prototype X X X X Singleton X X X X Strategy X X X Template Method X X X Visitor X X X X Bridge X X X X Adapter Gueheneuc 2006 Shi 2006 Blewitt 2001 Niere 2002 Heuzeroth 2003 Antoniol 1998 Tsantalis 2006 Authors Tools
  • 6. Our Approach – DP-Miner Matrix and Weight Product of Prime Numbers Structural, Behavioral, and Semantic Analysis
  • 7. Experiment Data JUnit: A regression test framework that helps developers to implement unit tests in Java. JEdit: A mature and easy-to-use text editor. JHotDraw: A two dimensional graphics frameworks for technical and structured drawing editors written in Java. Java.AWT: A library for developing graphical user interfaces for Java programs.
  • 8. Why Those Four Systems as Data? At the time they were developed, the idea of design patterns is already mature and widely applied. Other works on design pattern discovery use one or more of these systems to evaluate their approaches, which allows us to compare and evaluate our experiment results.
  • 9. Experiment Data System information Version Number of Classes Number of Files 484 530 6.0 beta 1 JHotDraw 394 1001 4.2 JEdit 93 126 3.8.2 JUnit 345 570 JDK1.4.2 Java.AWT File # Class # Version Systems
  • 10. Experiment Result 64 24 6 76 Strategy 0 58 4 JHotDraw 0 24 17 JEdit 3 6 3 JUnit 3 65 21 Java.AWT Composite Bridge Adapter Systems
  • 11. Experiment Result – Java.AWT Results for Each Analysis Phase N/A 76 65 N/A Semantic Analysis 3 3 92 Composite 76 76 100 Strategy 65 76 100 Bridge 21 21 57 Adapter Final Result Behavioral Analysis Structural Analysis Systems Java.AWT
  • 12. Experiment Result – JUnit Results for Each Analysis Phase N/A 6 6 N/A Semantic Analysis 3 6 6 3 Final Result 3 9 Composite 6 6 Strategy 6 6 Bridge 3 15 Adapter Behavioral Analysis Structural Analysis Systems JUnit
  • 13. Experiment Result – JEdit Results for Each Analysis Phase N/A 24 24 N/A Semantic Analysis 0 0 0 Composite 24 24 33 Strategy 24 24 33 Bridge 17 17 80 Adapter Final Result Behavioral Analysis Structural Analysis Systems JEdit
  • 14. Experiment Result – JHotDraw Results for Each Analysis Phase N/A 64 58 N/A Semantic Analysis 0 0 0 Composite 64 64 74 Strategy 58 64 74 Bridge 4 4 27 Adapter Final Result Behavioral Analysis Structural Analysis Systems JHotDraw
  • 15. Observations Behavioral analysis phase only deals with a small number of classes, since it’s based on the result of structural analysis phase. Significant reduction of the candidates between structural and behavioral analysis of Adapter and Composite pattern than those of Bridge and Strategy patterns, since the former have more behavioral characteristics than the latter do. Result of structural and behavioral analysis of the Bridge and Strategy patterns are the same, since they have same structural and behavioral characteristics and only differ in their intents.
  • 16. Recovery Precisions for JHotDraw Manually checked the results generated by our tool and see whether they are real pattern instances. TP: True Positive FP: False Positive 100% 0 0 Composite 90.63% 6 58 Strategy 91.38% 5 53 Bridge 100% 0 4 Adapter Precision FP TP JHotDraw
  • 17. Instances Missed Instances manually found but missed by DP-Miner Recall: 89.23% DrawingView SelectionTool [7] Locator LocatorConnector [6] Locator LocatorHandle [5] Locator PolygonHandle [4] Connector ConnectionTool [3] Connector ChangeConnectionHandle [2] Connector LineConnection [1] STRATEGY CONTEXT
  • 18. Reasons of Discrepancy Flexibility of design pattern Composite pattern: Collapse both the Component and Composite classes into a single class or not. Adapter pattern: Full matching all three roles, i.e. Target, Adapter, and Adaptee, or partial matching of only Adapter and Adaptee. Object-oriented programming languages provide special language constructs that greatly simplify the implementation of a design pattern. E.g., Java provides LinkedList, ArrayList, HashMap, and Hashtable, which make the implementation of aggregate elements in patterns easy, but the detection harder.
  • 19. Benchmark Correct number of pattern instances and their locations are generally not available. Lacking benchmarks is the main impediment Hard to evaluate and compare design pattern discovery techniques. Hard to judge whether an approach discovers all instances and whether the discovered ones are correct. To calculate the precision and recall of a pattern matching result, it’s essential to know The number of correct pattern instances The locations of correct pattern instances JHotDraw pattern benchmark
  • 20. Conclusion We did a series of experiments on design pattern discovery from open-source systems using DP-Miner Patterns concerned: Adapter, Bridge, Strategy, Composite Experiment data: Java.AWT, JUnit, JEdit, JHotDraw We compared our experiment results with others and found several discrepancies. We analyzed the issues and discussed possible reasons. We argue for benchmarks for design pattern discovery.
  • 21. Future Work Improve our tool. Experiment on other systems Manually check results of other systems and perfect the benchmark Research on other object-oriented languages, such as C++.
  • 24. Overall Architecture of Our Approach System  Design Pattern match Source Code Intermediate Representation
  • 26. 1 1 1 1 7 1 1 1 1 TextComponent 1 1 1 1 7 1 1 1 1 Scrollbar 1 1 1 1 7 1 1 1 1 Label 1 1 1 1 35 1 1 1 1 Container 1 1 1 5 1 1 1 1 1 Component 1 1 1 1 7 1 1 1 1 Choice 1 1 1 1 7 1 1 1 1 Checkbox 1 1 1 1 7 1 1 1 1 Canvas 1 1 1 1 7 1 1 1 1 Button TextComponent Scrollbar Label Container Component Choice Checkbox Canvas Button
  • 27. 1 1 1 1 7 1 1 1 1 TextComponent 1 1 1 1 7 1 1 1 1 Scrollbar 1 1 1 1 7 1 1 1 1 Label 1 1 1 1 35 1 1 1 1 Container 1 1 1 5 1 1 1 1 1 Component 1 1 1 1 7 1 1 1 1 Choice 1 1 1 1 7 1 1 1 1 Checkbox 1 1 1 1 7 1 1 1 1 Canvas 1 1 1 1 7 1 1 1 1 Button TextComponent Scrollbar Label Container Component Choice Checkbox Canvas Button 1 35 1 Composite 1 1 1 Component 1 7 1 Leaf Composite Component Leaf

Editor's Notes

  • #2: Good afternoon, my name is Yajing Zhao. I will present our paper, Experiments on Design Pattern Discovery.