Logo PTI Logo FedCSIS

Proceedings of the 17th Conference on Computer Science and Intelligence Systems

Annals of Computer Science and Information Systems, Volume 30

Improvement of design anti-pattern detection with spatio-temporal rules in the software development process

DOI: http://dx.doi.org/10.15439/2022F211

Citation: Proceedings of the 17th Conference on Computer Science and Intelligence Systems, M. Ganzha, L. Maciaszek, M. Paprzycki, D. Ślęzak (eds). ACSIS, Vol. 30, pages 521528 ()

Full text

Abstract. In our previous work we presented a framework for mining spatio-temporal rules in the software development process.The rules are based on specific relations between structures of the source code which relate both to spatial (e.g. a direct call between methods of two classes) and temporal dependencies (e.g. one class introduced into the source code before the other) observed in the process. To some extent, spatio-temporal rules allow us to predict where and when certain design anti-patterns will appear in the source code of a software system. This paper presents how, with slight modifications, such framework can be used to improve the quality of detecting a few popular design anti-patterns, such as Blob, Swiss Army Knife, YoYo or Brain Class. In the proposed method, we not only check the structure of a piece of the source code, but we also analyse its spatio-temporal relations. Only on the basis of the two analyses can we decide if the given piece of code is an anti-pattern. Experimental validation shows that the addition of spatio-temporal perspective improves detection of anti-patterns by 4\\% in terms of F-measure.

