[go: up one dir, main page]
More Web Proxy on the site http://driver.im/ skip to main content
research-article

Mining Design Pattern Use Scenarios and Related Design Pattern Pairs: A Case Study on Online Posts

Published: 01 October 2020 Publication History

Abstract

In common design pattern collections, e.g., design pattern books, design patterns are documented with templates that consist of multiple attributes, such as intent, structure, and sample code. To adapt to modern developers, the depictions of design patterns, especially some specific attributes, should advance with the current programming technologies, for example, “known uses”, which exemplifies the use scenarios of design patterns in practice, and “related patterns”, which describes the relatedness between a design pattern and the others within a context. However, it is not easy to update the contents of these attributes manually due to the diversity of the programming technologies. To address this problem, in this work, we conducted a case study to mine design pattern use scenarios and related design pattern pairs from Stack Overflow posts to enrich the two attributes. We first extracted the question posts relevant to each design pattern by identifying the design pattern tags. Then, the topics of the posts were discovered by applying topic modeling techniques. Finally, by analyzing the topics specified for each design pattern, we detected 195 design pattern use scenarios and 70 related design pattern pairs, involving 61 design patterns totally. These findings are associated with a variety of popular software frameworks and programming techniques. They could complement the existing design pattern collections and help developers better acknowledge the usage and relatedness of design patterns in today’s programming practice.

References

