Improvement of design anti-pattern detection with spatio-temporal rules in the software development process
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 521–528 (2022)
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.
- Ł. 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.
- 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.
- 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.
- R. Marinescu, “Detection Strategies: Metrics-Based Rules for Detecting Design Flaws,” Software Maintenance, IEEE International Conference on, vol. 0, pp. 350–359, 2004.
- 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.
- R. Wieman, Anti-Pattern Scanner: An Approach to Detect Anti-Patterns and Design Violations. LAP LAMBERT Academic Publishing, Nov. 2011.
- 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.
- 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.
- 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.
- 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.
- 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.
- 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.
- 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.
- 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.
- M. Fowler and K. Beck, Refactoring Improving the Design of Existing Code, 1st ed. Addison-Wesley, Jul. 2013.
- 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.
- 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+.
- B. A. Nejmeh, “NPATH: A measure of execution path complexity and its applications,” Commun. ACM, vol. 31, no. 2, pp. 188–200, Feb. 1988.
- 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.
- 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.
- 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.
- 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.
- M. Fowler, Patterns of Enterprise Application Architecture, 1st ed. Addison-Wesley Professional, Nov. 2002.
- 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.
- 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.
- 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.
- 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.
- 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.
- J. F. Allen, “Maintaining Knowledge About Temporal Intervals,” Commun. ACM, vol. 26, no. 11, pp. 832–843, Nov. 1983.
- (2015, Sep) Argouml. [Online]. Available: http://argouml.tigris.org/issues/
- (2020, Nov) Argouml source code. [Online]. Available: https://github.com/argouml-tigris-org/argouml
- (2020, Nov) Argouml source code. [Online]. Available: http://argouml.tigris.org/servlets/ProjectIssues
- (2020, Nov) Struts. [Online]. Available: https://struts.apache.org/
- (2020, Nov) Apache software foundation scm. [Online]. Available: http://svn.apache.org/repos/
- (2020, Nov) Apache software foundation issue tracker. [Online]. Available: https://issues.apache.org
- (2020, Nov) Eclipse jdt. [Online]. Available: https://xerces.apache.org/#xerces2-j
- (2020, Nov) Elasticsearch. [Online]. Available: https://www.elastic.co/
- (2020, Nov) Elasticsearch source code. [Online]. Available: https://github.com/elastic/elasticsearch
- (2018, Apr) Jhotdraw. [Online]. Available: http://www.jhotdraw.org/
- (2020, Nov) Jhotdraw source code. [Online]. Available: https://github.com/wrandelshofer/jhotdraw
- (2020, Nov) Lucene solr. [Online]. Available: https://solr.apache.org/
- (2020, Nov) Lucene solr source code. [Online]. Available: https://gitbox.apache.org/repos/asf/lucene-solr.git
- (2020, Nov) Wildfly. [Online]. Available: https://www.wildfly.org/
- (2020, Nov) Wildfly scm. [Online]. Available: https://github.com/wildfly/wildfly
- (2020, Nov) Wildfly issue tracker. [Online]. Available: https://issues.jboss.org
- 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.
- V. Driessen. (2010, Jan) https://datasift.github.io/gitflow/IntroducingGitFlow.html. [Online]. Available: https://datasift.github.io/gitflow/IntroducingGitFlow.html
- C. C. Aggarwal and H. Wang, Managing and Mining Graph Data, 1st ed. Springer Publishing Company, Incorporated, 2010.
- 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.