Abstract
During software evolution, inexperienced developers may introduce design anti-patterns when they modify their software systems to fix bugs or to add new functionalities based on changes in requirements. Developers may also use design patterns to promote software quality or as a possible cure for some design anti-patterns. Thus, design patterns and design anti-patterns are introduced, removed, and mutated from one another by developers. Many studies investigated the evolution of design patterns and design anti-patterns and their impact on software development. However, they investigated design patterns or design anti-patterns in isolation and did not consider their mutations and the impact of these mutations on software quality. Therefore, we report our study of bidirectional mutations between design patterns and design anti-patterns and the impacts of these mutations on software change- and fault-proneness. We analyzed snapshots of seven Java software systems with diverse sizes, evolution histories, and application domains. We built Markov models to capture the probability of occurrences of the different design patterns and design anti-patterns mutations. Results from our study show that (1) design patterns and design anti-patterns mutate into other design patterns and–or design anti-patterns. They also show that (2) some change types primarily trigger mutations of design patterns and design anti-patterns (renaming and changes to comments, declarations, and operators), and (3) some mutations of design anti-patterns and design patterns are more faulty in specific contexts. These results provide important insights into the evolution of design patterns and design anti-patterns and its impact on the change- and fault-proneness of software systems.
Similar content being viewed by others
Notes
References
Abbes M, Khomh F, Gueheneuc Y-G, Antoniol G (2011) An empirical study of the impact of two antipatterns, blob and spaghetti code, on program comprehension. In: Software maintenance and reengineering (CSMR), 2011 15th European conference on. IEEE, pp 181–190
Ampatzoglou A, Frantzeskou G, Stamelos I (2012) A methodology to assess the impact of design patterns on software quality. Inf Softw Technol 54 (4):331–346
An L, Khomh F (2015) An empirical study of crash-inducing commits in Mozilla Firefox. In: Proceedings of the 11th International conference on predictive models and data analytics in software engineering. ACM, p 5
Arnaoudova V, Eshkevari LM, Di Penta M, Oliveto R, Antoniol G, Gueheneuc Y-G (2014) Repent: Analyzing the nature of identifier renamings. IEEE Trans Softw Eng 40(5):502–532
Aversano L, Canfora G, Cerulo L, Del Grosso C, Di Penta M (2007) An empirical study on the evolution of design patterns. In: Proceedings of the the 6th joint meeting of the European software engineering conference and the ACM SIGSOFT symposium on The foundations of software engineering. ACM, pp 385–394
Bieman JM, Straw G, Wang H, Munger PW, Alexander RT (2003) Design patterns and change proneness: An examination of five evolving systems. In: Software metrics symposium, 2003. Proceedings. Ninth international. IEEE, pp 40–49
Brown WH, Malveau RC, Mowbray TJ (1998) AntiPatterns: refactoring software, architectures, and projects in crisis, Wiley, New York
Canfora G, Cerulo L, Di Penta M, Pacilio F (2010) An exploratory study of factors influencing change entropy. In: 2010 IEEE 18th International conference on program comprehension. IEEE, pp 134–143
Ducasse S, Gîrba T, Marinescu R (2004) Using history information to improve design flaws detection. In: CSMR 2004: 8th european conference on software maintenance and reengineering. Citeseer
Fischer M, Pinzger M, Gall H (2003) Populating a release history database from version control and bug tracking systems. In: Software maintenance, 2003. ICSM 2003. Proceedings. International conference on. IEEE, pp 23–32
Fowler M, Beck K (1999) Refactoring: improving the design of existing code. Addison-Wesley Professional
Fukushima T, Kamei Y, McIntosh S, Yamashita K, Ubayashi N (2014) An empirical study of just-in-time defect prediction using cross-project models. In: Proceedings of the 11th working conference on mining software repositories. ACM, pp 172–181
Gamma E (1995) Design patterns: elements of reusable object-oriented software. Pearson Education, India
Gatrell M, Counsell S, Hall T (2009) Design patterns and change proneness: a replication using proprietary c# software. In: Reverse engineering, 2009. WCRE’09. 16th working conference on. IEEE, pp 160–164
Guéhéneuc Y-G, Antoniol G (2008) Demima: A multilayered approach for design pattern identification. IEEE Trans Softw Eng 34(5):667–684
Gueheneuc Y-G, Sahraoui H, Zaidi F (2004) Fingerprinting design patterns. In: Reverse engineering, 2004. Proceedings. 11th Working conference on. IEEE, pp 172–181
Hassan AE (2009) Predicting faults using the complexity of code changes. In: Proceedings of the 31st international conference on software engineering. IEEE Computer Society, pp 78–88
Iacob C (2011) A design pattern mining method for interaction design. In: Proceedings of the 3rd ACM SIGCHI symposium on Engineering interactive computing systems. ACM, pp 217–222
Jaafar F, Guéhéneuc Y-G, Hamel S (2013a) Analysing anti-patterns static relationships with design patterns. Proc PPAP 2:26
Jaafar F, Guéhéneuc Y-G, Hamel S, Khomh F (2013b) Mining the relationship between anti-patterns dependencies and fault-proneness. In: 2013 20th Working conference on reverse engineering (WCRE). IEEE, pp 351–360
Jaafar F, Khomh F, Guéhéneuc Y-G, Zulkernine M (2014) Anti-pattern mutations and fault-proneness. In: Quality software (QSIC), 2014 14th International conference on. IEEE, pp 246–255
Kamei Y, Shihab E, Adams B, Hassan AE, Mockus A, Sinha A, Ubayashi N (2013) A large-scale empirical study of just-in-time quality assurance. IEEE Trans Softw Eng 39(6):757–773
Khomh F, Di Penta M, Guéhéneuc Y-G, Antoniol G (2012) An exploratory study of the impact of antipatterns on class change-and fault-proneness. Empir Softw Eng 17(3):243–275
Khomh F, Guéhéneuc Y-G (2007) Perception and reality: What are design patterns good for?. In: Proceedings of 11th ECOOP workshop on quantitative approaches in object oriented software engineering (QAOOSE). Springer, p 7
Khomh F, Guéhéneuc Y-G (2008) Do design patterns impact software quality positively?. In: Software maintenance and reengineering, 2008. CSMR 2008. 12th European conference on. IEEE, pp 274–278
Khomh F, Guéhéneuc Y-G, Antoniol G (2009) Playing roles in design patterns: An empirical descriptive and analytic study. In: IEEE International conference on software maintenance, 2009. ICSM 2009. IEEE, pp 83–92
Kramer C, Prechelt L (1996) Design recovery by automated search for structural design patterns in object-oriented software. In: Reverse engineering, 1996., Proceedings of the Third working conference on. IEEE, pp 208–215
Lanza M, Marinescu R (2007) Object-oriented metrics in practice: using software metrics to characterize, evaluate, and improve the design of object-oriented systems. Springer Science & Business Media, New York
Long J (2001) Software reuse antipatterns. ACM SIGSOFT Softw Eng Notes 26(4):68–76
Mäntylä M, Vanhanen J, Lassenius C (2003) A taxonomy and an initial empirical study of bad smells in code. In: Software maintenance, 2003. ICSM 2003. Proceedings. International conference on., pp 381–384
Marinescu R, Lanza M (2006) Object-oriented metrics in practice
Meyn SP, Tweedie RL (2012) Markov chains and stochastic stability. Springer Science & Business Media, New York
Moha N, Gueheneuc Y-G, Duchien L, Le Meur A-F (2010) Decor: A method for the specification and detection of code and design smells. IEEE Trans Softw Eng 36(1):20–36
Olbrich S, Cruzes DS, Basili V, Zazworka N (2009) The evolution and impact of code smells: A case study of two open source systems. In: Proceedings of the 2009 3rd international symposium on empirical software engineering and measurement. IEEE Computer Society, pp 390–400
Rapu D, Ducasse S, Gîrba T, Marinescu R (2004) Using history information to improve design flaws detection. In: Software maintenance and reengineering, 2004. CSMR 2004. Proceedings. Eighth European Conference on. IEEE, pp 223–232
Riel AJ (1996) Object-oriented design heuristics, vol 335. Addison-Wesley, Reading
Romano D, Raila P, Pinzger M, Khomh F (2012) Analyzing the impact of antipatterns on change-proneness using fine-grained source code changes. In: 2012 19th Working conference on reverse engineering (WCRE). IEEE, pp 437–446
srcML (2016) http://www.srcml.org, 2016, online; Accessed March 31st
Settas D, Cerone A, Fenz S (2012) Enhancing ontology-based antipattern detection using bayesian networks. Expert Syst Appl 39(10):9041–9053
Śliwerski J, Zimmermann T, Zeller A (2005) When do changes induce fixes?. In: ACM sigsoft software engineering notes, vol 30. ACM, pp 1–5
Stamelos I, Angelis L, Oikonomou A, Bleris GL (2002) Code quality analysis in open source software development. Inf Syst J 12(1):43–60
Strazzullo P, D’Elia L, Kandala N-B, Cappuccio FP (2009) Salt intake, stroke, and cardiovascular disease: meta-analysis of prospective studies. Bmj 339:b4567
Taba SES, Khomh F, Zou Y, Hassan AE, Nagappan M (2013) Predicting bugs using antipatterns. In: Software maintenance (ICSM), 2013 29th IEEE International conference on. IEEE, pp 270–279
Tichelaar S, Ducasse S, Demeyer S, Nierstrasz O (2000) A meta-model for language-independent refactoring. In: Proceedings international symposium on principles of software evolution. IEEE, pp 154–164
Tsantalis N, Chatzigeorgiou A, Stephanides G, Halkidis ST (2006) Design pattern detection using similarity scoring. IEEE Trans Softw Eng 32(11):896–909
Van Emden E, Moonen L (2002) Java quality assurance by detecting code smells. In: Reverse engineering, 2002. Proceedings. Ninth working conference on, pp 97–106
Vaucher S, Khomh F, Moha N, Guéhéneuc Y-G (2009) Tracking design smells: Lessons from a study of god classes. In: 16th Working conference on reverse engineering (WCRE 2009), IEEE Computer Society Press (WCRE’09)
Vlissides J, Helm R, Johnson R, Gamma E (1995) Design patterns: elements of reusable object-oriented software, vol 49. Addison-Wesley, Reading, p 11
Vokáč M (2004) Defect frequency and design patterns: An empirical study of industrial code. IEEE Trans Softw Eng 30(12):904–917
Webster BF (1995) Pitfalls of object oriented development. M&T Books
Wohlin C, Runeson P, Höst M, Ohlsson MC, Regnell B, Wesslén A (2012) Experimentation in software engineering. Springer Science & Business Media, New York
Yamashita AF, Moonen L (2013) Do developers care about code smells? an exploratory survey. In: WCRE, vol 13, pp 242–251
Yin RK (2013) Case study research: design and methods. Sage publications, Newbury Park
Author information
Authors and Affiliations
Corresponding author
Additional information
Communicated by: Xin Peng
Publisher’s note
Springer Nature remains neutral with regard to jurisdictional claims in published maps and institutional affiliations.
Rights and permissions
About this article
Cite this article
Kermansaravi, Z.A., Rahman, M.S., Khomh, F. et al. Investigating design anti-pattern and design pattern mutations and their change- and fault-proneness. Empir Software Eng 26, 9 (2021). https://doi.org/10.1007/s10664-020-09900-0
Accepted:
Published:
DOI: https://doi.org/10.1007/s10664-020-09900-0