[1]
Zhang C and Budgen D What do we know about the effectiveness of software design patterns? IEEE Trans. Softw. Eng. 2012 38 5 1213-1231
[2]
Henninger S, Corrêa V. Software pattern communities: Current practices and challenges. In Proc. the 14th Conf. Patt. Lang. Prog., Sept. 2007, Article No. 14.
[3]
Gamma E, Helm R, Johnson R, Vlissides J. Design Patterns: Elements of Reusable Object-Oriented Software (1st edition). Addison-Wesley Professional, 1994.
[4]
Buschmann F, Meunier R, Rohnert H, Sommerlad P, Stal M. Pattern-Oriented Software Architecture: A System of Patterns (1st edition). Wiley, 1996.
[5]
Barua A, Thomas SW, and Hassan AE What are developers talking about? An analysis of topics and trends in Stack Overflow Empir. Softw. Eng. 2014 19 3 619-654
[6]
Ahmad A, Feng C, Ge S, and Yousif A A survey on mining stack overflow: Question and answering (Q&A) community Data Technol. Appl. 2018 52 2 190-247
[7]
Hindle A, Godfrey M W, Holt R C. What’s hot and what’s not: Windowed developer topic analysis. In Proc. the 25th IEEE Int. Conf. Softw. Maint., Sept. 2009, pp.339-348.
[8]
Han D, Zhang C, Fan X, Hindle A, Wong K, Stroulia E. Understanding Android fragmentation with topic analysis of vendor-specific bugs. In Proc. the 19th Working Conf. Reverse Eng., Oct. 2012, pp.83-92.
[9]
Bagherzadeh M, Khatchadourian R. Going big: A largescale study on what big data developers ask. In Proc. the 27th ACM Joint Eur. Softw. Eng. Conf./Symp. Found. Softw. Eng., Aug. 2019, pp.432-442.
[10]
Zhou P, Liu J, Yang Z, Zhou G. Scalable tag recommendation for software information sites. In Proc. the 24th IEEE Int. Conf. Softw. Anal. Evol. Reeng., Feb. 2017, pp.272-282.
[11]
Chen C, Gao S, Xing Z. Mining analogical libraries in Q&A discussions — Incorporating relational and categorical knowledge into word embedding. In Proc. the 23rd IEEE Int. Conf. Softw. Anal. Evol. Reeng., Mar. 2016, pp.338-348.
[12]
Wang XY, Xia X, and Lo D TagCombine: Recommending tags to contents in software information sites J. Comput. Sci. Technol. 2015 30 5 1017-1035
[13]
Zhang Y, Lo D, Xia X, and Sun JL Multi-factor duplicate question detection in Stack Overflow J. Comput. Sci. Technol. 2015 30 5 981-997
[14]
Jiang H, Liu D, Chen X, Liu H, Mei H. How are design patterns concerned by developers? In Proc. the 41st Int. Conf. Softw. Eng. Comp., May 2019, pp.232-233.
[15]
Yang XL, Lo D, Xia X, Wan ZY, and Sun JL What security questions do developers ask? A large-scale study of Stack Overflow posts J. Comput. Sci. Technol. 2016 31 5 910-924
[16]
Yin J, Wang J. A Dirichlet multinomial mixture modelbased approach for short text clustering. In Proc. the 20th ACM Int. Conf. Knowl. Disc. Data Mining, Aug. 2014, pp.233-242.
[17]
Griffiths TL and Steyvers M Finding scientific topics Proc. National Academy Sci. 2004 101 suppl. 1 5228-5235
[18]
Satopaa V, Albrecht J, Irwin D, Raghavan B. Finding a “Kneedle” in a haystack: Detecting knee points in system behavior. In Proc. the 31st Int. Conf. Distrt. Comput. Syst. Workshops, June 2011, pp.166-171.
[19]
Rosen C and Shihab E What are mobile developers asking about? A large scale study using Stack Overflow Empir. Softw. Eng. 2016 21 1192-1223
[20]
Hasheminejad SMH and Jalili S Design patterns selection: An automatic two-phase method J. Syst. Softw. 2012 85 2 408-424
[21]
Scanniello G, Gravino C, Risi M, Tortora G, Dodero G. Documenting design-pattern instances: A family of experiments on source-code comprehensibility. ACM Trans. Softw. Eng. Methodol., 2015, 24(3): Article No. 14.
[22]
Ampatzoglou A, Chatzigeorgiou A, Charalampidou S, and Avgeriou P The effect of GoF design patterns on stability: A case study IEEE Trans. Softw. Eng. 2015 41 8 781-802
[23]
Hussain S, Keung J, Khan A A, Bennin K E. Correlation between the frequent use of gang-of-four design patterns and structural complexity. In Proc. the 24th Asia-Pacific Softw. Eng. Conf., Dec. 2017, pp.189-198.
[24]
Jaafar F, Guéhéneuc YG, Hamel S, Khomh F, and Zulkernine M Evaluating the impact of design pattern and anti-pattern dependencies on changes and faults Empir. Softw. Eng. 2016 21 3 896-931
[25]
Aversano L, Cerulo L, and Di Penta M Relationship between design patterns defects and crosscutting concern scattering degree: An empirical study IET Softw. 2009 3 5 395-409
[26]
Zou J, Xu L, Yang M, Zhang X, and Yang D Towards comprehending the non-functional requirements through developers’ eyes: An exploration of Stack Overflow using topic analysis Inf. Softw. Technol. 2017 84 19-32
[27]
Nagy C, Cleve A. Mining Stack Overflow for discovering error patterns in SQL queries. In Proc. the 7th IEEE Int. Conf. Softw. Maint. Evolut., Sept. 2015, pp.516-520.
[28]
Zhang T, Upadhyaya G, Reinhardt A, Rajan H, Kim M. Are code examples on an online Q&A forum reliable? A study of API misuse on Stack Overflow. In Proc. the 40th Int. Conf. Softw. Eng., May 2018, pp.886-896.
[29]
Rahman A, Farhana E, Imtiaz N. Snakes in paradise? Insecure python-related coding practices in Stack Overflow. In Proc. the 16th IEEE/ACM Int. Conf. Mining Softw. Repos., May 2019, pp.200-204.
[30]
Ford D, Smith J, Guo P J, Parnin C. Paradise unplugged: Identifying barriers for female participation on Stack Overflow. In Proc. the 24th ACM Joint Eur. Softw. Eng. Conf./Symp. Found. Softw. Eng., Nov. 2016, pp.846-857.
[31]
Zhang H, Wang S, Chen T P, Zou Y, Hassan A E. An empirical study of obsolete answers on Stack Overflow. IEEE Trans. Softw. Eng..
[32]
Marder A. Stack Overflow badges and user behavior: An econometric approach. In Proc. the 12th IEEE/ACM Int. Conf. Mining Softw. Repos., May 2015, pp.450-453.
[33]
Thomas S W, Adams B, Hassan A E, Blostein D. Validating the use of topic models for software evolution. In Proc. the 10th IEEE Working Conf. Source Code Anal. Manip., Sept. 2010, pp.55-64.
[34]
Fowkes J, Chanthirasegaran P, Ranca R, Allamanis M, Lapata M, and Sutton C Autofolding for source code summarization IEEE Trans. Softw. Eng. 2017 43 12 1095-1109
[35]
Mahmoud A and Bradshaw G Semantic topic models for source code analysis Empir. Softw. Eng. 2017 22 4 1965-2000
[36]
Xia X, Lo D, Ding Y, Al-Kofahi JM, Nguyen TN, and Wang X Improving automated bug triaging with specialized topic model IEEE Trans. Softw. Eng. 2017 43 3 272-297
[37]
Jiang H, Zhang J, Ren Z, Zhang T. An unsupervised approach for discovering relevant tutorial fragments for APIs. In Proc. the 39th Int. Conf. Softw. Eng., May 2017, pp.38-48.
[38]
Hu J, Sun X, Li B. Explore the evolution of development topics via on-line LDA. In Proc. the 22nd IEEE Int. Conf. Softw. Anal. Evol. Reeng., Mar. 2015, pp.555-559.

Index Terms

  1. Mining Design Pattern Use Scenarios and Related Design Pattern Pairs: A Case Study on Online Posts
          Index terms have been assigned to the content through auto-classification.

          Recommendations

          Comments

          Please enable JavaScript to view thecomments powered by Disqus.

          Information & Contributors

          Information

          Published In

          cover image Journal of Computer Science and Technology
          Journal of Computer Science and Technology  Volume 35, Issue 5
          Oct 2020
          268 pages

          Publisher

          Springer-Verlag

          Berlin, Heidelberg

          Publication History

          Published: 01 October 2020
          Revision received: 31 July 2020
          Received: 27 February 2020

          Author Tags

          1. design pattern
          2. software documentation
          3. Stack Overflow
          4. topic model

          Qualifiers

          • Research-article

          Contributors

          Other Metrics

          Bibliometrics & Citations

          Bibliometrics

          Article Metrics

          • 0
            Total Citations
          • 0
            Total Downloads
          • Downloads (Last 12 months)0
          • Downloads (Last 6 weeks)0
          Reflects downloads up to 24 Dec 2024

          Other Metrics

          Citations

          View Options

          View options

          Media

          Figures

          Other

          Tables

          Share

          Share

          Share this Publication link

          Share on social media