Skip to main content

Defining and Extracting Singleton Design Pattern Information from Object-Oriented Software Program

  • Conference paper
  • First Online:
Advances in Computational Collective Intelligence (ICCCI 2022)

Part of the book series: Communications in Computer and Information Science ((CCIS,volume 1653))

Included in the following conference series:

  • 822 Accesses

Abstract

In software engineering (SE), improving the quality of code and design by relying on pre-established restructuring (refactoring), such as detection and injection of a design pattern are still challenging problems. In this article, we focus on the Singleton design pattern, in which we indicate its variants implementation and define 33 features that can identify this pattern in its standard and non-standard form. Significant information can be extracted by applying the structural and semantic analysis of the source code. So use this information; it becomes easier to identify a pattern and inject it. We created specific data using 20,000 code snippets. This data is used to train deep learning models called RNN-LSTM classifiers to extract information from object-oriented software systems. The empirical result proves that our proposed LSTM-RNN Classifier can successfully extract proposed information with excellent results in terms of prediction recall and F1-score.

This is a preview of subscription content, log in via an institution to check access.

Access this chapter

Chapter
USD 29.95
Price excludes VAT (USA)
  • Available as PDF
  • Read on any device
  • Instant download
  • Own it forever
eBook
USD 84.99
Price excludes VAT (USA)
  • Available as EPUB and PDF
  • Read on any device
  • Instant download
  • Own it forever
Softcover Book
USD 109.99
Price excludes VAT (USA)
  • Compact, lightweight edition
  • Dispatched in 3 to 5 business days
  • Free shipping worldwide - see info

Tax calculation will be finalised at checkout

Purchases are for personal use only

Institutional subscriptions

References

  1. Stencel, K., Węgrzynowicz, P.: Implementation variants of the singleton design pattern. In: Meersman, R., Tari, Z., Herrero, P. (eds.) OTM 2008. LNCS, vol. 5333, pp. 396–406. Springer, Heidelberg (2008). https://doi.org/10.1007/978-3-540-88875-8_61

    Chapter  Google Scholar 

  2. Goodfellow, I., Bengio, Y., Courville, A.: Deep Learning. Vol. 1. MIT Press Cambridge (2016)

    Google Scholar 

  3. Hindle, A., Barr, E.T., Su, Z., Gabel, M., Devanbu, P.: On the naturalness of software. In: Software Engineering (ICSE). 34th International Conference 2012, pp. 837–847. IEEE (2012)

    Google Scholar 

  4. Najam, N., Aldeida, A., Zhengc, Y.: Feature-based software design pattern detection (2021)

    Google Scholar 

  5. Fujaba. https://web.cs.upb.de/archive/fujaba. Accessed 12 Apr 2022

  6. Paakki, J., Karhinen, A., Gustafsson, J., Nenonen, L., Verkamo, A.I.: Software metrics by architectural pattern mining. In: Proceedings of the International Conference on Software: Theory and Practice, pp. 325–332 (2000)

    Google Scholar 

  7. Bernardi, M.L., Cimitile, M., Di Lucca, G.: Design pattern detection using a DSL-driven graph matching approach. J. Softw. Evolut. Process 26(12), 1233–1266 (2014)

    Article  Google Scholar 

  8. Gamma, E., Helm, R., Johnson, R.E., Vlissides, J.M.: Design Patterns: Elements of Reusable Object-oriented Software. Addison-Wesley Longman Publishing Co., Inc., Boston (1995)

    MATH  Google Scholar 

  9. Mayvan, B.B., Rasoolzadegan, A.: Design pattern detection based on the graph theory. Knowl. Based Syst. 120, 211–225 (2017)

    Google Scholar 

  10. Zanoni, M.: Data mining techniques for design pattern detection, Ph.D. thesis, Milano, Italy (2012)

    Google Scholar 

  11. Hu, X., Li, G., Xia, X., Lo, D., Jin, Z.: Deep code comment generation. In: 2018 IEEE/ACM 26th International Conference on Program Comprehension (ICPC), pp. 200–210. IEEE (2018)

    Google Scholar 

  12. McBurney, P.W., McMillan, C.: Automatic source code summarization of context for Java methods. IEEE Trans. Softw. Eng. 42, 103–119 (2015)

    Article  Google Scholar 

  13. McBurney, P.W., McMillan, C.: An empirical study of the textual similarity between source code and source code summaries. Empir. Softw. Eng. 21(1), 17–42 (2014). https://doi.org/10.1007/s10664-014-9344-6

    Article  Google Scholar 

  14. Nazar, N., Jiang, H., Gao, G., Zhang, T., Li, X., Ren, Z.: Source code fragment summarization with small-scale crowdsourcing based features. Front. Comp. Sci. 10(3), 504–517 (2016). https://doi.org/10.1007/s11704-015-4409-2

    Article  Google Scholar 

  15. Moreno, L., Marcus, A., Pollock, L., Vijay-Shanker, K.: Jsummarizer: an automatic generator of natural language summaries for java classes. In: 2013 21st International Conference on Program Comprehension (ICPC), pp. 230–232. IEEE (2013)

    Google Scholar 

  16. Sherstinsky. A.: Fundamentals of recurrent neural network (RNN) and long short-term memory (LSTM) network. J. Phys. D Nonlinear Phenom. 404, 132306 (2020)

    Google Scholar 

  17. Chung, J., Gulcehre, C., Cho, K., Bengio, Y.: Empirical evaluation of gated recurrent neural networks on sequence modeling. arXiv: 1412.3555 (2014)

    Google Scholar 

Download references

Author information

Authors and Affiliations

Authors

Corresponding author

Correspondence to Abir Nacef .

Editor information

Editors and Affiliations

Rights and permissions

Reprints and permissions

Copyright information

© 2022 The Author(s), under exclusive license to Springer Nature Switzerland AG

About this paper

Check for updates. Verify currency and authenticity via CrossMark

Cite this paper

Nacef, A., Khalfallah, A., Bahroun, S., Ben Ahmed, S. (2022). Defining and Extracting Singleton Design Pattern Information from Object-Oriented Software Program. In: Bădică, C., Treur, J., Benslimane, D., Hnatkowska, B., Krótkiewicz, M. (eds) Advances in Computational Collective Intelligence. ICCCI 2022. Communications in Computer and Information Science, vol 1653. Springer, Cham. https://doi.org/10.1007/978-3-031-16210-7_58

Download citation

  • DOI: https://doi.org/10.1007/978-3-031-16210-7_58

  • Published:

  • Publisher Name: Springer, Cham

  • Print ISBN: 978-3-031-16209-1

  • Online ISBN: 978-3-031-16210-7

  • eBook Packages: Computer ScienceComputer Science (R0)

Publish with us

Policies and ethics