References

  1. Ł. Puławski, “Temporal Relations of Rough Anti-patterns in Software Development,” in Rough Sets, ser. Lecture Notes in Computer Science, L. Polkowski, Y. Yao, P. Artiemjew, D. Ciucci, D. Liu, D. Ślęzak, and B. Zielosko, Eds. Cham: Springer International Publishing, 2017, pp. 447–464.
  2. S. M. Olbrich, D. S. Cruzes, and D. I. K. Sjoberg, “Are all code smells harmful? A study of God Classes and Brain Classes in the evolution of three open source systems,” in Proceedings of the 2010 IEEE International Conference on Software Maintenance, ser. ICSM ’10. Washington, DC, USA: IEEE Computer Society, 2010, pp. 1–10.
  3. W. H. Brown, R. C. Malveau, H. W. “Skip” McCormick, and T. J. Mowbray, AntiPatterns: Refactoring Software, Architectures, and Projects in Crisis, 1st ed. New York, NY, USA: John Wiley and Sons, Inc., 1998.
  4. R. Marinescu, “Detection Strategies: Metrics-Based Rules for Detecting Design Flaws,” Software Maintenance, IEEE International Conference on, vol. 0, pp. 350–359, 2004.
  5. S. Olbrich, D. S. Cruzes, V. Basili, and N. Zazworka, “The evolution and impact of code smells: A case study of two open source systems,” Empirical Software Engineering and Measurement, International Symposium on, vol. 0, pp. 390–400, 2009.
  6. R. Wieman, Anti-Pattern Scanner: An Approach to Detect Anti-Patterns and Design Violations. LAP LAMBERT Academic Publishing, Nov. 2011.
  7. H. Kagdi, M. L. Collard, and J. I. Maletic, “Towards a taxonomy of approaches for mining of source code repositories,” SIGSOFT Softw. Eng. Notes, vol. 30, pp. 1–5, May 2005.
  8. N. Moha, Y.-G. Guéhéneuc, L. Duchien, and A.-F. Le Meur, “DECOR: A Method for the Specification and Detection of Code and Design Smells,” Software Engineering, IEEE Transactions on, vol. 36, no. 1, pp. 20–36, Jan. 2010.
  9. N. Moha, Y.-g. Gueheneuc, and P. Leduc, “Automatic Generation of Detection Algorithms for Design Defects,” in 21st IEEE/ACM International Conference on Automated Software Engineering (ASE’06). Tokyo: IEEE, 2006, pp. 297–300.
  10. D. H. Taenzer, M. Ganti, and S. Podar, “Problems in Object-Oriented Software Reuse,” in ECOOP ’89: Proceedings of the Third European Conference on Object-Oriented Programming, Nottingham, UK, July 10-14, 1989, S. Cook, Ed. Cambridge University Press, 1989, pp. 25–38.
  11. A. Stoianov and I. Sora, “Detecting patterns and antipatterns in software using Prolog rules,” in 2010 International Joint Conference on Computational Cybernetics and Technical Informatics. Timisoara: IEEE, May 2010, pp. 253–258.
  12. F. Jaafar, Y. G. Gueheneuc, S. Hamel, and F. Khomh, “Mining the relationship between anti-patterns dependencies and fault-proneness,” in Reverse Engineering (WCRE), 2013 20th Working Conference On. IEEE, Oct. 2013, pp. 351–360.
  13. T. Zimmermann, “Changes and bugs Mining and predicting development activities,” in Software Maintenance, 2009. ICSM 2009. IEEE International Conference On. IEEE, 2009, pp. 443–446.
  14. C. Izurieta and J. M. Bieman, “A multiple case study of design pattern decay, grime, and rot in evolving software systems,” Software Quality Journal, pp. 1–35, Feb. 2012.
  15. M. Fowler and K. Beck, Refactoring Improving the Design of Existing Code, 1st ed. Addison-Wesley, Jul. 2013.
  16. H. Li and W. Cheung, “An Empirical Study of Software Metrics,” IEEE Transactions on Software Engineering, vol. SE-13, no. 6, pp. 697–708, Jun. 1987.
  17. T. J. McCabe, “A complexity measure,” in Proceedings of the 2nd International Conference on Software Engineering, ser. ICSE ’76. San Francisco, California, United States: IEEE Computer Society Press, 1976, pp. 407+.
  18. B. A. Nejmeh, “NPATH: A measure of execution path complexity and its applications,” Commun. ACM, vol. 31, no. 2, pp. 188–200, Feb. 1988.
  19. S. R. Chidamber and C. F. Kemerer, “A Metrics Suite for Object Oriented Design,” IEEE Trans. Softw. Eng., vol. 20, no. 6, pp. 476–493, Jun. 1994.
  20. M. Hitz and B. Montazeri, “Measuring coupling and cohesion in object-oriented systems,” in Proceedings of International Symposium on Applied Corporate Computing, 1995, pp. 25–27.
  21. J. M. Bieman and B.-K. Kang, “Cohesion and reuse in an object-oriented system,” SIGSOFT Softw. Eng. Notes, vol. 20, no. SI, pp. 259–262, Aug. 1995.
  22. N. Moha, Y. G. Gueheneuc, A. F. Le Meur, L. Duchien, and A. Tiberghien, “From a domain analysis to the specification and detection of code and design smells,” Form. Asp. Comput., vol. 22, pp. 345–361, May 2010.
  23. M. Fowler, Patterns of Enterprise Application Architecture, 1st ed. Addison-Wesley Professional, Nov. 2002.
  24. D. Ratiu, S. Ducasse, T. Girba, and R. Marinescu, “Using History Information to Improve Design Flaws Detection,” in Proceedings of the Eighth Euromicro Working Conference on Software Maintenance and Reengineering (CSMR’04), ser. CSMR ’04. Washington, DC, USA: IEEE Computer Society, 2004.
  25. J. Din, A. B. Al-Badareen, and Y. Y. Jusoh, “Antipatterns detection approaches in Object-Oriented Design: A literature review,” in 2012 7th International Conference on Computing and Convergence Technology (ICCCT). IEEE, 2012, pp. 926–931.
  26. F. Palomba, R. Oliveto, and A. De Lucia, “Investigating code smell co-occurrences using association rule learning: A replicated study,” in 2017 IEEE Workshop on Machine Learning Techniques for Software Quality Evaluation (MaLTeSQuE), Feb. 2017, pp. 8–13.
  27. F. Palomba, G. Bavota, M. Di Penta, R. Oliveto, D. Poshyvanyk, and A. De Lucia, “Mining version histories for detecting code smells,” IEEE Transactions on Software Engineering, vol. 41, no. 5, pp. 462–489, 2014.
  28. M. Zhang, N. Baddoo, P. Wernick, and T. Hall, “Improving the Precision of Fowler’s Definitions of Bad Smells,” in 2008 32nd Annual IEEE Software Engineering Workshop. Kassandra, Greece: IEEE, Oct. 2008, pp. 161–166.
  29. J. F. Allen, “Maintaining Knowledge About Temporal Intervals,” Commun. ACM, vol. 26, no. 11, pp. 832–843, Nov. 1983.
  30. (2015, Sep) Argouml. [Online]. Available: http://argouml.tigris.org/issues/
  31. (2020, Nov) Argouml source code. [Online]. Available: https://github.com/argouml-tigris-org/argouml
  32. (2020, Nov) Argouml source code. [Online]. Available: http://argouml.tigris.org/servlets/ProjectIssues
  33. (2020, Nov) Struts. [Online]. Available: https://struts.apache.org/
  34. (2020, Nov) Apache software foundation scm. [Online]. Available: http://svn.apache.org/repos/
  35. (2020, Nov) Apache software foundation issue tracker. [Online]. Available: https://issues.apache.org
  36. (2020, Nov) Eclipse jdt. [Online]. Available: https://xerces.apache.org/#xerces2-j
  37. (2020, Nov) Elasticsearch. [Online]. Available: https://www.elastic.co/
  38. (2020, Nov) Elasticsearch source code. [Online]. Available: https://github.com/elastic/elasticsearch
  39. (2018, Apr) Jhotdraw. [Online]. Available: http://www.jhotdraw.org/
  40. (2020, Nov) Jhotdraw source code. [Online]. Available: https://github.com/wrandelshofer/jhotdraw
  41. (2020, Nov) Lucene solr. [Online]. Available: https://solr.apache.org/
  42. (2020, Nov) Lucene solr source code. [Online]. Available: https://gitbox.apache.org/repos/asf/lucene-solr.git
  43. (2020, Nov) Wildfly. [Online]. Available: https://www.wildfly.org/
  44. (2020, Nov) Wildfly scm. [Online]. Available: https://github.com/wildfly/wildfly
  45. (2020, Nov) Wildfly issue tracker. [Online]. Available: https://issues.jboss.org
  46. L. Pulawski, “An automatic approach for detecting early indicators of design anti-patterns,” in JCKBSE, ser. Frontiers in Artificial Intelligence and Applications, M. Virvou and S. Matsuura, Eds., vol. 240. IOS Press, 2012, pp. 161–170.
  47. V. Driessen. (2010, Jan) https://datasift.github.io/gitflow/IntroducingGitFlow.html. [Online]. Available: https://datasift.github.io/gitflow/IntroducingGitFlow.html
  48. C. C. Aggarwal and H. Wang, Managing and Mining Graph Data, 1st ed. Springer Publishing Company, Incorporated, 2010.
  49. N. Nagappan and T. Ball, “Use of Relative Code Churn Measures to Predict System Defect Density,” in Proceedings of the 27th International Conference on Software Engineering, ser. ICSE ’05. St. Louis, MO, USA: ACM, 2005, pp. 284–292.